On 18 Jan 2011, at 07:37, Tim Daly wrote:

I have just finished
Language Virtualization for Heterogeneous Parallel Computing
http://infoscience.epfl.ch/record/148814/files/paper.pdf

Me too!

Clojure clearly fulfills all of the goals of a virtualization language
because it is a Lisp. Lisp systems are clearly capable of building
a DSL that is fully expressive of all of the power of Lisp. By using
the macro facility the DSL syntax can be matched to the problem
domain.

The authors do mention Lisp, saying that it satisfies most of their criteria except for safety, because a DSL implemented through Lisp macros always has access to all of Lisp, including the DSL's own implementation.

I suppose that for most Lispers, Clojure's namespaces are a sufficient answer. Just make a namespace for your DSL where you put all the stuff that is part of it. Sure, you can always get at the rest of Clojure by importing other namespaces and/or using qualified symbols. But you would do that only intentionally, not by accident.
Well you could use scalac and dynamically load the class.
Or, since it is Java, just create a classloader and load anything.
Even a strong type system can be overcome.

Safety, in my interpretation, means not using anything but the
domain-specific language for portability. That won't stop people
from escaping to the VL but that makes their code non-portable.
C, for example, "runs everywhere but compiles nowhere" due to
the machine-specific hacking.

People coming from statically-typed languages typically require more law enforcement and would probably not be happy with the namespace approach. More protection would require a DSL-specific reader that checks for namespace-qualified symbols and disallows arbitrary imports. But even that would probably be less work to implement than what it takes to make Scala "virtualizable".

However, I do believe that Scala has a better chance of being accepted as a DSL hosting language for "mass-market" parallel computing, because it has familiar syntax.
Sigh. I believe you are right.

So I think that Clojure is an excellent virtualization language for DSLs.

I certainly agree with that.

Konrad.
The real question is, given that Europe is willing to fund the DSL
approach to "popular computing", what can we learn from this
research trend that will influence Clojure?

I do think that the idea of defining problems in terms of a DSL is
certainly an interesting design approach. It might be useful to have
some Clojure examples of such designs so we can ensure that
DSLs are easily created. One really useful example might be to
create Scala in macros :-)

Tim Daly

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to