Tackling Heterogeneous Data in a Statically-Typed Game Scripting Language

2025-09-21

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
Development

A Programmer's Unexpected Hobby: The Allure of Knitting

2025-06-04

A programmer recounts his journey from staring at screens to the tactile experience of knitting. The article likens knitting to an open-world game, boasting a gentle learning curve and endless possibilities. The author shares the physical and mental benefits, the satisfaction of creating tangible objects, and encourages fellow programmers to try this activity as a way to balance work and life and create meaningful gifts for loved ones.

Read more
Misc hobby

The Elegant Struggle: Designing Public/Private Members in a Scripting Language

2025-05-26

A developer, building a fantasy console project, grapples with adding a module system to their scripting language. Exploring various approaches to distinguish public and private declarations – modifier keywords (like Java's `public` and `private`), modifier sections (like C++), sigils in identifiers (like Python's underscore), export manifests (like Scheme), and sigils at declarations (like Oberon's `*`) – they lean towards a novel solution: prefixing declaration keywords with an underscore (e.g., `rec_` for private records, `def_` for private functions). While unconventional, this method offers conciseness and avoids repeating sigils at every use site.

Read more
Development module system