+0.04 Devirtualization and Static Polymorphism (david.alvarezrosa.com S:+0.07 )
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.
Article Heatmap
Preamble: ND — Preamble Preamble: No Data — Preamble P Article 1: ND — Freedom, Equality, Brotherhood Article 1: No Data — Freedom, Equality, Brotherhood 1 Article 2: ND — Non-Discrimination Article 2: No Data — Non-Discrimination 2 Article 3: ND — Life, Liberty, Security Article 3: No Data — Life, Liberty, Security 3 Article 4: ND — No Slavery Article 4: No Data — No Slavery 4 Article 5: ND — No Torture Article 5: No Data — No Torture 5 Article 6: ND — Legal Personhood Article 6: No Data — Legal Personhood 6 Article 7: ND — Equality Before Law Article 7: No Data — Equality Before Law 7 Article 8: ND — Right to Remedy Article 8: No Data — Right to Remedy 8 Article 9: ND — No Arbitrary Detention Article 9: No Data — No Arbitrary Detention 9 Article 10: ND — Fair Hearing Article 10: No Data — Fair Hearing 10 Article 11: ND — Presumption of Innocence Article 11: No Data — Presumption of Innocence 11 Article 12: ND — Privacy Article 12: No Data — Privacy 12 Article 13: ND — Freedom of Movement Article 13: No Data — Freedom of Movement 13 Article 14: ND — Asylum Article 14: No Data — Asylum 14 Article 15: ND — Nationality Article 15: No Data — Nationality 15 Article 16: ND — Marriage & Family Article 16: No Data — Marriage & Family 16 Article 17: ND — Property Article 17: No Data — Property 17 Article 18: ND — Freedom of Thought Article 18: No Data — Freedom of Thought 18 Article 19: +0.14 — Freedom of Expression 19 Article 20: ND — Assembly & Association Article 20: No Data — Assembly & Association 20 Article 21: ND — Political Participation Article 21: No Data — Political Participation 21 Article 22: ND — Social Security Article 22: No Data — Social Security 22 Article 23: ND — Work & Equal Pay Article 23: No Data — Work & Equal Pay 23 Article 24: ND — Rest & Leisure Article 24: No Data — Rest & Leisure 24 Article 25: ND — Standard of Living Article 25: No Data — Standard of Living 25 Article 26: +0.09 — Education 26 Article 27: +0.14 — Cultural Participation 27 Article 28: ND — Social & International Order Article 28: No Data — Social & International Order 28 Article 29: ND — Duties to Community Article 29: No Data — Duties to Community 29 Article 30: ND — No Destruction of Rights Article 30: No Data — No Destruction of Rights 30
Negative Neutral Positive No Data
Aggregates
Editorial Mean +0.04 Structural Mean +0.07
Weighted Mean +0.12 Unweighted Mean +0.12
Max +0.14 Article 19 Min +0.09 Article 26
Signal 3 No Data 28
Volatility 0.02 (Low)
Negative 0 Channels E: 0.6 S: 0.4
SETL -0.05 Structural-dominant
FW Ratio 50% 7 facts · 7 inferences
Evidence 6% coverage
3M 28 ND
Theme Radar
Foundation Security Legal Privacy & Movement Personal Expression Economic & Social Cultural Order & Duties Foundation: 0.00 (0 articles) Security: 0.00 (0 articles) Legal: 0.00 (0 articles) Privacy & Movement: 0.00 (0 articles) Personal: 0.00 (0 articles) Expression: 0.14 (1 articles) Economic & Social: 0.00 (0 articles) Cultural: 0.11 (2 articles) Order & Duties: 0.00 (0 articles)
HN Discussion 4 top-level · 7 replies
pjmlp 2026-02-25 21:21 UTC link
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.

hinkley 2026-02-25 21:44 UTC link
I wonder if I still have the link.

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 {
    }
TimorousBestie 2026-02-25 22:08 UTC link
Good article, rare to see simple explanations of intricate C++ ideas.
gignico 2026-02-25 22:10 UTC link
> 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.

dalvrosa 2026-02-25 21:47 UTC link
Fair. New C++ standards are providing great tools for compile-time everything

But still CRTP is widely used in low-latency environments :)

dalvrosa 2026-02-25 21:50 UTC link
Nice one, TIL

One caveat with "hash vtables" is that you only really see a performance win when the interface has a lot of specializations.

anitil 2026-02-25 22:10 UTC link
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
dalvrosa 2026-02-25 22:16 UTC link
Thank you :)
dalvrosa 2026-02-25 22:18 UTC link
Good point, thanks for sharing!
akoboldfrying 2026-02-25 23:13 UTC link
> 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.

cataphract 2026-02-25 23:26 UTC link
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).
Editorial Channel
What the content says
+0.05
Article 19 Freedom of Expression
Medium Practice
Editorial
+0.05
SETL
-0.05

Content is published openly without paywalls, supporting dissemination of information and ideas. Technical article demonstrates expression of expertise.

+0.04
Article 27 Cultural Participation
Medium Practice
Editorial
+0.04
SETL
-0.06

Technical article represents participation in scientific/technological advancement and sharing of specialized knowledge.

+0.03
Article 26 Education
Medium Practice
Editorial
+0.03
SETL
-0.03

Technical content provides educational information about software engineering concepts, contributing to knowledge dissemination.

ND
Preamble Preamble
null

Content is technical software engineering documentation with no engagement on UDHR preamble themes.

ND
Article 1 Freedom, Equality, Brotherhood
null

No discussion of equal dignity or rights of all members of the human family.

ND
Article 2 Non-Discrimination
null

No engagement with non-discrimination principles.

ND
Article 3 Life, Liberty, Security
null

No discussion of life, liberty, or security of person.

ND
Article 4 No Slavery
null

No engagement with slavery or servitude issues.

ND
Article 5 No Torture
null

No discussion of torture or cruel treatment.

ND
Article 6 Legal Personhood
null

No discussion of legal personhood or right to recognition.

ND
Article 7 Equality Before Law
null

No discussion of equality before law or equal protection.

ND
Article 8 Right to Remedy
null

No discussion of remedies for rights violations.

ND
Article 9 No Arbitrary Detention
null

No discussion of arbitrary arrest or detention.

ND
Article 10 Fair Hearing
null

No discussion of fair trial or impartial hearing.

ND
Article 11 Presumption of Innocence
null

No discussion of criminal responsibility or presumption of innocence.

ND
Article 12 Privacy
null

No discussion of privacy, family, or correspondence.

ND
Article 13 Freedom of Movement
null

No discussion of freedom of movement or residence.

ND
Article 14 Asylum
null

No discussion of right to seek asylum.

ND
Article 15 Nationality
null

No discussion of nationality or right to change it.

ND
Article 16 Marriage & Family
null

No discussion of marriage, family, or consent.

ND
Article 17 Property
null

No discussion of property rights or ownership.

ND
Article 18 Freedom of Thought
null

No discussion of freedom of thought, conscience, or religion.

ND
Article 20 Assembly & Association
null

No discussion of freedom of peaceful assembly or association.

ND
Article 21 Political Participation
null

No discussion of political participation or voting.

ND
Article 22 Social Security
null

No discussion of social security or economic rights.

ND
Article 23 Work & Equal Pay
null

No discussion of work, employment, or fair wages.

ND
Article 24 Rest & Leisure
null

No discussion of rest, leisure, or reasonable working hours.

ND
Article 25 Standard of Living
null

No discussion of health, food, clothing, housing, or medical care.

ND
Article 28 Social & International Order
null

No discussion of international social and economic order.

ND
Article 29 Duties to Community
null

No discussion of duties, responsibilities, or limitations on rights.

ND
Article 30 No Destruction of Rights
null

No discussion of prevention of destruction of UDHR rights.

Structural Channel
What the site does
+0.08
Article 19 Freedom of Expression
Medium Practice
Structural
+0.08
Context Modifier
+0.08
SETL
-0.05

Site structure provides free public access to written content; responsive design supports accessibility across devices.

+0.08
Article 27 Cultural Participation
Medium Practice
Structural
+0.08
Context Modifier
+0.08
SETL
-0.06

Free public access model enables broad participation in benefits of intellectual and technological progress.

+0.05
Article 26 Education
Medium Practice
Structural
+0.05
Context Modifier
+0.05
SETL
-0.03

Responsive design with accessible typography (font-face declarations, size adjustments, line-gap overrides) and max-width constraints support readability for broader audience.

ND
Preamble Preamble
null

No structural elements relate to UDHR preamble.

ND
Article 1 Freedom, Equality, Brotherhood
null

N/A for technical blog post.

ND
Article 2 Non-Discrimination
null

N/A for technical blog post.

ND
Article 3 Life, Liberty, Security
null

N/A for technical blog post.

ND
Article 4 No Slavery
null

N/A for technical blog post.

ND
Article 5 No Torture
null

N/A for technical blog post.

ND
Article 6 Legal Personhood
null

N/A for technical blog post.

ND
Article 7 Equality Before Law
null

N/A for technical blog post.

ND
Article 8 Right to Remedy
null

N/A for technical blog post.

ND
Article 9 No Arbitrary Detention
null

N/A for technical blog post.

ND
Article 10 Fair Hearing
null

N/A for technical blog post.

ND
Article 11 Presumption of Innocence
null

N/A for technical blog post.

ND
Article 12 Privacy
null

N/A for technical blog post.

ND
Article 13 Freedom of Movement
null

N/A for technical blog post.

ND
Article 14 Asylum
null

N/A for technical blog post.

ND
Article 15 Nationality
null

N/A for technical blog post.

ND
Article 16 Marriage & Family
null

N/A for technical blog post.

ND
Article 17 Property
null

N/A for technical blog post.

ND
Article 18 Freedom of Thought
null

N/A for technical blog post.

ND
Article 20 Assembly & Association
null

N/A for technical blog post.

ND
Article 21 Political Participation
null

N/A for technical blog post.

ND
Article 22 Social Security
null

N/A for technical blog post.

ND
Article 23 Work & Equal Pay
null

N/A for technical blog post.

ND
Article 24 Rest & Leisure
null

N/A for technical blog post.

ND
Article 25 Standard of Living
null

N/A for technical blog post.

ND
Article 28 Social & International Order
null

N/A for technical blog post.

ND
Article 29 Duties to Community
null

N/A for technical blog post.

ND
Article 30 No Destruction of Rights
null

N/A for technical blog post.

Supplementary Signals
How this content communicates, beyond directional lean. Learn more
Epistemic Quality
How well-sourced and evidence-based is this content?
0.58 high claims
Sources
0.6
Evidence
0.7
Uncertainty
0.5
Purpose
0.7
Propaganda Flags
No manipulative rhetoric detected
0 techniques detected
Emotional Tone
Emotional character: positive/negative, intensity, authority
measured
Valence
+0.1
Arousal
0.3
Dominance
0.4
Transparency
Does the content identify its author and disclose interests?
0.50
✓ Author
More signals: context, framing & audience
Solution Orientation
Does this content offer solutions or only describe problems?
0.60 solution oriented
Reader Agency
0.6
Stakeholder Voice
Whose perspectives are represented in this content?
0.15 1 perspective
Speaks: institution
Temporal Framing
Is this content looking backward, at the present, or forward?
present unspecified
Geographic Scope
What geographic area does this content cover?
global
Complexity
How accessible is this content to a general audience?
expert high jargon expert
Longitudinal 750 HN snapshots · 16 evals
+1 0 −1 HN
Audit Trail 36 entries
2026-02-28 14:07 eval_success Lite evaluated: Neutral (0.00) - -
2026-02-28 14:07 eval Evaluated by llama-3.3-70b-wai: 0.00 (Neutral) 0.00
reasoning
tech tutorial no rights stance
2026-02-28 14:03 eval_success Lite evaluated: Neutral (0.00) - -
2026-02-28 14:03 eval Evaluated by llama-3.3-70b-wai: 0.00 (Neutral)
reasoning
tech tutorial no rights stance
2026-02-26 23:08 eval_success Light evaluated: Neutral (0.00) - -
2026-02-26 23:08 eval Evaluated by llama-4-scout-wai: 0.00 (Neutral)
2026-02-26 20:16 dlq Dead-lettered after 1 attempts: Devirtualization and Static Polymorphism - -
2026-02-26 20:14 rate_limit OpenRouter rate limited (429) model=llama-3.3-70b - -
2026-02-26 20:13 rate_limit OpenRouter rate limited (429) model=llama-3.3-70b - -
2026-02-26 20:12 rate_limit OpenRouter rate limited (429) model=llama-3.3-70b - -
2026-02-26 17:36 dlq Dead-lettered after 1 attempts: Devirtualization and Static Polymorphism - -
2026-02-26 17:35 rate_limit OpenRouter rate limited (429) model=llama-3.3-70b - -
2026-02-26 17:34 rate_limit OpenRouter rate limited (429) model=llama-3.3-70b - -
2026-02-26 17:32 rate_limit OpenRouter rate limited (429) model=llama-3.3-70b - -
2026-02-26 17:05 eval_success Evaluated: Mild positive (0.24) - -
2026-02-26 17:05 eval Evaluated by deepseek-v3.2: +0.24 (Mild positive) 17,709 tokens
2026-02-26 09:10 dlq Dead-lettered after 1 attempts: Devirtualization and Static Polymorphism - -
2026-02-26 09:09 dlq Dead-lettered after 1 attempts: Devirtualization and Static Polymorphism - -
2026-02-26 09:07 rate_limit OpenRouter rate limited (429) model=mistral-small-3.1 - -
2026-02-26 09:07 rate_limit OpenRouter rate limited (429) model=hermes-3-405b - -
2026-02-26 09:06 rate_limit OpenRouter rate limited (429) model=mistral-small-3.1 - -
2026-02-26 09:06 rate_limit OpenRouter rate limited (429) model=hermes-3-405b - -
2026-02-26 09:05 rate_limit OpenRouter rate limited (429) model=hermes-3-405b - -
2026-02-26 09:05 rate_limit OpenRouter rate limited (429) model=mistral-small-3.1 - -
2026-02-26 03:53 eval Evaluated by claude-haiku-4-5-20251001: +0.12 (Mild positive) 19,983 tokens -0.24
2026-02-26 03:50 eval Evaluated by claude-haiku-4-5-20251001: +0.37 (Neutral) 20,074 tokens +0.22
2026-02-26 03:07 eval Evaluated by claude-haiku-4-5-20251001: +0.15 (Mild positive) 20,156 tokens -0.08
2026-02-26 02:44 eval Evaluated by claude-haiku-4-5-20251001: +0.23 (Mild positive) 19,793 tokens +0.09
2026-02-26 00:48 eval Evaluated by claude-haiku-4-5-20251001: +0.13 (Mild positive) 19,873 tokens -0.01
2026-02-26 00:07 eval Evaluated by claude-haiku-4-5-20251001: +0.14 (Mild positive) 20,206 tokens -0.13
2026-02-25 23:49 eval Evaluated by claude-haiku-4-5-20251001: +0.27 (Mild positive) 19,969 tokens +0.11
2026-02-25 23:49 eval Evaluated by claude-haiku-4-5-20251001: +0.16 (Mild positive) 19,898 tokens -0.03
2026-02-25 22:51 eval Evaluated by claude-haiku-4-5-20251001: +0.19 (Mild positive) 17,351 tokens -0.08
2026-02-25 22:50 eval Evaluated by claude-haiku-4-5-20251001: +0.27 (Mild positive) 17,237 tokens +0.14
2026-02-25 22:22 eval Evaluated by claude-haiku-4-5-20251001: +0.13 (Mild positive) 17,103 tokens -0.18
2026-02-25 22:00 eval Evaluated by claude-haiku-4-5-20251001: +0.31 (Neutral) 17,138 tokens