www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - javascript with D2

reply "Flamaros" <flamaros.xavier gmail.com> writes:
Hi,

I am looking for a D2 java-script engine. I saw DMDScript but 
it's seems works only with D1 and abandoned. In an other side 
there is V8 engine but is written in c++, which certainly can't 
works fine with D code.

May I just need chose an other script language like lua which is 
written in c and already ported on D by LuaD?
Mar 02 2013
next sibling parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Saturday, 2 March 2013 at 12:18:19 UTC, Flamaros wrote:
 Hi,

 I am looking for a D2 java-script engine. I saw DMDScript but 
 it's seems works only with D1 and abandoned. In an other side 
 there is V8 engine but is written in c++, which certainly can't 
 works fine with D code.

 May I just need chose an other script language like lua which 
 is written in c and already ported on D by LuaD?

Both https://bitbucket.org/ariovistus/pyd and luaD work very nicely. Personally I would always prefer to write in python or lua than javascript, where it's practical. Lua is very fast and python has some fantastic libraries.
Mar 02 2013
parent "Flamaros" <flamaros.xavier gmail.com> writes:
On Saturday, 2 March 2013 at 12:34:37 UTC, John Colvin wrote:
 On Saturday, 2 March 2013 at 12:18:19 UTC, Flamaros wrote:
 Hi,

 I am looking for a D2 java-script engine. I saw DMDScript but 
 it's seems works only with D1 and abandoned. In an other side 
 there is V8 engine but is written in c++, which certainly 
 can't works fine with D code.

 May I just need chose an other script language like lua which 
 is written in c and already ported on D by LuaD?

Both https://bitbucket.org/ariovistus/pyd and luaD work very nicely. Personally I would always prefer to write in python or lua than javascript, where it's practical. Lua is very fast and python has some fantastic libraries.

I already have some experiences with Lua unlike javascript, but for my project javascript must be my first choice. I want do some tests to see if it's feasible to interpret directly simple QML files (QtQuick framework). Instead I only have the possibility to do something different.
Mar 02 2013
prev sibling next sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
Flamaros:

 I am looking for a D2 java-script engine. I saw DMDScript but 
 it's seems works only with D1 and abandoned.

I think DMDScript was ported to D2 too. Bye, bearophile
Mar 02 2013
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
02-Mar-2013 17:19, bearophile пишет:
 Flamaros:

 I am looking for a D2 java-script engine. I saw DMDScript but it's
 seems works only with D1 and abandoned.

I think DMDScript was ported to D2 too. Bye, bearophile

This is the latest version of my D2 port. https://github.com/blackwhale/DMDScript I do not work on it anymore but it should work just fine. In fact I tweaked it so that now it's in line with ECMAScript-v5 except for strict mode (as measured by Google's sputnik test suite). The only problem is that I haven't compiled it since dmd 2.054 or so (and speed is about 20-80x slower then V8, but blah they JIT and the stuff). Could take a good few hours to make it compile with latest dmd removing deprecated language features, fixing some old syntaxes etc. -- Dmitry Olshansky
Mar 02 2013
parent reply "Flamaros" <flamaros.xavier gmail.com> writes:
On Saturday, 2 March 2013 at 17:11:32 UTC, Dmitry Olshansky wrote:
 02-Mar-2013 17:19, bearophile пишет:
 Flamaros:

 I am looking for a D2 java-script engine. I saw DMDScript but 
 it's
 seems works only with D1 and abandoned.

I think DMDScript was ported to D2 too. Bye, bearophile

This is the latest version of my D2 port. https://github.com/blackwhale/DMDScript I do not work on it anymore but it should work just fine. In fact I tweaked it so that now it's in line with ECMAScript-v5 except for strict mode (as measured by Google's sputnik test suite). The only problem is that I haven't compiled it since dmd 2.054 or so (and speed is about 20-80x slower then V8, but blah they JIT and the stuff). Could take a good few hours to make it compile with latest dmd removing deprecated language features, fixing some old syntaxes etc.

Sadly, just because I don't have a lot of free time, I certainly fallback on Lua instead of putting my nose in DMDScript. Maybe in a far far future if my project is viable, a migration from Lua to javascript would be possible.
Mar 02 2013
parent reply "Maxime Chevalier" <maximechevalierb gmail.com> writes:
There's my D JavaScript engine, but it might not be mature enough 
for your taste. It's a research project.

http://pointersgonewild.wordpress.com/higgs/

I'm implementing a JIT compiler for it as we speak.

On Saturday, 2 March 2013 at 22:41:33 UTC, Flamaros wrote:
 On Saturday, 2 March 2013 at 17:11:32 UTC, Dmitry Olshansky 
 wrote:
 02-Mar-2013 17:19, bearophile пишет:
 Flamaros:

 I am looking for a D2 java-script engine. I saw DMDScript 
 but it's
 seems works only with D1 and abandoned.

I think DMDScript was ported to D2 too. Bye, bearophile

This is the latest version of my D2 port. https://github.com/blackwhale/DMDScript I do not work on it anymore but it should work just fine. In fact I tweaked it so that now it's in line with ECMAScript-v5 except for strict mode (as measured by Google's sputnik test suite). The only problem is that I haven't compiled it since dmd 2.054 or so (and speed is about 20-80x slower then V8, but blah they JIT and the stuff). Could take a good few hours to make it compile with latest dmd removing deprecated language features, fixing some old syntaxes etc.

Sadly, just because I don't have a lot of free time, I certainly fallback on Lua instead of putting my nose in DMDScript. Maybe in a far far future if my project is viable, a migration from Lua to javascript would be possible.

Mar 02 2013
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 3/2/2013 2:45 PM, Maxime Chevalier wrote:
 There's my D JavaScript engine, but it might not be mature enough for your
 taste. It's a research project.

 http://pointersgonewild.wordpress.com/higgs/

 I'm implementing a JIT compiler for it as we speak.

Maxime will be doing a presentation on her JIT compiler at D Conference 2013: http://dconf.org/schedule/chevalier_boisvert.html Me, I'm really looking forward to hearing about it.
Mar 02 2013
parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
03-Mar-2013 05:06, Walter Bright пишет:
 On 3/2/2013 2:45 PM, Maxime Chevalier wrote:
 There's my D JavaScript engine, but it might not be mature enough for
 your
 taste. It's a research project.

 http://pointersgonewild.wordpress.com/higgs/

 I'm implementing a JIT compiler for it as we speak.

Maxime will be doing a presentation on her JIT compiler at D Conference 2013: http://dconf.org/schedule/chevalier_boisvert.html Me, I'm really looking forward to hearing about it.

Me, too :) -- Dmitry Olshansky
Mar 02 2013
prev sibling parent "Jakob Ovrum" <jakobovrum gmail.com> writes:
On Saturday, 2 March 2013 at 12:18:19 UTC, Flamaros wrote:
 May I just need chose an other script language like lua which 
 is written in c and already ported on D by LuaD?

Small correction: LuaD is a wrapper, and is used together with any C API compliant Lua implementation, such as the reference implementation or LuaJIT. LuaD's radically D-ified API is not possible because it's a port (because it's not) but because the C API is so versatile in the first place :)
Mar 02 2013