53 points by dalvrosa 4 days ago | 40 comments on HN
| Mild positive Editorial · v3.7· 2026-02-26 03:53:19 0
Summary Digital Access & Education Acknowledges
This technical software engineering blog post has minimal direct engagement with human rights themes, being primarily specialized educational content. The content demonstrates modest positive signals through free public access (Article 19), readable typography supporting accessibility (Article 26), and sharing of technical knowledge without barriers (Article 27). The evaluation recognizes that the site's open publication model and accessibility design choices implicitly support information dissemination and educational access, though these are structural rather than editorial commitments.
Nice overview, it misses other kinds of dispatch though.
With concepts, templates and compile time execution, there is no need for CRTP, and in addition it can cover for better error messages regarding what methods to dispatch to.
One of the papers I had bookmarked when toying with my own language design was someone that had worked out how to make interfaces as fast or faster than vtables by using perfect hashing and using the vtable as a hash table instead of a list.
You can also, when inlining a polymorphic call, put a conditional block in that bounces back to full dispatch if the call occasionally doesn’t match the common case. The problem with polymorphic inlining though is that it quickly resembles the exact sort of code we delete and replace with polymorphic dispatch:
if (typeof arg1 == “string”) {
} else if typeof arg1 === …) {
} else if {
} else if {
} else {
}
> Under the hood, a virtual table (vtable) is created for each class, and a pointer (vptr) to the vtable is added to each instance.
Coming from C++ I assumed this was the only way but Rust has an interesting approach where the single objects do not pay any cost because virtual dispatch is handled by fat pointers. So you carry around the `vptr` in fat pointers (`&dyn MyTrait`) only when needed, not in every instance.
I've been thinking through what features I'd want in a language if I were designing one myself, and one of my desires is to have exhaustive matches on enums (which could be made of any primitive type) and sum types. The ability to generate perfect hashes at compile time was one of the things that falls out nicely from that
> using the vtable as a hash table instead of a list.
Could you explain this a bit more? The word "list" makes me think you might be thinking that virtual method lookup iterates over each element of the vtable, doing comparisons until it finds a match -- but I'm certain that this is not how virtual method invocation works in C++. The vtable is constructed at compile time and is already the simplest possible "perfect hashtable": a short, dense array with each virtual method mapping to a function pointer at a statically known index.
There have been type-erasure libraries in c++ for a longish time that allow choosing inline vtables and inline storage. It's definitely been a widely talked about technique for at least 10 years (I see talks about Dyno from 2017).
Content is published openly without paywalls, supporting dissemination of information and ideas. Technical article demonstrates expression of expertise.
FW Ratio: 50%
Observable Facts
Page is publicly accessible without subscription or authentication barriers.
Content is presented as a written technical article available to any reader.
Inferences
Free publication supports the right to share and receive information on a specialized topic.
Open access model demonstrates practical commitment to unrestricted information dissemination.
Responsive design with accessible typography (font-face declarations, size adjustments, line-gap overrides) and max-width constraints support readability for broader audience.
build 1ad9551+j7zs · deployed 2026-03-02 09:09 UTC · evaluated 2026-03-02 11:31:12 UTC
Support HN HRCB
Each evaluation uses real API credits. HN HRCB runs on donations — no ads, no paywalls.
If you find it useful, please consider helping keep it running.