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

> Sounds like you took the long way to implementing a library.

You are right that DSLs should be about as natural as libraries. Linq in C#, regex, and SQL are good examples of DSLs you probably rely on regularly.

I suggest looking at the symbolic differentiator and circuit simulator in SICP. It is composed of just a few functions and is far cleaner than a library of functions on a custom data structure.




> Linq in C#, regex, and SQL are good examples of DSLs you probably rely on regularly.

Right, but with the exception of Linq, those all have addressed all the problems I brought up:

1. Has multiple mature compiler/interpreter implementations.

2. Has lots of tooling built around it.

3. Has extensive documentation.

4. Has a diverse community to hire programmers from.

They were able to address these issues because the DSLs solved very common problems that a lot of people had, and even with that incentive, it took a lot of effort from a lot of people to get there. A new DSL you implement to solve your specific issue is not going to trivially address these issues.

And Linq is an "exception that proves the rule". Linq has not taken off quite as well as the initial hype would have indicated. I'm not sure where it is now, because I haven't worked on .NET in over 4 years, but I remember times when it was unclear whether Linq would be supported in future Microsoft products. It's very difficult even for an organization with Microsoft's clout to create a DSL which is successful.

> I suggest looking at the symbolic differentiator and circuit simulator in SICP. It is composed of just a few functions and is far cleaner than a library of functions on a custom data structure.

I suggest looking at the 4 problems mentioned in my posts, and noting that all of them still apply to the SICP example(s) of DSLs.


> 4 problems mentioned in my posts

But we are comparing a small library of functions with a DSL of similar complexity.

> You might say: But my language uses the same homoiconic syntax of Lisp, so the tooling of Lisp carries over, and it doesn't require more documentation than just normal functions, and Lisp programmers can pick it up easily.

Doesn't that address them? Why are those 4 issues more applicable to a Lisp DSL than a library?

To learn a Lisp DSL, I read the docs for the relevant ideas, and look at a few examples. What about that process is different than a library, except that it tends to be natural and flexible for certain problems? The SICP examples would be a major pain to implement as a typical library.




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

Search: