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•12mo ago

Comments

yxhuvud•11mo ago
Eww, pretending to support utf8 matchers while not supporting them at all was not pretty to see.
gitroom•11mo ago
Honestly that part bugs me, fake support is worse than no support imo
kayodelycaon•11mo 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•11mo 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•11mo 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•11mo 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.

I bought Friendster for $30k – Here's what I'm doing with it

https://ca98am79.medium.com/i-bought-friendster-for-30k-heres-what-i-m-doing-with-it-d5e8ddb3991d
392•ca98am79•5h ago•221 comments

Self-updating screenshots

https://interblah.net/self-updating-screenshots
47•bjhess•18h ago•8 comments

Three constraints before I build anything

https://jordanlord.co.uk/blog/3-constraints/
34•nervous_north•1d ago•4 comments

Fast16: High-precision software sabotage 5 years before Stuxnet

https://www.sentinelone.com/labs/fast16-mystery-shadowbrokers-reference-reveals-high-precision-so...
150•dd23•5h ago•43 comments

Box to save memory in Rust

https://dystroy.org/blog/box-to-save-memory/
57•emschwartz•3d ago•10 comments

Google banks on AI edge to catch up to cloud rivals Amazon and Microsoft

https://www.ft.com/content/2429f0f0-b685-4747-b425-bf8001a2e94c
52•donsupreme•1h ago•14 comments

Butterflies are in decline across North America, a look at the Western Monarch

https://www.smithsonianmag.com/science-nature/butterflies-are-in-dramatic-decline-across-north-am...
124•1659447091•4h ago•35 comments

AI should elevate your thinking, not replace it

https://www.koshyjohn.com/blog/ai-should-elevate-your-thinking-not-replace-it/
281•koshyjohn•5h ago•233 comments

SWE-bench Verified no longer measures frontier coding capabilities

https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/
248•kmdupree•11h ago•140 comments

Show HN: AI memory with biological decay (52% recall)

https://github.com/sachitrafa/YourMemory
58•SachitRafa•4h ago•29 comments

The fastest Linux timestamps

https://www.hmpcabral.com/2026/04/26/the-fastest-linux-timestamps/
15•hmpc•12h ago•3 comments

Lessons from building multiplayer browsers

https://www.alejandro.pe/writing/sail-muddy-lessons
8•alejandrohacks•10h ago•2 comments

Magic: The Gathering took me from N2 to Japanese fluency

https://www.tokyodev.com/articles/how-magic-the-gathering-took-me-from-n2-to-japanese-fluency
84•pwim•3d ago•28 comments

When the cheap one is the cool one

https://arun.is/blog/cheap-cool/
11•ddrmaxgt37•1d ago•3 comments

Running Bare-Metal Rust Alongside ESP-IDF on the ESP32-S3's Second Core

https://tingouw.com/blog/embedded/esp32/run_rust_on_app_core
32•MrBuddyCasino•2d ago•4 comments

Quirks of Human Anatomy

https://www.sdbonline.org/sites/fly/lewheldquirk/figlegq6.htm
88•gurjeet•1d ago•55 comments

MoQ Boy

https://moq.dev/blog/moq-boy/
37•mmcclure•5h ago•3 comments

Sawe becomes first athlete to run a sub-two-hour marathon in a competitive race

https://www.bbc.com/sport/athletics/articles/crm1m7e0zwzo
247•berkeleyjunk•4h ago•197 comments

Clay PCB Tutorial

https://feministhackerspaces.cargo.site/Clay-PCB-Tutorial
194•j0r0b0•9h ago•120 comments

XOXO Festival Archive

https://xoxofest.com/
42•surprisetalk•2d ago•8 comments

The Visible Zorker: Zork 1

https://eblong.com/infocom/visi/zork1/
106•PLenz•9h ago•19 comments

Chernobyl Wildlife Forty Years On

https://www.bbc.com/future/article/20260424-chernobyl-wildlife-forty-years-on
40•reconnecting•6h ago•1 comments

An AI agent deleted our production database. The agent's confession is below

https://twitter.com/lifeof_jer/status/2048103471019434248
450•jeremyccrane•9h ago•620 comments

Music of the BBC Microcomputer System

https://www.acornelectron.co.uk/eug/72/a-musi.html
6•eightb•1d ago•0 comments

Show HN: Startup Equity Adventure Game

https://options-game-polymathrobotics.pythonanywhere.com/
14•iliabara•3h ago•7 comments

Show HN: Free textbook on engineering thermodynamics

https://thermodynamicsbook.com/
107•2DcAf•10h ago•29 comments

Statecharts: hierarchical state machines

https://statecharts.dev/
278•sph•16h ago•79 comments

Show HN: Tiao, A two-player turn-based board game

https://playtiao.com
29•trebeljahr•4h ago•7 comments

Dear friend, you have built a Kubernetes (2024)

https://www.macchaffee.com/blog/2024/you-have-built-a-kubernetes/
85•Wingy•2d ago•117 comments

The Last of the Lost Generation

https://porticoquarterly.com/book/the-last-of-the-lost-generation/
12•benbreen•1d ago•4 comments