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.

Flipdiscs

https://flipdisc.io
210•skogstokig•3d ago•37 comments

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
748•ca98am79•11h ago•386 comments

TurboQuant: A first-principles walkthrough

https://arkaung.github.io/interactive-turboquant/
128•kweezar•6h ago•17 comments

AI should elevate your thinking, not replace it

https://www.koshyjohn.com/blog/ai-should-elevate-your-thinking-not-replace-it/
459•koshyjohn•12h ago•332 comments

Self-updating screenshots

https://interblah.net/self-updating-screenshots
263•bjhess•1d ago•39 comments

The Prompt API

https://developer.chrome.com/docs/ai/prompt-api
96•gslin•6h ago•62 comments

Three constraints before I build anything

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

When the cheap one is the cool one

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

A Guide to CubeSat Mission and Bus Design

https://pressbooks-dev.oer.hawaii.edu/epet302/
24•o4c•1d ago•2 comments

Fast16: High-precision software sabotage 5 years before Stuxnet

https://www.sentinelone.com/labs/fast16-mystery-shadowbrokers-reference-reveals-high-precision-so...
235•dd23•12h ago•52 comments

Box to save memory in Rust

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

The Mushroom That Makes People Have the Exact Same Hallucination

https://www.vice.com/en/article/meet-the-mushroom-that-make-people-have-the-exact-same-hallucinat...
19•thunderbong•58m ago•6 comments

FreeBSD Device Drivers Book

https://github.com/ebrandi/FDD-book
80•myth_drannon•9h ago•14 comments

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

https://www.bbc.com/sport/athletics/articles/crm1m7e0zwzo
371•berkeleyjunk•11h ago•255 comments

Mystery Cpuid Bit

http://www.os2museum.com/wp/mystery-cpuid-bit/
10•userbinator•2d ago•1 comments

SWE-bench Verified no longer measures frontier coding capabilities

https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/
295•kmdupree•18h ago•161 comments

Revocation of X.509 Certificates

https://blog.apnic.net/2026/04/24/revocation-of-x-509-certificates/
34•jandeboevrie•1d ago•7 comments

The Military Rockets That Launched the Space Age (2023)

https://airandspace.si.edu/stories/editorial/military-rockets-launched-space-age
8•radeeyate•1d ago•0 comments

Quirks of Human Anatomy

https://www.sdbonline.org/sites/fly/lewheldquirk/figlegq6.htm
130•gurjeet•2d ago•70 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...
201•1659447091•10h ago•59 comments

Chernobyl wildlife forty years on

https://www.bbc.com/future/article/20260424-chernobyl-wildlife-forty-years-on
97•reconnecting•12h ago•19 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
66•MrBuddyCasino•3d ago•11 comments

EvanFlow – A TDD driven feedback loop for Claude Code

https://github.com/evanklem/evanflow
60•evanklem2004•6h ago•25 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
126•pwim•3d ago•52 comments

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

https://twitter.com/lifeof_jer/status/2048103471019434248
645•jeremyccrane•15h ago•797 comments

Clay PCB Tutorial

https://feministhackerspaces.cargo.site/Clay-PCB-Tutorial
220•j0r0b0•16h ago•129 comments

Show HN: Free textbook on engineering thermodynamics

https://thermodynamicsbook.com/
137•2DcAf•17h ago•35 comments

MoQ Boy

https://moq.dev/blog/moq-boy/
59•mmcclure•11h ago•7 comments

The Visible Zorker: Zork 1

https://eblong.com/infocom/visi/zork1/
127•PLenz•15h ago•25 comments

Lessons from building multiplayer browsers

https://www.alejandro.pe/writing/sail-muddy-lessons
28•alejandrohacks•17h ago•11 comments