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.

NIST scientists create 'any wavelength' lasers

https://www.nist.gov/news-events/news/2026/04/any-color-you-nist-scientists-create-any-wavelength...
224•rbanffy•8h ago•99 comments

Anonymous request-token comparisons from Opus 4.6 and Opus 4.7

https://tokens.billchambers.me/leaderboard
464•anabranch•12h ago•476 comments

Updating Gun Rocket through 10 years of Unity Engine

https://jackpritz.com/blog/updating-gun-rocket-through-10-years-of-unity-engine
50•tyleo•2d ago•14 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...
202•gnabgib•10h ago•185 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
299•NelsonMinar•12h ago•86 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/
54•agambrahma•6h ago•19 comments

Why Japan has such good railways

https://worksinprogress.co/issue/why-japan-has-such-good-railways/
348•RickJWagner•16h ago•344 comments

What Are Skiplists Good For?

https://antithesis.com/blog/2026/skiptrees/
10•mfiguiere•1d ago•0 comments

Modern Common Lisp with FSet

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

State of Kdenlive

https://kdenlive.org/news/2026/state-2026/
357•f_r_d•17h ago•116 comments

Migrating from DigitalOcean to Hetzner

https://isayeter.com/posts/digitalocean-to-hetzner-migration/
714•yusufusta•15h ago•368 comments

Optimizing Ruby Path Methods

https://byroot.github.io/ruby/performance/2026/04/18/faster-paths.html
67•weaksauce•8h ago•25 comments

Thoughts and feelings around Claude Design

https://samhenri.gold/blog/20260418-claude-design/
264•cdrnsf•9h ago•173 comments

Metatextual Literacy

https://www.jenn.site/metatextual-literacy/
8•dado3212•3d ago•0 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...
8•bookofjoe•2d ago•3 comments

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

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

NASA Shuts Off Instrument on Voyager 1 to Keep Spacecraft Operating

https://science.nasa.gov/blogs/voyager/2026/04/17/nasa-shuts-off-instrument-on-voyager-1-to-keep-...
117•sohkamyung•5h ago•49 comments

Show HN: MDV – a Markdown superset for docs, dashboards, and slides with data

https://github.com/drasimwagan/mdv
102•drasim•13h ago•37 comments

My first impressions on ROCm and Strix Halo

https://blog.marcoinacio.com/posts/my-first-impressions-rocm-strix-halo/
28•random_•7h ago•15 comments

PgQue: Zero-Bloat Postgres Queue

https://github.com/NikolayS/pgque
100•gmcabrita•12h ago•24 comments

Scientists discover “cleaner ants” that groom giant ants in Arizona desert

https://www.sciencedaily.com/releases/2026/04/260414075641.htm
88•t-3•3d ago•34 comments

80386 Memory Pipeline

https://nand2mario.github.io/posts/2026/80386_memory_pipeline/
97•wicket•4d ago•13 comments

Floating Point Fun on Cortex-M Processors

https://danielmangum.com/posts/floating-point-cortex-m/
46•hasheddan•1d ago•5 comments

I dug into the Postgres sources to write my own WAL receiver

https://medium.com/@mailbox.sq7/a-long-story-about-how-i-dug-into-the-postgresql-source-code-to-w...
30•alzhi7•1d ago•3 comments

Understanding the FFT Algorithm (2013)

https://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/
70•peter_d_sherman•4d ago•7 comments

Fuzix OS

https://www.fuzix.org/
87•DeathArrow•13h ago•23 comments

Category Theory Illustrated – Orders

https://abuseofnotation.github.io/category-theory-illustrated/04_order/
236•boris_m•22h ago•60 comments

Show HN: SmallDocs – Markdown without the frustrations

67•FailMore•3d ago•29 comments

UpCodes (YC S17) is hiring SDRs to help make construction more productive

https://up.codes/careers?utm_source=HN
1•Old_Thrashbarg•12h ago

Bypassing the kernel for 56ns cross-language IPC

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