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.

Binance-hacker-1029 – $5.6B stolen from Binance

https://arkm.com/explorer/entity/21a94755-f604-45e5-9501-6542e23005e8
786•Tiberium•4h ago•468 comments

We're releasing the weights of Mistral Large 4

https://mistral.ai/news/mistral-large-4-oss/
1225•kuberwastaken•12h ago•343 comments

Pico CSS is no longer maintained

https://github.com/picocss/pico/discussions/754
22•henrid•39m ago•4 comments

We ran AI agent swarms in Minecraft and Mindustry

https://labs.ycombinator.com/projects/games/index.html
179•sandslash•4h ago•66 comments

Study: Schoolwide phone bans show no significant impact on mental health

https://jamanetwork.com/journals/jamanetworkopen/fullarticle/2855858
19•giuliomagnifico•1d ago•5 comments

A tiny world model running games on a Raspberry Pi Pico 2 W

https://github.com/SheepSeb/tinyworldformer
140•airinei•6h ago•8 comments

El Niño Is Flooding California's Coasts with the Highest Tides to Come

https://gizmodo.com/el-nino-is-already-flooding-californias-coasts-and-the-years-highest-tides-ha...
102•gumby•4h ago•35 comments

Herdr has released native app

https://github.com/herdrdev/herdr-app
24•cherioo•1h ago•20 comments

Iterating Backwards in C

https://www.davidpriver.com/Iterating-backwards-in-C.html
34•cremno•3d ago•13 comments

A Pig, the State, and War: Porco Rosso (Kurenai No Buta) (2014)

https://journal.animationstudies.org/article/id/66/
51•simonebrunozzi•4h ago•9 comments

H.264 Is Magic (2016)

https://sidbala.com/h-264-is-magic/
342•ea016•10h ago•125 comments

Cormac McCarthy's Library

https://cormacmccarthy.lib.utk.edu/
16•maitland•2h ago•5 comments

LLM Voice

https://martinfowler.com/bliki/LLM-Voice.html
358•ibobev•11h ago•181 comments

Show HN: I Turned DOOM into a Transformer

https://github.com/mottopanikeiku/doomformer
46•falperc•3h ago•9 comments

The Great American Rascal: Tom Sawyer at 150

https://claremontreviewofbooks.com/the-great-american-rascal/
47•beatstop•4h ago•17 comments

DoorDash to acquire Instacart

https://about.doordash.com/en-us/news/doordash-to-acquire-instacart
434•WalterSobchak•14h ago•606 comments

Patrick Stewart has died

https://www.nytimes.com/2026/10/29/arts/television/patrick-stewart-dead.html
2473•j4mie•6h ago•523 comments

Historical Scientific Instruments

https://nealstephenson.substack.com/p/historical-scientific-instruments
20•peteforde•2d ago•0 comments

ElementaryUI – Swift, in the Browser

https://elementary.codes
62•frizlab•5h ago•16 comments

Sylphide OS: a general-purpose OS for microcontroller-based computers

https://projects.freehackers.org/sylphide-os/
42•iamnothere•5h ago•13 comments

Chained PHP2Shell exploit roots 25 servers, including US Government servers

https://dreamgroup.com/blog/chained-php2shell-exploit-roots-25-servers
296•882542F3884314B•15h ago•146 comments

Show HN: Auto Dismiss Mac OS "Allow <app> to find devices on local networks?"

https://github.com/johncassil/dontallow
104•johncassil•7h ago•78 comments

If IPv4 were land

https://iptrust.co/blog/if-ipv4-were-land
238•rokostik•14h ago•331 comments

What we know so far about Spain train crash

https://www.bbc.com/news/articles/cm8xz7pkd0jjo
166•ZeljkoS•17h ago•317 comments

IgE disruptor for food allergy with Claude-enabled antibody design [pdf]

https://divergencelabs.com/publications/ige-preprint.pdf
40•matco11•7h ago•30 comments

Show HN: Arken – Passwordless auth middleware using secp256k1 keys

https://github.com/zacharybenson/arken-protocol
3•zachbenson817•1h ago•0 comments

Launch HN: Simantic (YC F26) – Firmware Simulation for AI Agents

53•shong0504•10h ago•15 comments

16colo.rs – ANSI/ASCII art archive

https://16colo.rs/
89•memalign•10h ago•8 comments

Zombie stats: Where the numbers AI quotes come from

https://trakkr.ai/trakkr-research/zombie-stats
148•mektrik•11h ago•63 comments

Partitioning my digital life into security domains (2011)

https://blog.invisiblethings.org/2011/03/13/partitioning-my-digital-life-into.html
32•mashally•2d ago•0 comments