frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Replacing a Rust Enum with a 64-Bit Word Made My Interpreter 17% Faster

https://pointersgonewild.com/2026-08-25-replacing-a-rust-enum-with-a-64-bit-word/
14•metrofun•3d ago

Comments

gigatexal•43m ago
But isn’t the enum far more readable and maintainable than having to do bit operations on things?
tom_•39m ago
The computer's the one running the code, and it'll be running it a lot (or so its author hopes), so it's probably worth bearing its limitations in mind in the interests of making its life easier (so to speak) rather than prioritising the people who will modify the interpreter - a far less common occurrence.

The bit operations involved are pretty simple and won't take you long to figure out even if you've never done them before.

steveklabnik•19m ago
> As you can see, it has many convenience methods to make it easy to work with, compensating for the loss of the Rust enum.

Also, Rust does try to do some of these optimizations itself. These aren't exposed in the stable language to let you do some more advanced things, but it wouldn't be impossible for you to get the best of both worlds by letting you communicate this stuff more directly to the compiler. Right now those things are more like "this value is where you should put the tag" than the more advanced stuff here, though. Would be cool to see someday!

lowbloodsugar•8m ago
quibble: unsafe is stable. you can't do this in safe rust, but you can do it in unsafe rust. just isolate all the unsafe code in a single type, ideally a tiny crate.
compiler-guy•5m ago
The reason the enum is so nice is that it works as a terrific language-supplied abstraction that covers up those bit manipulations. It's very nice to get those abstractions for free like you do in Rust, but it can't be optimal for every specialized use case.

This new code also supplies similar abstractions. That actual specific code is much harder to reason about, but most users--and even the next person who works on the interpreter--simply won't care, or even know what is going on underneath the hood. The abstractions provided by the author do that work and apparently do it cleanly.

For most use-cases, that extra hand-written code isn't worth it. But in specific cases it can be, and the author has actually measured the value and determined that it is.

lowbloodsugar•37m ago
Point your LLM at triomphe's ArcUnion and extrapolate from there. Basically make a crate for just your 64bit union type, do it unsafe there, test with miri, and now you have a safe 64bit type you can use with match. You're happy digging around assembly so this is well within your wheelhouse. The only challenge will be if you do use miri to verify then you need to use the 'provenance-preserving' pointer adjusting functions. Worth the learning experience in my opinion. I did one for my system and it was super fun and had the performance impact you describe.

Google DeepMind Releases AlphaGenome Atlas

https://blog.google/innovation-and-ai/models-and-research/google-deepmind/alphagenome-atlas/
302•utiiiD•3h ago•75 comments

DaVinci Resolve 21.1

https://www.blackmagicdesign.com/media/release/20260908-03
263•tosh•5h ago•107 comments

On the Navier–Stokes Millennium Prize Problem

https://openai.com/index/navier-stokes-solution/
453•tedsanders•1h ago•309 comments

Benchmarking Qwen3.8 27B quantizations: 4-bit holds up, 1-bit collapses

https://quesma.com/blog/qwen38-27b-quantizations-benchmarked/
113•stared•3h ago•71 comments

The Helicopter with Radioactive Blades

https://hackaday.com/2026/09/07/the-helicopter-with-radioactive-blades/
82•zdw•1d ago•18 comments

OUI-1: world's first model for Generative UI

https://www.openui.com/blog/oui-1
31•zahlekhan•1h ago•27 comments

Show HN: LLM Attention Visualization

https://ishamf.dev/p/llm-attention-visualizer/
29•ifz•1h ago•4 comments

Connecting the Machines

https://herdr.dev/blog/connecting-the-machines/
32•collinmanderson•1h ago•13 comments

I-have-ADHD: A skill to stop coding agents from burying the answer

https://github.com/ayghri/i-have-adhd
138•domhudson•4h ago•101 comments

Show HN: Copperhead – Hardware as Fast as Software

https://copperhead.sh/
158•animeshchouhan•5h ago•59 comments

Y Combinator Early Access Network

https://events.ycombinator.com/yc-early-access-fall-26
34•tosh•2h ago•20 comments

LG TVs caught spying even when offline or on standby

https://www.theverge.com/tech/991190/lg-tv-spying-standby-recording-wi-fi-scanning-gamers-nexus
231•sbulaev•2h ago•115 comments

The two Christian saints who are the Buddha

https://signoregalilei.com/2026/08/30/the-two-christian-saints-who-are-secretly-the-buddha/
129•surprisetalk•3h ago•65 comments

C*: Unifying Programming and Verification in C

https://arxiv.org/abs/2504.02246
38•rramadass•2h ago•26 comments

Replacing a Rust Enum with a 64-Bit Word Made My Interpreter 17% Faster

https://pointersgonewild.com/2026-08-25-replacing-a-rust-enum-with-a-64-bit-word/
14•metrofun•3d ago•6 comments

ZX Spectrum: Experimenting with 1-Bit Sound

https://bumbershootsoft.wordpress.com/2026/09/05/zx-spectrum-experimenting-with-1-bit-sound/
56•ibobev•3h ago•18 comments

AlphaGenome Atlas predictive map of every DNA letter change in the human genome

https://deepmind.google/blog/alphagenome-atlas-a-predictive-map-of-every-possible-dna-letter-chan...
53•fady0•4h ago•7 comments

Paramount Caught Using 'Astroturf' Group to Drum Up Fake Support for Merger

https://www.techdirt.com/2026/09/08/paramount-caught-using-astroturf-group-to-drum-up-fake-suppor...
233•hn_acker•4h ago•67 comments

The 92-Year-Old Mathematician and the Teenage Apprentice

https://www.nytimes.com/2026/09/06/science/92-year-old-mathematician-apprentice.html
50•robinhouston•1d ago•4 comments

Getting your hands dirty is good for you

https://www.bbc.com/future/article/20260904-how-getting-your-hands-dirty-boosts-your-health-withi...
174•HatchedLake721•8h ago•146 comments

DHS 'Predictive Policing' Unit Is Analyzing Americans' Financial Habits

https://www.404media.co/a-secretive-dhs-predictive-policing-unit-is-analyzing-americans-financial...
231•abraham•3h ago•102 comments

Navier-Stokes – Tristan Buckmaster [pdf]

https://cims.nyu.edu/~tristanb/statement.pdf
580•procedurecall•12h ago•319 comments

There's a new "Google Jail" for independent wikis

https://weirdgloop.org/blog/google-jail
455•pizzaiolo•16h ago•192 comments

Disappointed Optimists

https://cwodtke.com/disappointed-optimists/
42•adrianhoward•3h ago•2 comments

Extracting Steering Vectors from J space

https://darshanmakwana412.github.io/2026/09/extracting-steering-vectors-from-j-space/
51•martianvoid•2d ago•12 comments

Antiquated HTML Snippets and Artefacts

https://vale.rocks/posts/html-relics
198•patadune•8h ago•67 comments

FreeBSD 14.5-Release

https://www.freebsd.org/releases/14.5R/announce/
61•joshcsimmons•6h ago•7 comments

Reverse engineering the 2008 LogiCola, a logic drill program

https://logicola.org/blog/the-new-logicola
16•kotk•3h ago•0 comments

Mistral raises €3B

https://mistral.ai/news/mistral-makes-sovereign-open-weight-ai-to-frontier/
758•kuberwastaken•13h ago•540 comments

Picolibrary: A Small Press

https://novalis.org/blog/2026-08-31-picolibrary-a-very-small-press.html
47•luu•3d ago•10 comments