Emacs internals: Tagged pointers vs. C++ std:variant and LLVM (Part 3)
thecloudlet
66 points
31 comments
March 12, 2026
Related Discussions
Found 5 related stories in 47.0ms across 3,471 title embeddings via pgvector HNSW
- Mad Bugs: Vim vs. Emacs vs. Claude Munksgaard · 44 pts · April 01, 2026 · 46% similar
- Lisp-style C++ template meta programming mistivia · 34 pts · March 07, 2026 · 45% similar
- A new C++ back end for ocamlc glittershark · 146 pts · April 01, 2026 · 45% similar
- Computing in Freedom with GNU Emacs birdculture · 24 pts · March 13, 2026 · 44% similar
- Emacs as a Programmable Workbench signa11 · 13 pts · March 30, 2026 · 44% similar
Discussion Highlights (4 comments)
thecloudlet
Emacs internal part 2 HN link: https://news.ycombinator.com/item?id=47259961
tialaramex
It's not clear to me (and as an unsafe language it's not called out by your compiler if you do something illegal) what the correct way to spell this kind of trick is in C++ I had thought you need the pointer-sized integer types and mustn't do this directly to an actual pointer, but maybe I was wrong (in theory, obviously practice doesn't follow but that's a dangerous game)
ndesaulniers
Happy to see discussion of LLVM's interesting implementation of Static Polymorphism using CRTP. Some recommended reads: 1. https://en.wikipedia.org/wiki/Curiously_recurring_template_p... 2. https://david.alvarezrosa.com/posts/devirtualization-and-sta... 3. https://llvm.org/docs/ProgrammersManual.html#the-isa-cast-an...
mshockwave
LLVM now has another way to implement RTTI using the `CastInfo` trait instead of `classof`: https://llvm.org/doxygen/structllvm_1_1CastInfo.html But it's really just an implementation difference, the idea is still to have a lightweight RTTI.