So, I finally get what's going on in the Racket DOS demos https://docs.racket-lang.org/dos/
- I like the naming puns, and the layer abstractions
- The lower layer abstractions esp are interesting, do state joining via a monoid
- The "win" abstraction is... interesting, but also troubling to me? The global registry is an improvement over the usual big-bang'esque single-game-state, but it is still a "global" of sorts. But definitely an improvement over the usual big-bang style
Using a monoid to combine things at the lower layer also seems hard in the following scenarios:
- Scenario 1: a player hits both a health upgrade and damaging missile at the same time. There may in most systems be a race condition where whether the player dies is determined by which collision is handled first. The DOS approach would be to sum both damage and health I think and then determine live-ness afterwards?
@cwebber btw I mostly find monoids useful when I am doing something and realize that it's a monoid and then get monoid stuff for free.
Being forced to use a monoid as part of a framework feels more limiting.
My experience in
http://joeyh.name/blog/entry/7drl_2015_day_5_type_directed_spell_system_development/ comes to mind..
@joeyh To be clear, the monoid stuff is at the lowest abstraction layer of the kernel. It's possible to write abstractions layers above it which behave differently and are not monoids :)