Moonshot: a DMD fork that outputs Lua

Mithun Hunsur via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Feb 21 04:45:47 PST 2017


Hi all,

I've been working on a little project over the last month and a 
half, inspired by Adam's dtojs 
(https://github.com/adamdruppe/dtojs). I've always wanted a 
typed, powerful, embeddable scripting language, but found the 
contenders lacking - which is why I decided to hack up DMD to 
emit Lua.

Introducing Moonshot (https://github.com/Philpax/moonshot)!

Moonshot's based off an early DMD 2.074, and builds up a Lua AST 
from the D AST. It aims to compile a reasonable subset of @safe 
code, so that high-level D can be used in scripting environments 
(i.e. games, scriptable applications, and more.)

Because it's based upon the D frontend, it can already compile a 
lot of what we consider to be D - including foreach, the full 
power of metaprogramming, *ranges*, and more. There's an awful 
lot missing, as well (see the GitHub page for more information), 
but it's quite promising so far.

Of course, this is still a very early, very untested project - so 
it's going to break on 99.9% of D code. I'd like to gauge 
community reaction, but it's nowhere near ready to show off to 
the wider programming community.

I'd also like to find out if anyone would be interested in me 
submitting a DConf talk about how Moonshot works, and the 
benefits of using D as a typed scripting language.

Cheers!

------

P.S. It was incredibly exciting to see `10.iota.map!(a => a * 
a).filter!(a => a > 50).each!print;` work with unmodified Phobos. 
The less I have to modify Phobos, the better! :)



More information about the Digitalmars-d-announce mailing list