The contrast of emergent behaviours

About
I recently noticed a fun contrast in emergent behaviours in various programming languages and wanted to write a quick rant about it.
Extreme one - Expression
When I was in highschool I was exclusivly programming in nim. It was essentially the only language I used. This was really my first exposure to a language that was still developing its community, and thus I noticed alot of weird behaviours that were commonplace in nim, but just felt weird. Though in a language like nim where features Almost feel designed to be abused, its kinda tough to classify something as an unexpected emergent behaviour. I think the best example of something you see quite a bit in nim, thats full on syntax abuse, is using `var[T]` instead of `ptr[T]` in ffi. This is something even the nim sdl bindings do this, yet its likely undefined behaviour. Another common thing you see alot, is implicit returns in pure functions, though this isnt quite an abuse of syntax as much as picking one of the many ways to express a function.
Extreme two - Strict
All of this can be sharply contrasted by grug, where there is always one way to do things. Ive been following this project for a bit, and its simple nature has captivated me. And with this super simle nature, comes many complexities behind the scenes. The language is still quite young so alot of this is up to discussion, but theres been some common patterns forming already. One great example is how the implemtation of non syntax features has been posed, things like async, datastructures, and iterators. To keep the language dirt simple, most of the time if something can be done outside of grug, in game functions that method will be prefered. This means most features have been promoted in a way where they wont change prospective grug code.

Links

Last Modified 2025 12/08