frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Fast(er) regular expression engines in Ruby

https://serpapi.com/blog/faster-regular-expression-engines-in-ruby/
60•davidsojevic•1y ago

Comments

yxhuvud•1y ago
Eww, pretending to support utf8 matchers while not supporting them at all was not pretty to see.
gitroom•1y ago
Honestly that part bugs me, fake support is worse than no support imo
kayodelycaon•1y ago
> Another nuance was found in ruby, which cannot scan the haystack with invalid UTF-8 byte sequences.

This is extremely basic ruby: UTF-8 encoded strings must be valid UTF-8. This is not unique to ruby. If I recall correctly, python 3 does the same thing.

    2.7.1 :001 > haystack = "\xfc\xa1\xa1\xa1\xa1\xa1abc"
    2.7.1 :003 > haystack.force_encoding "ASCII-8BIT"
    => "\xFC\xA1\xA1\xA1\xA1\xA1abc" 
    2.7.1 :004 > haystack.scan(/.+/)
    => ["\xFC\xA1\xA1\xA1\xA1\xA1abc"]
This person is a senior engineer on their Team page. All they had to do was google "ArgumentError: invalid byte sequence in UTF-8". Or ask a coworker... the company has Ruby on Rails applications. headdesk
burntsushi•1y ago
The nuance is specifically relevant here because neither of the other two regex engines benchmarked have this requirement. It's doubly relevant because that means running a regex search doesn't require a UTF-8 validation step, and is therefore likely beneficial from a perf perspective, dependening on the workload.
kayodelycaon•1y ago
That’s a good point. I hadn’t considered it because I’ve hit the validation error long before getting to search. It is possible to avoid string operations with careful coding prior to the search.

Edit: After a little testing, the strings can be read from and written to files without triggering validation. Presumably this applies to sockets as well.

DmitryOlshansky•1y ago
I wonder how std.regex of dlang would fare in such test. Sadly due to a tiny bit of D’s GC use it’s hard to provide as a library for other languages. If there is an interest I might take it through the tests.

Microsoft open-sources "the earliest DOS source code discovered to date"

https://arstechnica.com/gadgets/2026/04/microsoft-open-sources-the-earliest-dos-source-code-disco...
84•DamnInteresting•2h ago•22 comments

Scammers are abusing an internal Microsoft account to send spam links

https://techcrunch.com/2026/05/21/scammers-are-abusing-an-internal-microsoft-account-to-send-spam/
59•spike021•3h ago•9 comments

Wake up! 16b

https://hellmood.111mb.de/wake_up_16b_writeup.html
85•MaximilianEmel•3h ago•6 comments

Time to talk about my writerdeck

https://veronicaexplains.net/my-first-writerdeck/
320•hggh•9h ago•181 comments

Green card seekers must leave U.S. to apply, Trump administration says

https://www.nytimes.com/2026/05/22/us/politics/green-card-changes-trump.html
668•tlhunter•1d ago•1149 comments

On The <dl> (2021)

https://benmyers.dev/blog/on-the-dl/
367•ravenical•14h ago•108 comments

My I3-Emacs Integration

https://khz.ac/software/i3-integration.html
40•nosolace•4h ago•7 comments

My two-part desk setup (2025)

https://arslan.io/2025/11/18/my-two-part-desk-setup/
238•James72689•3d ago•138 comments

Judson's Last Ride

https://www.realclearpolitics.com/articles/2026/05/22/judsons_last_ride_154150.html
61•NaOH•15h ago•2 comments

Sales and Dungeons: Thermal printer TTRPG utility

https://sales-and-dungeons.app/
62•hyperific•1d ago•19 comments

Byrne's Euclid

https://www.c82.net/euclid/
26•layer8•5h ago•7 comments

The Art of Money Getting

https://kk.org/cooltools/book-freak-210-the-art-of-money-getting/
220•dxs•15h ago•140 comments

SpaceX launches Starship v3 rocket

https://www.space.com/space-exploration/launches-spacecraft/spacex-starship-v3-megarocket-first-t...
381•busymom0•1d ago•254 comments

Hengefinder: Finding when the sun aligns with your street

https://victoriaritvo.com/blog/hengefinder/
119•evakhoury•1d ago•27 comments

.NET (OK, C#) finally gets union types

https://andrewlock.net/exploring-the-dotnet-11-preview-2-dotnet-gets-union-types/
158•ingve•1d ago•144 comments

New map reveals lost roads of the Roman Empire

https://www.scientificamerican.com/article/new-high-resolution-map-transforms-what-we-know-about-...
51•sohkamyung•3d ago•7 comments

Reverse engineering circuitry in a Spacelab computer from 1980

https://www.righto.com/2026/05/reverse-engineering-spacelab-computer.html
89•elpocko•11h ago•18 comments

Show HN: Anyone interested in a tool helps to explore C++ ASTs

https://uvic-aurora.github.io/acav-manual/index.html
20•leomicv•2d ago•2 comments

80386 microcode disassembled

https://www.reenigne.org/blog/80386-microcode-disassembled/
227•nand2mario•15h ago•46 comments

Toxic chemical leak at a manufacturing facility in Orange County

https://www.bbc.com/news/articles/c3w2l249j8go
133•borski•5h ago•89 comments

PHP's Oddities

https://flowtwo.io/post/php%27s-oddities
103•thejoeflow•4d ago•128 comments

Air France and Airbus found guilty of manslaughter over 2009 plane crash

https://www.bbc.com/news/articles/czd2qmdvmq6o
24•baal80spam•7h ago•11 comments

Kindle loyalists scramble as Amazon turns page on old e-readers

https://www.reuters.com/business/retail-consumer/kindle-loyalists-scramble-amazon-turns-page-old-...
128•cf100clunk•4d ago•146 comments

-​-dangerously-skip-reading-code

https://olano.dev/blog/dangerously-skip/
106•fagnerbrack•18h ago•123 comments

Making deep learning go brrrr from first principles (2022)

https://horace.io/brrr_intro.html
156•tosh•16h ago•59 comments

ICE Awards $25M Iris-Scanning Contract to Bi2 Technologies

https://www.projectsaltbox.com/p/ice-awards-25-million-iris-scanning
104•cdrnsf•4h ago•26 comments

Revised^7 Report on Scheme, Large: Procedural Fascicle Draft is now public

https://r7rs.org/large/fascicles/proc/
11•pmcgoron•3d ago•2 comments

API proposed by Chrome: Declarative partial updates

https://developer.chrome.com/blog/declarative-partial-updates
10•theanonymousone•3h ago•0 comments

sp.h: Fixing C by giving it a high quality, ultra portable standard library

https://spader.zone/sp/
196•dboon•3d ago•178 comments

Show HN: Twixt – transform one word into another in four moves

https://twixt.games/
7•unseen_forms•2d ago•4 comments