3 ms·
In terms of cost/benefit, I think it makes way more sense to learn to think in terms of "algebras", and how to create both internal and external DSLs in a host
by thelittlenag 4y ago
In terms of cost/benefit, I think it makes way more sense to learn to think in terms of "algebras", and how to create both internal and external DSLs in a host language. I've found it incredibly helpful to have an algebra-first approach as I model a (complex) domain and service interactions. Being able to write business logic as the composition of algebraic actions in several lower-level services, along with interpreters just feels great.
Of course this overlaps strongly with particular aspects of compilers, but I find that external DSLs, which is where the overlap is greatest, are the tool that I reach for least often and that elicit the greatest resistance from fellow engineers.
- chillpenguin 4y agoCan you give more info on "algebras"? I think I have heard the word used in this way before, but I don't exactly understand the meaning.
- thelittlenag 4y agoIn Scala this tends to manifest as either tagless final (https://www.baeldung.com/scala/tagless-final-pattern#1-algebras https://www.baeldung.com/scala/tagless-final-pattern#1-algeb...) or free monad (same thing, different encoding).