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

Comments

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

After Ruining a Treasured Water Resource, Iran Is Drying Up

https://e360.yale.edu/features/iran-water-drought-dams-qanats
40•YaleE360•1h ago•12 comments

It's all about momentum

https://combo.cc/posts/its-all-about-momentum-innit/
25•sph•1h ago•3 comments

How getting richer made teenagers less free

https://www.theargumentmag.com/p/how-getting-richer-made-teenagers
71•NavinF•1h ago•54 comments

Slowness Is a Virtue

https://blog.jakobschwichtenberg.com/p/slowness-is-a-virtue
16•jakobgreenfeld•48m ago•1 comments

RCE via ND6 Router Advertisements in FreeBSD

https://www.freebsd.org/security/advisories/FreeBSD-SA-25:12.rtsold.asc
39•weeha•3h ago•28 comments

What is an elliptic curve? (2019)

https://www.johndcook.com/blog/2019/02/21/what-is-an-elliptic-curve/
80•tzury•4h ago•7 comments

GitHub Actions for Self-Hosted Runners Price Increase Postponed

https://pricetimeline.com/news/189
54•taubek•3h ago•35 comments

Egyptian Hieroglyphs: Lesson 1

https://www.egyptianhieroglyphs.net/egyptian-hieroglyphs/lesson-1/
65•jameslk•5h ago•14 comments

Jonathan Blow has spent the past decade designing 1,400 puzzles for you

https://arstechnica.com/gaming/2025/12/jonathan-blow-has-spent-the-past-decade-designing-1400-puz...
82•furcyd•6d ago•47 comments

Gemini 3 Flash: Frontier intelligence built for speed

https://blog.google/products/gemini/gemini-3-flash/
993•meetpateltech•18h ago•526 comments

Online Textbook for Braid groups and knots and tangles

https://matthematics.com/redoak/redoak.html
9•marysminefnuf•1h ago•0 comments

Coursera to combine with Udemy

https://investor.coursera.com/news/news-details/2025/Coursera-to-Combine-with-Udemy-to-Empower-th...
524•throwaway019254•22h ago•316 comments

I got hacked: My Hetzner server started mining Monero

https://blog.jakesaunders.dev/my-server-started-mining-monero-this-morning/
425•jakelsaunders94•14h ago•277 comments

Working quickly is more important than it seems (2015)

https://jsomers.net/blog/speed-matters
181•bschne•3d ago•94 comments

Building a High-Performance OpenAPI Parser in Go

https://www.speakeasy.com/blog/building-speakeasy-openapi-go-library
14•subomi•3d ago•2 comments

Ask HN: Those making $500/month on side projects in 2025 – Show and tell

267•cvbox•9h ago•238 comments

Gut bacteria from amphibians and reptiles achieve tumor elimination in mice

https://www.jaist.ac.jp/english/whatsnew/press/2025/12/17-1.html
412•Xunxi•12h ago•101 comments

Don MacKinnon: Why Simplicity Beats Cleverness in Software Design [audio]

https://maintainable.fm/episodes/don-mackinnon-why-simplicity-beats-cleverness-in-software-design
46•mooreds•2d ago•15 comments

AWS CEO says replacing junior devs with AI is 'one of the dumbest ideas'

https://www.finalroundai.com/blog/aws-ceo-ai-cannot-replace-junior-developers
938•birdculture•18h ago•481 comments

Judge hints Vizio TV buyers may have rights to source code licensed under GPL

https://www.theregister.com/2025/12/05/vizio_gpl_source_code_ruling/
105•pabs3•7h ago•13 comments

America's Dirtiest Carbon Polluters, Mapped to Ridiculous Precision

https://gizmodo.com/americas-dirtiest-carbon-polluters-mapped-to-ridiculous-precision-2000700924
8•ourmandave•31m ago•0 comments

Show HN: I built a fast RSS reader in Zig

https://github.com/superstarryeyes/hys
72•superstarryeyes•1d ago•21 comments

A Safer Container Ecosystem with Docker: Free Docker Hardened Images

https://www.docker.com/blog/docker-hardened-images-for-every-developer/
327•anttiharju•18h ago•75 comments

Breaking Paragraphs into Lines [pdf] (1981)

https://gwern.net/doc/design/typography/tex/1981-knuth.pdf
6•Smaug123•5d ago•2 comments

OBS Studio Gets a New Renderer

https://obsproject.com/blog/obs-studio-gets-a-new-renderer
259•aizk•14h ago•54 comments

We Let AI Run Our Office Vending Machine. It Lost Hundreds of Dollars

https://www.wsj.com/tech/ai/anthropic-claude-ai-vending-machine-agent-b7e84e34
9•lukaspetersson•41m ago•1 comments

'Ghost jobs' are on the rise – and so are calls to ban them

https://www.bbc.com/news/articles/clyzvpp8g3vo
133•1659447091•6h ago•137 comments

Tell HN: HN was down

570•uyzstvqs•18h ago•309 comments

Ask HN: Does anyone understand how Hacker News works?

110•jannesblobel•11h ago•141 comments

Cloudflare Radar 2025 Year in Review

https://radar.cloudflare.com/year-in-review/2025
96•ksec•13h ago•38 comments