Monster 0.8 + Tutorial

Nicolay Korslund korslund at gmail.com
Fri May 9 12:07:55 PDT 2008


janderson Wrote:
>
> Hi,
> 
> Nice work.
> 
> So one thing I don't understand.  How would I bind a script into DMD or 
> C++.  Also would this work with Visual C++?

You link the VM (which is a library) into your app, and call a function telling it to load the script file. At the moment the scripts have to be separate .m files in the file system, but more input options will come later (since that is a trivial thing to add.) You can then call script functions from your code (and vice versa using 'native' functions.)

I plan on writing tutorials on all this in the coming weeks, but for now the only "documentation" is the example set in the download.

The C++ API hasn't been set up for Windows yet, but it will basically be just a static library and a header file so it should work fine with VC++ when it's completed. 

> It would be nice if the D binding API supported features like automatic 
> reloading (optional of course).  Knowing how to debug it in a debugger 
> would also be useful (if possible).  Built in profiling would be another 
> nice feature.

I'm not quite sure what you mean by automatic reloading, could you explain?

I agree completely about the debugger and profiler (and also coverage analysis and other statistics) and I plan on adding this at some point, but I don't know when.

> Does it use DMD as the underlining compiler?  How efficient is it?

If you mean the script compiler, then no. It's written entirely from scratch, and compiles to bytecode only.

As for efficiency, the overall design is build with efficiency in mind, but I have purposely done very little detail optimization. The internal architecture is going to change a lot, and optimizations would have to be maintained and redone all the time. Like they say, premature optimization is the root of all evil. But efficiency (speed and memory) will be THE top priority once the language becomes a little more mature.

- Nico


More information about the Digitalmars-d-announce mailing list