No, they are able to do that because they have static typing and they don't have to distinguish between values of "type A = FooA | BarA" and "type B = FooB | BarB" at run-time, so they can represent FooA, FooB, 0, false, unit etc. all the same. They can't do the same with their "extensible variants" though, so those IIRC are encoded as objects.
Wait, how does Scrapscript distinguish between values of different types? Say,
. scoop :
#vanilla
#chocolate
#strawberry
. f =
| #vanilla -> 1
| #false -> 2
| x -> 999
Is that legal? If yes, how does it work?