Thread overview
DMDScript and its uses
Sep 19, 2013
Matt
Sep 19, 2013
Adam D. Ruppe
Sep 19, 2013
Adam D. Ruppe
September 19, 2013
So is DMDScript still useful? I remember it having a Firefox and IE plugin, but is there any reason to use it over javascript, besides its speed? What differentiates the two?

As an aside, I've been made aware of the idea of embedding it in another program, but I don't have any experience of this, nor have I seen any examples\tutorials. If someone could either explain how to go about this, or point me in the direction of decent examples\tutorials, I would be much appreciative.

I'm aware that not everyone can, nor are prepared to answer both of these questions, but I am always appreciative of any help I can get, so thank you guys in advance.
September 19, 2013
On Thursday, 19 September 2013 at 00:38:30 UTC, Matt wrote:
> I remember it having a Firefox and IE plugin, but is there any reason to use it over javascript, besides its speed?

It used to be a lot faster than Firefox and IE, but over the years, they have gotten a lot faster and dmdscript really hasn't.

Nowadays, the major browser js engines are much faster than dmdscript, and have gotten some new features that dmdscript lacks too.

Bottom line though is dmdscript is pretty old now and you might be better off using one of the newer javascript engines.

That said, I played with dmdscript for a while so let me talk about that..

> As an aside, I've been made aware of the idea of embedding it in another program, but I don't have any experience of this, nor have I seen any examples\tutorials.

It is easier if you find a port to D2... but they have probably fallen out of date too. I did it myself a year or two ago and it wasn't too hard, but did take a little while.

Here's mine:
http://arsdnet.net/dcode/dmdscript_mine.zip

hasn't been updated for a long time, but if you look at the file pretty.d, it might help see how I extended it: the addFunction near the bottom of the code has a template to automatically wrap native functions for script use, and registers them.

A couple other people did too:

https://github.com/blackwhale/DMDScript

...and another one but I can't remember the link or who did it. But I don't think any of them have been kept up to date too.

But I do still have a copy of the code on my computer:

http://arsdnet.net/dcode/dmdscript_d2.zip


So, if you want to extend dmdscript with D1, it isn't as pretty as with D2 but still doable. This is the basic process used in my D2 pretty.d port too:

http://digitalmars.com/dscript/extending.html

> If someone could either explain how to go about this, or point me in the direction of decent examples\tutorials, I would be much appreciative.

eh my code isn't really great but it's a start.
September 19, 2013
BTW I don't often check this newsgroup, so if you CC my email on any replies, I'll see it a lot faster that way.