Tackling Heterogeneous Data in a Statically-Typed Game Scripting Language
The author encountered challenges handling heterogeneous data while developing a statically-typed game scripting language. The article explores various solutions used in different programming languages, including null, variant types, untagged unions, sum types, and subtyping. The author ultimately chooses a Pascal-like variant record approach, balancing concise syntax with runtime type checking. This avoids the complexity of flow typing, leading to a more understandable and user-friendly language. It's a clever design that balances static type safety with ease of use, providing a more convenient scripting language solution for game development.
Read more