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.

The newest Instagram “exploit” is the goofiest I've seen

https://www.0xsid.com/blog/meta-account-takeover-fiasco
1379•ssiddharth•10h ago•332 comments

Can the stockmarket swallow Anthropic, SpaceX and OpenAI?

https://www.economist.com/finance-and-economics/2026/06/01/can-the-stockmarket-swallow-anthropic-...
99•1vuio0pswjnm7•2h ago•191 comments

macOS needs its grid back

https://blog.hopefullyuseful.com/blog/macos-needs-its-grid-back/
38•ranebo•1h ago•21 comments

OpenAI frontier models and Codex are now available on AWS

https://openai.com/index/openai-frontier-models-and-codex-are-now-available-on-aws/
149•typpo•4h ago•50 comments

Debug Project

https://debug.com/
156•Eridanus2•5h ago•71 comments

How is Groq raising more money?

https://www.zach.be/p/how-the-hell-is-groq-raising-more
14•hasheddan•1h ago•3 comments

Chipotlai Max

https://github.com/cyberpapiii/chipotlai-max
54•nigelgutzmann•3h ago•9 comments

AI Agent Guidelines for CS336 at Stanford

https://github.com/stanford-cs336/assignment1-basics/blob/main/CLAUDE.md
332•prakashqwerty•9h ago•118 comments

Crystal Nights (2008)

https://www.gregegan.net/MISC/CRYSTAL/Crystal.html
8•rorylawless•1h ago•0 comments

Squillions: How Money Laundering Won

https://www.lrb.co.uk/the-paper/v48/n09/john-lanchester/squillions
14•rwmj•1d ago•3 comments

CS336: Language Modeling from Scratch

https://cs336.stanford.edu/
368•kristianpaul•12h ago•43 comments

Should you normalize RGB values by 255 or 256?

https://30fps.net/pages/255-vs-256-division/
199•pplanu•9h ago•85 comments

A new way to build chips: Sequentially stacking silicon to extend Moore's Law

https://matse.illinois.edu/news/85775
24•hhs•2d ago•5 comments

GrapheneOS Speech Services version 2 released

https://discuss.grapheneos.org/d/36001-grapheneos-speech-services-version-2-released
100•pretext•7h ago•16 comments

What appear to be biochemical processes may be a natural feature of geology

https://www.quantamagazine.org/the-dirt-that-refused-to-die-20260601/
197•speckx•11h ago•65 comments

Microsoft builds MacBook Pro rival with NVIDIA-powered Surface Laptop Ultra

https://www.windowslatest.com/2026/06/01/microsoft-builds-its-ultimate-macbook-pro-rival-with-the...
151•jbk•14h ago•357 comments

Nvidia RTX Spark

https://www.nvidia.com/en-us/products/rtx-spark/
339•shenli3514•21h ago•333 comments

Constant Q Transform – A Visual Guide

https://brendanjameslynskey.github.io/ConstantQ-Transform/
8•hyperific•3d ago•0 comments

What's gonna happen to software engineers?

https://yakko.dev/blog/whats-gonna-happen-to-software-developers
36•yakkomajuri•2h ago•47 comments

Anyone seen a CC- serial prefix on legacy networking hardware?

9•Throwaway_sys•2d ago•1 comments

Age verification for social media, the beginning of the end for a free internet?

https://mullvad.net/en/blog/age-verification-for-social-media-the-beginning-of-the-end-for-a-free...
101•StrLght•3h ago•55 comments

Ask HN: Who is hiring? (June 2026)

165•whoishiring•11h ago•235 comments

Book Dedications

https://walzr.com/dedications
6•walz•2h ago•1 comments

Stealing from Biologists to Compile Haskell Faster

https://www.iankduncan.com/engineering/2026-05-30-stealing-from-biologists-to-compile-haskell-fas...
96•mooreds•2d ago•4 comments

Launch HN: Expanse (YC P26) – Unlock Wasted GPU Capacity

70•ismaeel_bashir•13h ago•22 comments

I made my phone slow on purpose

https://vinewallapp.com/notes/i-made-my-phone-slow-on-purpose/
169•gcampos•4d ago•158 comments

The Frame Problem (2004)

https://plato.stanford.edu/entries/frame-problem/
14•rzk•3h ago•3 comments

Alphabet announces $80B equity capital raise to expand AI infra and compute

https://abc.xyz/investor/news/news-details/2026/Alphabet-Announces-Proposed-80-Billion-Equity-Cap...
112•gregschlom•5h ago•114 comments

Only 17% of all 64-bit Integers are products of two 32-bit integers

https://lemire.me/blog/2026/05/22/only-17-of-all-64-bit-integers-are-products-of-two-32-bit-integ...
205•sebg•4d ago•94 comments

Ask HN: Who wants to be hired? (June 2026)

99•whoishiring•11h ago•277 comments