All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Approaches to Representing Heterogeneous Data in Programming Language Design

By

azhenley

8mo ago· 14 min readenInsight

Summary

The article discusses the challenge of representing heterogeneous data in programming languages, specifically in the context of developing a statically typed video game scripting language. The author explores various approaches including union types, sum types, and discriminated unions, comparing their trade-offs between simplicity, safety, and familiarity. The content delves into programming language design considerations, examining how different languages handle mixed data types and the author's personal journey in finding the right balance for their language project.

Key quotes

· 4 pulled
One problem every language has to solve is giving users a way to represent heterogeneous data—collections of values that may have different types.
As much as possible, I'm trying to make the language simple and familiar. But sometimes those goals are in opposition.
I'm also exploring novel approaches and delving deeper into programming language history to scavenge forgotten ideas.
The most familiar solution to a problem is kind of a mess.
Snippet from the RSS feed
As I mentioned in the last post, I’m working on taking my little videogame scripting language and turning it into a statically typed one. As much as possible, I’m trying to make the language simple and familiar. But sometimes those goals are in opposition

You might also wanna read