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.

MiMo-v2.5-Pro-UltraSpeed: 1T model with 1000 tokens per second

https://mimo.xiaomi.com/blog/mimo-tilert-1000tps
64•gainsurier•37m ago•14 comments

Show HN: Performative-UI – a react component library of design tropes

https://vorpus.github.io/performativeUI/
219•lizhang•2h ago•45 comments

Zig by Example

https://github.com/boringcollege/zig-by-example
146•dariubs•2h ago•68 comments

Launch HN: Intuned (YC S22) – Build and run reliable browser automations as code

https://intunedhq.com
66•fkilaiwi•2h ago•15 comments

Anti-social: It's fads, not friends, which now dominate social media feeds

https://www.bbc.com/worklife/article/20260520-how-social-media-ceased-to-be-social
251•1vuio0pswjnm7•4h ago•216 comments

The Cypherpunk Library

https://www.cypherpunkbooks.com
235•yu3zhou4•7h ago•76 comments

Life is too short for a slow terminal

https://mijndertstuij.nl/posts/life-is-too-short-for-a-slow-terminal/
38•emschwartz•2d ago•31 comments

How much of Thermo Fisher's antibody data has been manipulated?

https://reeserichardson.blog/2026/05/28/how-much-of-thermo-fishers-antibody-data-has-been-manipul...
260•mhrmsn•9h ago•56 comments

Zig Structs of Arrays (2024)

https://andreashohmann.com/zig-struct-of-arrays/
85•Tomte•4d ago•19 comments

A Farmer Donated Land to Turn into a Park. The City Is Building a Data Center

https://www.404media.co/a-farmer-donated-land-to-turn-into-a-park-the-city-is-building-a-massive-...
32•greedo•50m ago•2 comments

Dopamine Fracking

https://igerman.cc/blog/dopamine-fracking/
610•igmn•13h ago•311 comments

Italy's Bending Spoons, Owner of AOL and Vimeo, Files for Nasdaq IPO

https://www.reuters.com/legal/transactional/italys-bending-spoons-files-us-ipo-2026-06-08/
33•mmarian•1h ago•14 comments

I replaced Spotify with a homemade FM radio station

https://old.reddit.com/r/digitalminimalism/comments/1tes8yu/i_replaced_spotify_with_a_homemade_fm...
27•dredmorbius•39m ago•11 comments

1k Data Breaches Later, the Disclosure Lag Is Worse

https://www.troyhunt.com/1000-data-breaches-later-the-disclosure-lag-is-worse-than-ever/
255•882542F3884314B•12h ago•100 comments

Building from zero after addiction, prison, and a felony

https://gavinray97.github.io/blog/building-from-zero-after-addiction-prison-felony
799•gavinray•21h ago•364 comments

Spherical Voronoi Diagram

https://www.jasondavies.com/maps/voronoi/
90•marysminefnuf•5d ago•23 comments

OCaml Onboarding: Introduction to the Dune build system

https://ocamlpro.com/blog/2025_07_29_ocaml_onboarding_introduction_to_dune/
10•andrewstetsenko•3d ago•0 comments

Config Files That Run Code: Supply Chain Security Blindspot

https://safedep.io/config-files-that-run-code/
48•signa11•6h ago•11 comments

APC–2 – A professional record cutter for producing original playback discs

https://teenage.engineering/products/apc-2
251•vthommeret•14h ago•159 comments

The Smallest Brain You Can Build: A Perceptron in Python

https://ranpara.net/posts/perceptron-explained-from-scratch/
272•DevarshRanpara•15h ago•60 comments

SoulsOnly.tff – A font for humans not AI and keyboard firmware to type in it

https://github.com/convictional/souls-only
17•billtarbell•2h ago•9 comments

A Family Project (2022)

https://bittersoutherner.com/feature/2022/a-family-project
68•surprisetalk•3d ago•5 comments

Richard Scolyer Has Died

https://www.bbc.com/news/articles/c14yz5jg476o
112•nicwilson•11h ago•30 comments

Proton is funding the French far right on YouTube

https://old.reddit.com/r/degoogle/comments/1tzbizh/proton_is_funding_the_french_far_right_on_youtube
16•partsch•18m ago•2 comments

Playing with Vision Embeddings

https://prestonbjensen.com/posts/playing-with-vision-embeddings
123•prestoj•3d ago•10 comments

Making peace with your unlived dreams (2023)

https://nik.art/making-peace-with-your-unlived-dreams/
281•herbertl•21h ago•175 comments

New drug 'functionally cures' many hepatitis B virus infections

https://www.science.org/content/article/new-drug-functionally-cures-many-hepatitis-b-virus-infect...
247•gmays•14h ago•43 comments

Show HN: I Derived a Pancake

https://www.absurdlyoptimized.com/recipes/pancakes/
302•bkazez•3d ago•120 comments

Amazon Cognito now supports multi-Region replication

https://aws.amazon.com/about-aws/whats-new/2026/06/amazon-cognito-multi-region/
13•mooreds•45m ago•3 comments

Tiny hackable CUDA language model implementation

https://github.com/markusheimerl/gpt
60•markusheimerl•2d ago•13 comments