swarm-game / swarm

Resource gathering + programming game
Other
820 stars 51 forks source link

Consider adding lambdas and applications to world DSL #1987

Open byorgey opened 6 days ago

byorgey commented 6 days ago

We can't easily get away with using unification to infer types (since we have to elaborate at the same time); so to have simple type inference for lambdas we would have to require type annotations, like \x : int. x + 3. In turn that would mean adding a parser for types, and so on.

It could easily be worth it though, both because of things like https://github.com/swarm-game/swarm/issues/1584#issuecomment-2187331271 and because of the increased expressivity.