5 ms·
I sense the whole area of domain-specific languages is due for a belated renaissance. Everybody shirks away from it, but most languages are not very good for s
by PaulRobinson 12y ago
I sense the whole area of domain-specific languages is due for a belated renaissance.
Everybody shirks away from it, but most languages are not very good for solving most problems and the standard libraries bloat out as more and more gets crammed in.
I don't think in a commercial context we can all step back and say "to solve this problem, let's first design an appropriate language" but as a means to define the problem better, or to encapsulate learning we've made in building a prototype in a general language, it can be very powerful.
If you aren't able to best describe the problem space, how do you intend to solve a problem within it?
- stcredzero 12y agoThe problem with Lisp-like DSL construction, is that the interface doesn't play well with many populations of domain experts. Even Smalltalk, with its syntax designed to be usable by children can fulfill the technical side of constructing DSLs easily, but still leaves something to be desired when it comes to domain expert use. (Various Smalltalks had their rough equivalent to #lang.) (I know there is at least one Ruby based DSL which made some inroads to mobile device software testing.) Basically, DSLs tend to only get used by experts who are already programmers or otherwise technically disposed. Maybe we're getting to the point where rudimentary coding is just going to be a new kind of literacy?
- shriramkmurthi 12y agoThis is a criticism of Lisp-based DSLs but not of Racket-based DSLs. Racket actively enables you to impose different, non-parenthetical surface syntaxes on the DSL. It is not a "this sort of works if you arrange it carefully _and nobody screws anything up_" thing like in Ruby, it really is an explicit language definition. The easiest way to understand this in action is to read about Danny Yoo's Brainfuck embedding in Racket: https://www.hashcollision.org/brainfudge/ https://www.hashcollision.org/brainfudge/
- muraiki 12y agoI really liked the following article, which creates a text adventure language in Racket that looks like this: ===PLACES=== ---desert--- "You're in a desert." [cactus, key] north start south desert http://queue.acm.org/detail.cfm?id=2068896 http://queue.acm.org/detail.cfm?id=2068896
- shriramkmurthi 12y agoScribble is another great example. It's amazing in its own right, and by being embedded into Racket, gets all the Racket benefits: for instance, separate compilation! (Thirty years and waiting, LaTeX.)
- deleted 12y ago[deleted]