What is the best source for cross-language description of language features? Eg: “optional types”: which langs have them and how do they work? Same with “union types” etc.
One simple but non obvious (at least to me) trick when implementing tagged unions: put the union discriminator/tag at the end, not the beginning - that way a pointer to a union is also a pointer to the value, no need to increment the pointer to point past the tag after discriminating.
What is the best source for cross-language description of language features? Eg: “optional types”: which langs have them and how do they work? Same with “union types” etc.
Rosetta code is often helpful. Not exactly for language features, necessarily: https://rosettacode.org/wiki/Monads/Maybe_monad
One simple but non obvious (at least to me) trick when implementing tagged unions: put the union discriminator/tag at the end, not the beginning - that way a pointer to a union is also a pointer to the value, no need to increment the pointer to point past the tag after discriminating.
(2025) And about CopperLang (203 points, 3 days ago, 120 comments) https://news.ycombinator.com/item?id=50308754
i read Onion Types
So shallot be...