dsl

Maven 3 has a new DSL formats for its POM. Is there a similar sort of format for Spring applicationcontext.xml files?

In Maven 3 there are new DSL replacements for the POMs. See: http://polyglot.sonatype.org/groovy.html for the wonderfully terse syntax. Is there something similar that can be used for Spring applicationcontext.xml files? ...

Building a Compiler for a DSL using ANTLR and the Antlr CSharp Target

I'm in the job of writing a compiler which compiles a project-specific DSL (with the features of a basic scripting language) into an project-specific assembler language. The platform is written in C#, so a native .NET-Compiler would be the perfect solution. I already did a lot of research and it seems ANTLR would fit in the job of build...

Why not use object literals to create beautiful DSL in Javascript?

Coming from Ruby to Javascript, creating DSL now seems not as fun as in Ruby where it was very beautiful and elegant. Ruby Rake: task :hello do # do stuff end task :hello => [:dep1, :dep2] do # do stuff end Javascript Jake: task("hello", function() { // do stuff }); task("hello", ["deep1", "deep2"], function() { // do ...

How to Create an Internal DSL in Scala?

I have been looking at a couple of books and resources on domain specific languages. I think I want to build an internal DSL in Scala. def instrument = new FXInstrument { provider = "EuroBase" instrumentOrders = List( new FXOrder { baseCcy = "GBP" termCcy = "EUR" legs = List( ...

Scala implicit conversion problem

I am struggling with a Scala implicit conversion problem. The following code snippet illustrates my problem : import org.junit.{ Test, Before, After }; class ImplicitsTest { implicit def toStringWrapper(str: String) = new StringWrapper(str); @Test def test(){ val res1: Predicate = "str" startsWith "other"; } ...

How can fractional number expressions be parsed using pyparsing?

We've just started to kick the tires pyparsing and like it so far, but we've been unable to get it to help us parse fractional number strings to turn them into numeric data types. For example, if a column value in a database table contained the string: 1 1/2 We'd like some way to convert it into the numeric python equivalent: 1.5 We...

Instance Eval in Javascript around browsers

From Coffeekup and JAML's source, (while working on question), we can see a way to hack ruby's instance eval into Javascript (JAML author explains more). It involves decompiling the function, and evaluating it around a with block. The question is: is this supported all around browsers/js runtimes? I know it works on firefox, opera and c...

Are there any Clojure DSLs ?

Is there any DSL (Domain Specific Language) implemented in Clojure ? ...

Lua domain specific configuration help

I have 5000 data item definition configuration which we are expecting to be designed like, -- Name of the device VARIABLE Name { type=Float, length=20, <<few more definition here>> } -- The device running elapsed time since its last boot VARIABLE BootTime { type=Integer, <<few more definition here>> } I will be...

Scala compiler says my method is recursive in case when implicits and anonymous class is used

I want to be able to write code like 10 times { doSomething } So I thought I could do that with implicits. When i execute the following code in the Scala REPL it gets defined correctly scala> implicit def intToMyRichInt(count: Int) = { | new { | def times(f: => Unit) = { | 1 to count foreach { _ => f...

Isn't a DSL another name for an app which solves a particular problem?

Hi, I am learning boo (got the ebook), but one question I have is what exactly is a DSL? Better question, if a DSL is geared towards a specific problem, then isn't it just another name for really an application space (e.g. Word Processing, DBMS, maths processing software), all solve their own problems. I ask this because recently a cou...