For the past 3 years, I’ve been creating Easel, a 2D game programming language that represents how I think (some) games should be made. One of the most pivotal ideas which makes the whole language is how the compiler helps you replace components on an entity by assigning an implicit ID.
I did a lot of React development (as in the frontend web framework) before making Easel and was quite inspired by how it hooks to change. The way you give it a function, which says what it depends on, and then it just fully re-executes that whole function when the dependencies change. So in Easel when you say `with Health { ... }` it makes a behaviour that re-executes every time the Health changes. But, if it just reran the behaviour, then you'd end up with it adding a new sprite (for example) every time it re-executes, until you've got hundreds of them. So the other trick is the Easel compiler assigns an implicit ID to things like sprites so that it will replace rather than add the second time around. It's built into the programming language so you don't see it (most of the time).
It actually took me 2 years to come up with that, which is both cool and depressing when I can explain it in one paragraph, but it is what makes the whole language and I thought the programmers of Hacker News might be interested in this unusual programming construct.
BSTRhino•1h ago
For the past 3 years, I’ve been creating Easel, a 2D game programming language that represents how I think (some) games should be made. One of the most pivotal ideas which makes the whole language is how the compiler helps you replace components on an entity by assigning an implicit ID.
I did a lot of React development (as in the frontend web framework) before making Easel and was quite inspired by how it hooks to change. The way you give it a function, which says what it depends on, and then it just fully re-executes that whole function when the dependencies change. So in Easel when you say `with Health { ... }` it makes a behaviour that re-executes every time the Health changes. But, if it just reran the behaviour, then you'd end up with it adding a new sprite (for example) every time it re-executes, until you've got hundreds of them. So the other trick is the Easel compiler assigns an implicit ID to things like sprites so that it will replace rather than add the second time around. It's built into the programming language so you don't see it (most of the time).
It actually took me 2 years to come up with that, which is both cool and depressing when I can explain it in one paragraph, but it is what makes the whole language and I thought the programmers of Hacker News might be interested in this unusual programming construct.