Hacker News new | past | comments | ask | show | jobs | submit login

I failed to explain why with Lisp and Haskell it feels ok but I think you sort of nailed it with the "expansion" part. With Haskell and Lisp you think in expressions being expanded.

The DSLs in Ruby, Groovy, Scala (often but not always) are not macro expansion. Often times these DSLs are very mutable and are like a state machine (and in fact have a state machine underneath which causes a whole bunch of concurrency issues).




Would add that Haskell DSL's can be formed from functionality derived from different kinds of monads and other categorical structures[1]. That sounds highfalutin, but different types of monads and other structures (functors, applicatives, etc) give you insane amounts of power to define your DSL in a very precise way. It even gives you a formal basis to reason about your DSL should you want to go that far with it.

[1] https://wiki.haskell.org/Typeclassopedia#Introduction


I think another difference at least for Common Lisp DSL's are embeded into the language (look at loop) and so people are comfortable with using them and somewhat how to write them.

This doesn't mean there isn't people who hate stuff like loop being in cl but it does go someway to showing why it's okay. I think the design of lisp encourages them as well (as the previous poster said) by the fact that the entirety of lisp is built up from a extremely limited amount of instructions so the entire language can be argued to be a DSL on top of a DSL on top of a DSL etc.




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

Search: