News for hackers. Stuff that matters.
Re:So You Want to Write Your Own Language (2014) by Koshkin on Friday May 19, 2017 @02:34PM (#14378256)
Actually, this is one of the most important, albeit usually implicit, features of a good programming language: how easy it makes to create a DSL (without leaving it). This is because ideally you would first find or create a language to express, in the most adequate way, the problem you are trying to solve, and only then you solve it. That is why pseudo-code is useful. The OO support in programming languages made creating a DSL somewhat easier, but it is true - nothing can compare with Lisp in this regard. (So, I guess, this makes Lisp the best programming language of all time.)
Re:So You Want to Write Your Own Language (2014) by dozzie on Friday May 19, 2017 @04:52PM (#14379268)
> how easy it makes to create a DSL (without leaving it).

Pretty much impossible. If you don't leave your original language, you don't use domain specific language, you just have general purpose language with domain specific API.

Re:So You Want to Write Your Own Language (2014) by Koshkin on Saturday May 20, 2017 @09:07AM (#14382195)
But what is an API? Is it just a set of functions? Even then, it is already a language, with its own vocabulary. Or, is it a set of classes, interfaces, etc.? Then, even more so. And so on. Limitations and particulars of the syntax of a host language do not matter as much as you may think. Also, if you look close enough, you will realize that most of the languages already are, in fact, combinations of various built-in sublanguages, each having its own "subsyntax". What matters is the ease with which the host allows to create a new sublanguage that suits a particular purpose.
Re:So You Want to Write Your Own Language (2014) by TeMPOraL on Friday May 19, 2017 @06:50PM (#14379913)
You're missing the point. Some programming languages (Lisp family in particular) allow you to build DSLs directly, with the tools the language itself provides.
Re:So You Want to Write Your Own Language (2014) by dozzie on Saturday May 20, 2017 @06:25AM (#14381718)
And then, inside this "DSL" in Lisp, can you have a completely different language, with significant spaces and unmatched parentheses? Or is it just Lisp data structures that are then interpreted and you're pretending to use language other than Lisp because of its flexible data structures notation?
Re:So You Want to Write Your Own Language (2014) by shakna on Saturday May 20, 2017 @09:05AM (#14382190)
Yes, with reader macros. So far that you can have C[0], as you know it.

[0] http://pkgs.racket-lang.org/package/c

Re:So You Want to Write Your Own Language (2014) by TeMPOraL on Saturday May 20, 2017 @07:26AM (#14381901)
With reader macros, yes you can.