logoalt Hacker News

xiaoyu2006today at 3:06 AM2 repliesview on HN

I always wonder why use a DSL while you can just borrow some existing PL?


Replies

socalgal2today at 3:30 AM

My experience with Scons tells me you do not want a PL. The problem with a PL is every programmer that touches it implemenents a new way to do something and then trying to edit/change anything because like untangling noodles. That's not to say they can't do the same in a DSL but I'd argue the DSL fights against that trend.

There are also things like trying to find what needs to be built as fast as possible. This was also a problem with Scons as each person adds custom code that must be executed before being able to know what to build. Contrast that with gn and ninja which generate fast and build fast.

nine_ktoday at 3:27 AM

Existing PLs are often excessively powerful and complex in some aspects, and not powerful or ergonomic enough in other aspects, pertaining to a particular subject area.

A good DSL makes certain things easy, and deliberately does not support some other things. Think about bash; imagine how bothersome it would be to use e.g. unchanged Python (one of the most readable languages) as a shell language.

Same with build systems.