Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Can 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.


In Scala this tends to manifest as either tagless final (https://www.baeldung.com/scala/tagless-final-pattern#1-algeb...) or free monad (same thing, different encoding).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: