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•11mo ago

Comments

yxhuvud•11mo ago
Eww, pretending to support utf8 matchers while not supporting them at all was not pretty to see.
gitroom•11mo ago
Honestly that part bugs me, fake support is worse than no support imo
kayodelycaon•11mo 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•11mo 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•11mo 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•11mo 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.

Archive of Byte magazine, starting with issue #1 in 1975

https://archive.org/details/byte-magazine-1975-09
90•DamnInteresting•1d ago•22 comments

SPEAKE(a)R: Turn Speakers to Microphones for Fun and Profit [pdf] (2017)

https://www.usenix.org/system/files/conference/woot17/woot17-paper-guri.pdf
79•Eridanus2•3h ago•32 comments

Game devs explain the tricks involved with letting you pause a game

https://kotaku.com/video-game-devs-explain-how-pausing-works-and-sometimes-it-gets-weird-2000686339
171•speckx•2d ago•111 comments

What are skiplists good for?

https://antithesis.com/blog/2026/skiptrees/
125•mfiguiere•1d ago•26 comments

NIST scientists create 'any wavelength' lasers

https://www.nist.gov/news-events/news/2026/04/any-color-you-nist-scientists-create-any-wavelength...
331•rbanffy•15h ago•143 comments

Frank Dudley Beane's Experience with Ergot and Cannabis Indica (1884)

https://publicdomainreview.org/collection/experience-with-ergot-and-cannabis/
11•apollinaire•2d ago•2 comments

Anonymous request-token comparisons from Opus 4.6 and Opus 4.7

https://tokens.billchambers.me/leaderboard
539•anabranch•20h ago•524 comments

College instructor turns to typewriters to curb AI-written work

https://sentinelcolorado.com/uncategorized/a-college-instructor-turns-to-typewriters-to-curb-ai-w...
312•gnabgib•17h ago•313 comments

The seven programming ur-languages

https://madhadron.com/programming/seven_ur_languages.html
29•helloplanets•4h ago•9 comments

The electromechanical angle computer inside the B-52 bomber's star tracker

https://www.righto.com/2026/04/B-52-star-tracker-angle-computer.html
354•NelsonMinar•19h ago•93 comments

Changes in the system prompt between Claude Opus 4.6 and 4.7

https://simonwillison.net/2026/Apr/18/opus-system-prompt/
29•pretext•1h ago•5 comments

Ask HN: How did you land your first projects as a solo engineer/consultant?

61•modelcroissant•3h ago•30 comments

Updating Gun Rocket through 10 years of Unity Engine

https://jackpritz.com/blog/updating-gun-rocket-through-10-years-of-unity-engine
89•tyleo•3d ago•39 comments

Why Zip drives dominated the 90s, then vanished almost overnight

https://www.xda-developers.com/zip-drives-dominated-90s-vanished-almost-overnight/
21•naves•1h ago•12 comments

Why Japan has such good railways

https://worksinprogress.co/issue/why-japan-has-such-good-railways/
433•RickJWagner•23h ago•413 comments

Binary Dependencies: Identifying the Hidden Packages We All Depend On

https://vlad.website/binary-dependencies-identifying-the-hidden-packages-we-all-depend-on/
33•PaulHoule•2d ago•2 comments

It's cool to care (2025)

https://alexwlchan.net/2025/cool-to-care/
27•surprisetalk•3d ago•13 comments

The world in which IPv6 was a good design

https://apenwarr.ca/log/20170810
85•signa11•9h ago•24 comments

State of Kdenlive

https://kdenlive.org/news/2026/state-2026/
413•f_r_d•1d ago•126 comments

Keep Pushing: We Get 10 More Days to Reform Section 702

https://www.eff.org/deeplinks/2026/04/keep-pushing-we-get-10-more-days-reform-section-702
95•nobody9999•5h ago•13 comments

Binary GCD

https://en.algorithmica.org/hpc/algorithms/gcd/#binary-gcd
10•tosh•3h ago•0 comments

Migrating from DigitalOcean to Hetzner

https://isayeter.com/posts/digitalocean-to-hetzner-migration/
803•yusufusta•22h ago•404 comments

Modern Common Lisp with FSet

https://fset.common-lisp.dev/Modern-CL/Top_html/index.html
163•larve•3d ago•20 comments

Metatextual Literacy

https://www.jenn.site/metatextual-literacy/
41•dado3212•3d ago•3 comments

Optimizing Ruby Path Methods

https://byroot.github.io/ruby/performance/2026/04/18/faster-paths.html
107•weaksauce•15h ago•38 comments

Sumida Aquarium Posts 2026 Penguin Relationship Chart, with Drama and Breakups

https://www.sumida-aquarium.com/special/sokanzu/en/2026/
222•Lwrless•3d ago•12 comments

Thoughts and feelings around Claude Design

https://samhenri.gold/blog/20260418-claude-design/
332•cdrnsf•17h ago•205 comments

Dizzying Spiral Staircase with Single Guardrail Once Led to Top of Eiffel Tower

https://www.smithsonianmag.com/smart-news/a-dizzying-spiral-staircase-with-a-single-guardrail-onc...
29•bookofjoe•2d ago•15 comments

Zero-Copy GPU Inference from WebAssembly on Apple Silicon

https://abacusnoir.com/2026/04/18/zero-copy-gpu-inference-from-webassembly-on-apple-silicon/
92•agambrahma•13h ago•36 comments

Bypassing the kernel for 56ns cross-language IPC

https://github.com/riyaneel/Tachyon/tree/main/docs/adr
51•riyaneel•2d ago•23 comments