frontpage.
newsnewestaskshowjobs

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.

Everything I own, owned

https://schlarp.com/posts/everything-i-own-owned/
382•schlarpc•4h ago•114 comments

How I find problems to solve as a staff engineer

https://lalitm.com/post/find-problems-staff-engineer/
308•vanpra•8h ago•110 comments

Anthropic's best AI model struggles to attract users as cheaper tools thrive

https://www.ft.com/content/5ee49718-c258-4f01-aa32-7e5b76ae5245
281•naves•9h ago•246 comments

Migrating a Synology NAS to a UniFi UNAS Pro 8 with Robocopy, SMB Multichannel

https://www.hanselman.com/blog/migrating-a-synology-nas-to-a-unifi-unas-pro-8-with-robocopy-smb-m...
19•soheilpro•2h ago•15 comments

Google Workspace thinks my domain is an email provider (2025)

https://blog.elis.cc/articles/google-workspace-thinks-my-domain-is-an-email-provider/
201•el1s7•8h ago•52 comments

My agent.md to improve LLM-assisted code quality

https://fabiensanglard.net/agent.md/index.html
196•ibobev•9h ago•86 comments

What Is a Harness?

https://earendil.com/posts/what-is-a-harness/
335•tosh•13h ago•139 comments

How Complex Systems Fail (1998)

https://how.complexsystems.fail/
258•shortcrct•12h ago•63 comments

Malware infects Android-based automotive head unit firmware

https://securelist.com/android-head-unit-malware/121106/
221•campuscodi•14h ago•108 comments

My favorite nonfiction books about cults, scams, and schemes

https://bookdna.com/best-books/nonfiction-about-cults-scams-and-schemes
204•bwb•13h ago•75 comments

Implementation of GPT-2 in pure CMake

https://github.com/AlpinDale/gpt2.cmake
44•porridgeraisin•5h ago•11 comments

Why Sal Khan't: On Learning by Making but Teaching by Telling

https://punyamishra.com/2026/04/16/why-sal-khant-on-learning-by-making-but-teaching-by-telling/
146•the-mitr•11h ago•90 comments

Rural Village in Spain Is Welcoming Digital Nomads with Open Arms

https://www.cntraveler.com/story/this-rural-village-in-spain-is-welcoming-digital-nomads-with-ope...
38•simonebrunozzi•7h ago•24 comments

The first search engine for Internet-connected devices

https://www.shodan.io/
5•momentmaker•2h ago•0 comments

A website for debloated open source alternatives

https://debloat.dev/
277•ryanvogel•10h ago•92 comments

Explain it to me like I'm ten

https://timharford.com/2026/08/explain-it-to-me-like-im-ten/
88•bookofjoe•9h ago•42 comments

Decoding silent reading from non-invasive EEG

https://arxiv.org/abs/2608.20186
36•root-parent•7h ago•14 comments

Kodak DC50 now usable on the Apple II

https://www.colino.net/wordpress/archives/2026/08/23/kodak-dc50-now-usable-on-the-apple-ii/
47•ibobev•11h ago•8 comments

AI and Infrastructure Engineering

https://omegion.dev/2026/08/ai-and-infrastructure-engineering/
51•0megion•9h ago•18 comments

Parallel development without the headaches using Git worktree

https://barrd.dev/article/parallel-development-without-the-headaches-using-git-worktree/
27•oogali•5h ago•23 comments

Declarative WebGPU with S-Expressions

https://hugodaniel.com/posts/declarative-webgpu-with-s-expressions/
26•hugodan•6h ago•3 comments

Over 170k Nonprofits Lost All Their Data. Is Microsoft to Blame?

https://slate.com/technology/2026/08/microsoft-software-nonprofit-data-delete.html
194•tchalla•8h ago•84 comments

The Remote Work Challenge: Lessons from 5 Cities

https://www.pew.org/en/research-and-analysis/reports/2026/05/the-remote-work-challenge-lessons-fr...
43•softwaredoug•10h ago•17 comments

The Vibe Tax

https://insufferable.dev/posts/vibe-tax/
115•allisdust•9h ago•95 comments

Things I want in a modern relational query language

https://sporks.space/2026/08/19/things-i-want-in-a-modern-relational-query-language/
91•zdw•1d ago•90 comments

The Sloppification of Peptides

https://henryaj.substack.com/p/the-sloppification-of-peptides
108•henryaj•18h ago•89 comments

Death to px, long live ch

https://shkspr.mobi/blog/2026/08/death-to-px-long-live-ch/
67•Brajeshwar•13h ago•47 comments

Coconut oil jet fuel matches kerosene's efficiency in engine tests

https://studyfinds.com/coconut-oil-jet-fuel-matches-kerosenes-efficiency-in-engine-tests/
155•mdp2021•11h ago•185 comments

Fable and the end of the free lunch

https://www.dbreunig.com/2026/08/23/fable-the-end-of-moore-s-law.html
130•dbreunig•8h ago•105 comments

The planet now has more trees than it did 35 years ago (2018)

https://psmag.com/environment/the-planet-now-has-more-trees-than-it-did-35-years-ago/
66•bookofjoe•5h ago•41 comments