7

Are custom DSLs in JavaScript still viable, Specifically ones written with Antler, Boo, or the former Microsoft Oslo?

With the proliferation of open source JavaScript/ECMAScript engines (V8, IronJS, etc.), does it make more sense to write the functionality needed into one of those instead of writing an entirely new language?

Daniel A. White
  • 705
  • 4
  • 15
  • by "custom DSL" are you referring to languages like CoffeeScript and ClosureScript? – Brandon Satrom Aug 20 '11 at 13:58
  • No, I will update my question. – Daniel A. White Aug 20 '11 at 15:36
  • Microsoft Oslo is "a set of software development and systems management tools", is it used somehow to develop DSL? Antler is a parser generator; lower level DSL implementations might require custom parsers, but they're not strictly necessary. Boo exposes features of the CLI that are interesting for programming language development or experimentation, but, again, only covers a subset of DSL work. Are you asking about the viability of a subset of DSLs, rather than the whole? – blueberryfields Aug 20 '11 at 16:45

3 Answers3

1

If you mean DSL in strict terms, as in a programming language spec restricted to only one domain, then yes. The proliferation of the JavaScript/ECMAScript engines actually increases their viability - given a common virtual machine which is as flexible as the ECMAScript ones tend to be, DSL are both much easier to create, and likelier to be encountered.

What you won't see as much of, though, are languages with their own dedicated environments. At the high end, you'll see compilers to the existing languages (ala the Java to Javascript compiler that Google put out). Much more commonly, you'll see a library of supporting functions coupled with a programming language/style enforced by api restrictions and convention (the api to the jQuery library could be called a DSL).

blueberryfields
  • 13,200
  • 8
  • 51
  • 87
0

Custom DSL's are still viable, but you have other options which could be more or less complex depending on the problem you are trying to solve. For example, you can implement DSLs using dynamic languages. (DSLs using Groovy is one example that comes to mind) Which can then be compiled or translated it yet other languages. This can have a lower upfront cost, but may you might find that it is not the right fit in your case.

Perhaps you should start with defining the domain in question, and put together a list of things you would need from a DSL.

Wouter
  • 111
  • 5
sylvanaar
  • 2,295
  • 1
  • 19
  • 26
0

DSLs are rarely built as "entirely new" languages. Most of the practical DSLs are built on top of the existing languages - e.g., jQuery is a DSL on top of Javascript. And those DSLs are not necessarily embedded DSLs - they can be standalone as well, but compiled into a combination of the existing languages instead of going all the way down to the low level.

SK-logic
  • 8,497
  • 4
  • 25
  • 37