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.

Ten days later, Git on macOS still trusts the compromised eMudhra certificates

https://emudhra.we-have-a-problem.com/apple.html
251•galadran•2h ago•105 comments

Start Doing Graph Theory

https://vertex.degree/
214•ibobev•4d ago•32 comments

Git for the US Code

https://lexifina.com/blog/git-for-the-us-code
324•alansaber•11h ago•173 comments

Amazon to buy satellite firm Globalstar in $11.57B deal

https://www.reuters.com/business/media-telecom/amazon-signs-1157-billion-deal-satellite-firm-glob...
71•noptd•1h ago•26 comments

Genie 4

https://deepmind.google/blog/genie-4-a-new-generation-of-world-simulation/
942•acossta•21h ago•544 comments

Ghostty 1.4

https://ghostty.org/docs/install/release-notes/1-4-0
1121•deaux•20h ago•362 comments

ICE Is Running One of the Largest Anti-Left Surveillance Ops in US History

https://www.wired.com/story/ice-is-running-one-of-the-largest-anti-left-surveillance-operations-i...
26•zzzeek•35m ago•1 comments

Ink droplets in motion snag top prize in Nikon Small World contest

https://arstechnica.com/science/2026/10/meet-the-2026-winner-of-nikons-small-world-photomicrograp...
294•_Microft•2d ago•46 comments

Two high-speed trains collide near Toledo, Spain

https://www.euronews.com/video/2026/10/28/spain-first-footage-reveals-wreckage-of-deadly-high-spe...
41•evilmonkey19•49m ago•23 comments

Unveiling The Grid: PCBs made in America, twice as fast as Shenzhen

https://www.circuithub.com/post/unveiling-the-grid
51•seddona•2d ago•23 comments

Survival LLM: AI assistant and emergency library that runs on your own computer

https://www.brangus.io/survival-llm
407•Luc•17h ago•155 comments

Decompiling Fast Food Tycoon 2: Drawing the World

https://healeycodes.com/decompiling-fast-food-tycoon-2-drawing-the-world
102•healeycodes•3d ago•19 comments

Tailscale SSH: Investigation and remediation update

https://tailscale.com/ssh-investigation-update
319•figmert•17h ago•170 comments

MacOS Extensions Pack for the Apple Network Server v1.0

http://oldvcr.blogspot.com/2026/10/macos-extensions-pack-for-apple-network.html
80•classichasclass•3d ago•1 comments

About the compromised eMudhra intermediate CAs

https://support.apple.com/en-us/149555
41•birdculture•2h ago•29 comments

Early progress on accelerating drug development with Claude

https://www.anthropic.com/research/early-progress-drug-development
261•dataking•16h ago•254 comments

Python's experimental JIT to be removed

https://lwn.net/SubscriberLink/1102102/0c00e4d550f25f8c/
540•f311a•1d ago•295 comments

Code-execution flaw in UEFI firmware threatens most servers on planet Earth

https://arstechnica.com/security/2026/10/code-execution-flaw-in-uefi-firmware-threatens-most-serv...
193•DamnInteresting•16h ago•126 comments

Raspberry Pi Zero 3W and Pi 4 Model A spotted in device trees

https://bret.dk/raspberry-pi-zero-3-w-pi-4-model-a/
186•sthlmb•16h ago•109 comments

New 14‑inch MacBook Pro with M6

https://www.apple.com/in/newsroom/2026/10/apple-introduces-the-new-14-inch-macbook-pro-with-m6/
385•beex•21h ago•529 comments

New iMac with M6

https://www.apple.com/imac/
352•notfried•1d ago•442 comments

SS United States to be sunk as largest artificial reef

https://divemagazine.com/scuba-diving-news/ss-united-states-to-be-sunk-as-worlds-largest-artifici...
172•geox•2d ago•138 comments

Jokes for the ZX81

https://spelk.press/gb/products/81-jokes-for-the-zx81
109•robin_reala•2d ago•16 comments

Classification of Finite Simple Groups Formalized in Lean

https://cfsg.axiommath.ai/
221•pfdietz•20h ago•68 comments

A Love Letter to the Super Dimension Fortress

https://brennan.day/a-love-letter-to-the-super-dimension-fortress/
71•jruohonen•4d ago•13 comments

An examination of lost firefly species of the US and Canada

https://journaloflostspecies.org/index.php/jls/article/view/37/33
134•bryanrasmussen•3d ago•53 comments

The Colors of a Soap Film

https://aseemrb.me/blog/colors-of-a-soap-film/
13•gregsadetsky•4d ago•2 comments

Four Months of Zig

https://gracefulliberty.com/articles/four-months-of-zig/
153•ibobev•17h ago•106 comments

Closing the Sea: Lessons from Ancient Mediterranean Blockades

https://maritime-executive.com/editorials/closing-the-sea-lessons-from-ancient-mediterranean-bloc...
19•gumby•2d ago•0 comments

US Government is hiding a secret court ruling about how it spies on Americans

https://www.wired.com/story/the-us-government-is-hiding-a-secret-court-ruling-about-how-it-spies-...
998•helterskelter2•23h ago•381 comments