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.

Medici family mystery may be solved after more than 400 years

https://www.cnn.com/2026/07/15/science/medici-family-mystery-dna-malaria
38•effects•1h ago•4 comments

GigaToken: ~1000x faster Language model tokenization

https://github.com/marcelroed/gigatoken/
310•syrusakbary•5h ago•57 comments

Quality non-fiction books are the antithesis of AI slop

https://resobscura.substack.com/p/quality-non-fiction-books-are-the
44•benbreen•8h ago•23 comments

Terrence Tao's ChatGPT Conversation about the Jacobian Conjecture Counterexample

https://chatgpt.com/share/6a5fdc7a-d6f8-83e8-bbea-8deb42cfed56
497•gmays•5h ago•302 comments

Malleable Computing, Emacs, and You

http://yummymelon.com/devnull/malleable-computing-emacs-and-you.html
44•kickingvegas•1h ago•5 comments

Safari Technology Preview 248 Released

https://webkit.org/blog/18162/release-notes-for-safari-technology-preview-248/
54•Erenay09•2h ago•11 comments

Show HN: Bento - An entire PowerPoint in one HTML file (edit+view+data+collab)

https://bento.page/slides/
581•starfallg•7h ago•141 comments

Are AI Labs Pelicanmaxxing?

https://dylancastillo.co/posts/pelicanmaxxing.html
330•dcastm•5h ago•131 comments

John C. Dvorak has died

https://twitter.com/na_announce/status/2079952538040672302
408•coleca•3h ago•117 comments

Everyone Should Know SIMD

https://mitchellh.com/writing/everyone-should-know-simd
187•WadeGrimridge•5h ago•56 comments

Show HN: Cactus Hybrid: We taught Gemma 4 to know when it's wrong

https://github.com/cactus-compute/cactus-hybrid
21•HenryNdubuaku•5h ago•3 comments

Any text-to-SQL benchmark should address difficulties of real-world data stores

https://cacm.acm.org/blogcacm/if-you-think-you-can-do-real-world-text-to-sql/
18•shenli3514•1h ago•3 comments

Nobody knows what a used GPU cluster is worth

https://ciphertalk.substack.com/p/nobody-knows-what-a-used-gpu-cluster
146•rbanffy•1w ago•123 comments

Making

https://beej.us/blog/data/ai-making/
247•erikschoster•7h ago•103 comments

Fairphone 6 wide camera experimental Linux support

https://nondescriptpointer.com/articles/fairphone-6-wide-camera-linux/
33•helonaut•2h ago•0 comments

Launch HN: Unlayer (YC W22) – Add email and document builders to your app

https://unlayer.com
43•adeelraza•7h ago•22 comments

The startup's Postgres survival guide

https://hatchet.run/blog/postgres-survival-guide
288•abelanger•10h ago•162 comments

I Inspected My Take-Home Interview Project. It Was a Whole Operation

https://citizendot.github.io/articles/fake-job-interview-git-hook-malware/
204•CITIZENDOT•2h ago•44 comments

How we made our LeRobot video reader up to 15× faster

https://www.eventual.ai/blog/how-we-made-our-lerobot-video-reader-up-to-15x-faster
6•ykev•5d ago•0 comments

Taking OCaml and Eio for a Spin

https://mattjhall.co.uk/posts/taking-ocaml-eio-for-a-spin.html
25•mattjhall•2d ago•2 comments

So Reddit has decided that plain HTML is unsafe

https://www.cole-k.com/2026/07/21/reddit/
200•montroser•10h ago•195 comments

Businesses with ugly AI menu redesigns

https://blog.fiddery.com/businesses-with-ugly-ai-menu-redesigns/
160•speckx•10h ago•124 comments

Nvidia DGX Spark as a daily driver

https://daniel.lawrence.lu/blog/2026-07-15-dgx-spark-as-daily-driver/
68•plun9•3d ago•55 comments

Ghost Cut – or why Cut and Paste is broken everywhere

https://ishmael.textualize.io/blog/ghost-cut/
112•willm•8h ago•80 comments

Fretboard Memorisation with Modular Arithmetic

https://ohaodha.ie/blog/fretboard-memorisation-with-modular-arithmetic/
4•ohaodha•57m ago•0 comments

Back to Kagi

https://blog.melashri.net/micro/back-to-kagi/
172•speckx•9h ago•146 comments

Why do we love music? (2018)

https://pmc.ncbi.nlm.nih.gov/articles/PMC6353111/
13•jstrieb•2d ago•1 comments

Show HN: ValuePair – a friendship app that cares about values first

https://valuepair.app
3•zloy88•47m ago•2 comments

Can a MUD evaluate LLMs? A $99 proof of concept

https://cruciblebench.ai/
91•Davisb135•7h ago•59 comments

Which streaming service was that on again?

https://www.timwehrle.de/blog/which-streaming-service-was-that-on-again/
40•weetii•8h ago•61 comments