Implementing something like DLR in D?

Jacob Carlborg doob at me.com
Sat Aug 28 02:17:41 PDT 2010


On 2010-08-28 01:44, Justin Johansson wrote:
> As one who has an interest in developing dynamic languages, I'm
> finding that implementing a DL which features both static and dynamic
> typing in classical OO/imperative languages to be quite a challenge.
>
> Recently I came across Microsoft's Dynamic Language Runtime (DLR).
>
> This "is a runtime environment that adds a set of services for dynamic
> languages to the common language runtime (CLR). The DLR makes it easier
> to develop dynamic languages to run on the .NET Framework and to add
> dynamic features to statically typed languages."
>
> More info is here:
> Dynamic Language Runtime Overview
> http://msdn.microsoft.com/en-us/library/dd233052.aspx
>
> The "Expression Tree" feature is particularly interesting as this
> allows AST nodes to directly express computable expressions, which,
> in a way, IMHO, unifies the idea that expressions can be thought of
> as lazy values.
>
> "Expression trees represent code in a tree-like data structure, where
> each node is an expression, for example, a method call or a binary
> operation such as x < y."
>
> What I'm wondering now is whether languages like D, C++, Java are
> really suited for implementing a dynamic languages which feature
> a mix of static and dynamic typing capability. My reading so far
> suggests that a higher level approach is needed and that's why we
> are seeing development of such things as DLR. I'm not sure how
> dated this is but time ago there was the Spineless Tagless G-machine
> (STG) which was developed to underpin the implementation of the Glasgow
> Hashell Compiler.
>
> The following PDF article by Simon Peyton Jones gives a good rundown
> on the STG machine:
>
> Implementing lazy functional languages on stock hardware:
> www.dcc.fc.up.pt/~pbv/aulas/linguagens/peytonjones92implementing.pdf
>
> Amongst other things, one of the things that seems to be missing in D
> which would ease the development of DL's is "pattern matching"
> capability such as is found in the Scala language. I seem to recall
> that the topic of pattern matching has been briefly discussed on this
> ng before (bearophile et. al.???)
>
> To sum up, I'd really appreciate feedback as to whether or not is
> worth considering D as a suitable language for implementing a dynamic
> language having a non-trivial type system, or is a higher level
> approach (such as DLR or STG) really required?
>
> Thanks in advance for all responses,
> Justin Johansson

* There is a scripting language called MiniD implemented in D: 
http://dsource.org/projects/minid

* Walter has made an ECMA 262 (JavaScript) implementation in D called 
DMDScript: http://digitalmars.com/dscript/index.html

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list