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

Comments

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

Show HN: Sweep, Open-weights 1.5B model for next-edit autocomplete

https://huggingface.co/sweepai/sweep-next-edit-1.5B
124•williamzeng0•7h ago•19 comments

Doctors in Brazil using tilapia fish skin to treat burn victims

https://www.pbs.org/newshour/health/brazilian-city-uses-tilapia-fish-skin-treat-burn-victims
26•kaycebasques•1h ago•3 comments

From stealth blackout to whitelisting: Inside the Iranian shutdown

https://www.kentik.com/blog/from-stealth-blackout-to-whitelisting-inside-the-iranian-shutdown/
61•oavioklein•6h ago•8 comments

Threat actors expand abuse of Microsoft Visual Studio Code

https://www.jamf.com/blog/threat-actors-expand-abuse-of-visual-studio-code/
124•vinnyglennon•6h ago•75 comments

Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

https://github.com/ChartGPU/ChartGPU
559•huntergemmer•15h ago•160 comments

Claude's new constitution

https://www.anthropic.com/news/claude-new-constitution
401•meetpateltech•14h ago•388 comments

Binary fuse filters: Fast and smaller than xor filters (2022)

https://arxiv.org/abs/2201.01174
83•redbell•4d ago•4 comments

Show HN: TerabyteDeals – Compare storage prices by $/TB

https://terabytedeals.com
127•vektor888•9h ago•74 comments

Skip is now free and open source

https://skip.dev/blog/skip-is-free/
360•dayanruben•15h ago•164 comments

Show HN: High speed graphics rendering research with tinygrad/tinyJIT

https://github.com/quantbagel/gtinygrad
15•quantbagel•3h ago•5 comments

Hands-On Introduction to Unikernels

https://labs.iximiuz.com/tutorials/unikernels-intro-93976514
7•valyala•5d ago•0 comments

Lix – universal version control system for binary files

https://lix.dev/blog/introducing-lix/
32•onecommit•6h ago•12 comments

Show HN: Rails UI

https://railsui.com/
149•justalever•12h ago•83 comments

Letting Claude play text adventures

https://borretti.me/article/letting-claude-play-text-adventures
105•varjag•5d ago•40 comments

TrustTunnel: AdGuard VPN protocol goes open-source

https://adguard-vpn.com/en/blog/adguard-vpn-protocol-goes-open-source-meet-trusttunnel.html
106•kumrayu•13h ago•28 comments

Show HN: RatatuiRuby wraps Rust Ratatui as a RubyGem – TUIs with the joy of Ruby

https://www.ratatui-ruby.dev/
108•Kerrick•4d ago•16 comments

Tell HN: 2 years building a kids audio app as a solo dev – lessons learned

91•oliverjanssen•16h ago•35 comments

Waiting for dawn in search: Search index, Google rulings and impact on Kagi

https://blog.kagi.com/waiting-dawn-search
264•josephwegner•13h ago•155 comments

Show HN: Open-source certificate from GitHub activity

https://certificate.brendonmatos.com
28•brendonmatos•3d ago•7 comments

Beowulf's opening "What" is no interjection (2013)

https://www.poetryfoundation.org/poetry-news/69208/new-research-opening-line-of-beowulf-is-not-wh...
70•gsf_emergency_6•3d ago•53 comments

The WebRacket language is a subset of Racket that compiles to WebAssembly

https://github.com/soegaard/webracket
116•mfru•4d ago•24 comments

Convert potentially dangerous PDFs to safe PDFs

https://github.com/freedomofpress/dangerzone
141•dp-hackernews•7h ago•48 comments

Golfing APL/K in 90 Lines of Python

https://aljamal.substack.com/p/golfing-aplk-in-90-lines-of-python
64•aburjg•5d ago•14 comments

Jerry (YC S17) Is Hiring

https://www.ycombinator.com/companies/jerry-inc/jobs/QaoK3rw-software-engineer-core-automation-ma...
1•linaz•9h ago

SIMD programming in pure Rust

https://kerkour.com/introduction-rust-simd
82•randomint64•2d ago•34 comments

Can you slim macOS down?

https://eclecticlight.co/2026/01/21/can-you-slim-macos-down/
209•ingve•22h ago•248 comments

Show HN: Differentiable Quantum Chemistry

https://github.com/lowdanie/hartree-fock-solver
20•lowdanie•4d ago•4 comments

Nested code fences in Markdown

https://susam.net/nested-code-fences.html
218•todsacerdoti•17h ago•73 comments

Challenges in join optimization

https://www.starrocks.io/blog/inside-starrocks-why-joins-are-faster-than-youd-expect
61•HermitX•13h ago•12 comments

Show HN: Dotenv Mask Editor: No more embarrassing screen leaks of your .env

https://marketplace.visualstudio.com/items?itemName=xinbenlv.dotenv-mask-editor
14•xinbenlv•6h ago•15 comments