Which is better for DSL: TCL or Lisp?

Which is better for DSL: TCL or Lisp? What can you say about Java (C #) - TCL binding versus Lisp (schema)? What DSL tool is applicable for .Net development? (excluding Microsoft DSL tools)

+1


source to share


8 answers


If you want easy access to the JVM, you can use Clojure.



Note that you can design the DSL any way you want, you are not forced to skip the "lispy" syntax. My favorite example is in the Common Lisp standard: the extended LOOP syntax is as unresponsive as it is, and in fact it is a DSL for a loop implemented in a macro.

+11


source


If it's a choice between TCL and LISP, I would go to TCL every time. Partly because I'm familiar with TCL and partly because it's easy to extend TCL with your own commands and embed it in other software.



For JAVA interop, you have jacl and tclblend. http://tcljava.sourceforge.net/ is a good point of view for these packages or http://www.tcl.tk/ for all TCLish stuff.

+7


source


I would go with Scheme :)

As said, you don't need to represent the DSL as stripped of code.

Here's an example of how I wrote a LINQ 'DSL' for an R6RS schema. (but you should know this, just now you saw your nickname, P)

Also here is the second incarnation.

Taking a look at the examples below shows that pretty much, except for expressions (which should be Scheme), the input is almost identical to LINQ in C #.

+5


source


For DSL on .Net, Boo is a really great place to start. The guys at Unity3D use it for their "JavaScript" script language, I think even Second Life are building their own LindonScript2.0 or something with it, and I think this guy Ayende (Google for him) comes out with a book about it in these times ...

+4


source


It really depends on who is using the DSL. If you are expecting non-IT experts, then you will be offered something as simple as TCL. Explaining the joys of LISP to a non-IT graduate would be a major challenge since debugging a large LISP program written by someone who hasnt grokked LISP.

Uniformly for someone that b = a + 1 is written B = INCR (A) is not such a good idea either.

I would recommend Python, you can embed your domain code in one or two of the specialist classes. You have a language in which non-IT users can code simple readable programs and where there is no limit to what an IT professional can do.

+3


source


I would choose TCL over Lisp at any time if the broader purpose for your application is questioned. People will most likely want to process their thoughts, not lists. :) (Thanks Lisp, for giving me a functional programming perspective, but I don't think we should see each other more, oh and by the way, this is not you, it's me;))

In addition to this, I must add unless you have a compelling reason (like to be lightweight or have very specific DSL needs) Python or Javascript should be an extension language in the modern world IMHO.

ps. like this about .NET IronPython is the version of Python that you want best.

+1


source


Check out Martin Fowler's Blog . This is what got me started with DSL. Free interfaces are DSL sorting.

Ayende from RhinoMocks glory has a book coming out

Here is one of my External DSLs that I wrote for C #. And this is what I wrote in Lisp .

No TCL or JAVA experience to write DSL.

+1


source


Even Lisp seems to have some weird commands like CDR (unless you're using a non-LIST oriented language) TCL has some "weird" things. You have to consider which syntax suits your brain best.

eg. unless you have problems with very sparse syntax and assignment of set variables that accept TCL, if you want a richer, very powerful syntax with a lot of metaprogramming possibilities, and you don't mind putting everything in parentheses and always starting with a statement like ( + 2 3) (not 2 + 3) than you should choose LISP.

0


source







All Articles