How Nested Functions Work, part 2

language_fan foo at bar.com.invalid
Mon Sep 21 11:26:30 PDT 2009


Mon, 21 Sep 2009 13:17:38 -0400, Jeremie Pelletier thusly wrote:

> Justin Johansson wrote:
>> bearophile Wrote:
>> 
>>> - Currently D isn't very useful for the web/mobile, where lot of
>>> programmers are.
>> 
>> I'd be interested to know how good D is for implementing
>> scripting/dynamic languages .. maybe that could change the odds?  I
>> know about DMDScript (ECMAScript in D) supposedly being fast, though
>> whatever I've read is no doubt out of date as Javascript engine
>> (performance) wars between Google (webkit) and Mozilla (spidermonkey?)
>> engines have been raging as of late.
>> 
>> 
> It is definitely easier to implement scripting languages in D than it is
> in other languages such as C/C++. However where I believe V8 (google's
> JS engine) is gaining in performance is at the direct translation of
> parse nodes to assembly without using intermediate representation in
> between and without the need of an interpreter, they even go as far as
> to modify code paths dynamically to gain more performance. I hear
> mozilla rewrote their JS engine lately too but didn't check what
> improvements they made.

When implementing a scripting language VM, it does not really matter if 
you use C, C++, D, Ada, Eiffel, Pascal, Obj-C, Haskell or OCaml (or any 
of the top15 languages in the great language shootout). They all are 
pretty fast. The fact is, if you have studied CS and know mechanisms like 
dynamic translation, generational garbage collection, or region 
inference, you can build a fast scripting language VM in any decent 
language. D is in no way special here. In fact it is not even hard to 
make the fastest Javascript VM in the world with D - the current ones are 
not very good.



More information about the Digitalmars-d mailing list