3 ms·
Yeah, you're given enough architectural rope to hang yourself with. That said, why make a DSL? It's very very rarely a good idea, says I, an armchair architect.
by tormeh 11y ago
Yeah, you're given enough architectural rope to hang yourself with. That said, why make a DSL? It's very very rarely a good idea, says I, an armchair architect. I use Scala like Java with pattern matching, immutables and map/fold/filter. Works well so far.
- yummyfajitas 11y agoI've found that DSLs which are well supported by theory tend to nearly always be a good idea. For example, Spire's mathematical data structures (group, ring, field, boolean algebra) tend to be useful, as are Scalaz's monad/monoid/applicative. One which I haven't seen out there in the world, but turned out to be a fantastically useful, is the Free Boolean algebra. It's a functor FreeBool[_] which is also a boolean algebra. It's Free because it has the property that for any function f: T => U, U a boolean algebra, there is a natural transformation nat(f): FreeBool[T] => U which is also a homomorphism (nat(f)(x & y) = nat(f)(x) & nat(f)(y), etc). Even though things were not actually pinned down (and still aren't), I'm confident this is a good choice - thousands of mathematicians are very rarely wrong.