Comment

Comment by algorithmsRcool

Why on earth did they decide boxing by default was a sensible design decision...

We have been pushing toward higher performance for years and this is a performance pitfall for unions would are often thought of as being lighter weight than inheritance hierarchies.

F# just stores a field-per-case, with the optimization that cases with the same type are unified which is still type safe.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton