January 21, 2005
Walter wrote:

> 3x faster! Woo-hoo!

4x faster than the implementation from mozilla.

-manfred
January 21, 2005
"Chris Sauls" <Chris_member@pathlink.com> wrote in message news:csp9vu$v61$1@digitaldaemon.com...
> In article <csp4pm$o45$4@digitaldaemon.com>, Walter says...
> >To add a function, just add it in like the ones in dglobal.d. To create a new object type, I'd just copy the code in protoerror.d and modify it to suit.
>
> Think one day the DMDScript engine will be available as a truly
just-link-in
> library?  I can't help dreaming of code like:
> #
> #  private import etc.dmdscript.dmdscript; // or... something
> #
> #  static this() {
> #    // Where Foo is a class implementing some standard interface
> #    // Maybe IScriptObject or the like
> #    DMDScript.registerObject("Foo", &(Foo.scriptFactory));
> #  }
> #
>
> Any chance of it?  Or is that do-able now with some boilerplate?

It's doable now. Look at protoerror.d.


January 21, 2005
"Manfred Nowak" <svv1999@hotmail.com> wrote in message news:csphgk$17s1$1@digitaldaemon.com...
> Walter wrote:
>
> > 3x faster! Woo-hoo!
>
> 4x faster than the implementation from mozilla.

Mozilla has gotten faster, then. It used to be 20x faster.


January 23, 2005
In article <cspks9$1c6h$2@digitaldaemon.com>, Walter says...
>
>"Chris Sauls" <Chris_member@pathlink.com> wrote in message news:csp9vu$v61$1@digitaldaemon.com...
>> #  private import etc.dmdscript.dmdscript; // or... something
>> #
>> #  static this() {
>> #    // Where Foo is a class implementing some standard interface
>> #    // Maybe IScriptObject or the like
>> #    DMDScript.registerObject("Foo", &(Foo.scriptFactory));
>> #  }
>> #
>>
>> Any chance of it?  Or is that do-able now with some boilerplate?
>
>It's doable now. Look at protoerror.d.
>

Well today I did get around to looking at it, and attempted to add a class to DMDScript, without editing the engine..  And after only an hour of experimenting, can declare 100% succes!  I think I know of a few projects (such as my friend's bittorrent client, and our envisioned 100% D MUD server) which could benefit from this...

To show what I accomplished, I got the following DMDScript to execute, with the shown output.  Obviously "Monkey" is the class I added.

dsext.ds
#
#  var helloStr = "Hello world! (from DMDScript!!!)";
#  print("\n", helloStr, "\n");
#
#  var monkey = new Monkey;
#
#  println(monkey);
#  println("monkey.furColor = \"", monkey.furColor, "\"");
#  println("monkey.hungry = ", monkey.hungry);
#  println("Calling monkey.eatBanana()");
#  monkey.eatBanana();
#  println("monkey.hungry = ", monkey.hungry);
#

output
#
#  Hello world! (from DMDScript!!!)
#  [object Monkey]
#  monkey.furColor = "brown"
#  monkey.hungry = 1
#  Calling monkey.eatBanana()
#  monkey.hungry = 0
#

You should really write up an official how-to on this, though...  I'm sure there's some things I'm missing yet, even though it works.  Meanwhile, thanks for quite a nifty new tool!

-- Chris Sauls


January 23, 2005
Nice! How about posting monkey.d here?

"Chris Sauls" <Chris_member@pathlink.com> wrote in message news:csut90$1te8$1@digitaldaemon.com...
> In article <cspks9$1c6h$2@digitaldaemon.com>, Walter says...
> >
> >"Chris Sauls" <Chris_member@pathlink.com> wrote in message news:csp9vu$v61$1@digitaldaemon.com...
> >> #  private import etc.dmdscript.dmdscript; // or... something
> >> #
> >> #  static this() {
> >> #    // Where Foo is a class implementing some standard interface
> >> #    // Maybe IScriptObject or the like
> >> #    DMDScript.registerObject("Foo", &(Foo.scriptFactory));
> >> #  }
> >> #
> >>
> >> Any chance of it?  Or is that do-able now with some boilerplate?
> >
> >It's doable now. Look at protoerror.d.
> >
>
> Well today I did get around to looking at it, and attempted to add a class
to
> DMDScript, without editing the engine..  And after only an hour of experimenting, can declare 100% succes!  I think I know of a few projects
(such
> as my friend's bittorrent client, and our envisioned 100% D MUD server)
which
> could benefit from this...
>
> To show what I accomplished, I got the following DMDScript to execute,
with the
> shown output.  Obviously "Monkey" is the class I added.
>
> dsext.ds
> #
> #  var helloStr = "Hello world! (from DMDScript!!!)";
> #  print("\n", helloStr, "\n");
> #
> #  var monkey = new Monkey;
> #
> #  println(monkey);
> #  println("monkey.furColor = \"", monkey.furColor, "\"");
> #  println("monkey.hungry = ", monkey.hungry);
> #  println("Calling monkey.eatBanana()");
> #  monkey.eatBanana();
> #  println("monkey.hungry = ", monkey.hungry);
> #
>
> output
> #
> #  Hello world! (from DMDScript!!!)
> #  [object Monkey]
> #  monkey.furColor = "brown"
> #  monkey.hungry = 1
> #  Calling monkey.eatBanana()
> #  monkey.hungry = 0
> #
>
> You should really write up an official how-to on this, though...  I'm sure there's some things I'm missing yet, even though it works.  Meanwhile,
thanks
> for quite a nifty new tool!
>
> -- Chris Sauls
>
>


January 23, 2005
Walter wrote:
> Nice! How about posting monkey.d here?

Actually its 'dsext.d' but I will do / have done.  It isn't much... but I think based on this I should be able to find a nice smooth way of doing it.  A friend and I are thinking we could combine it with Sofu to create classes from files.  :)  Yes we do get bored sometimes.


-- Chris Sauls


January 24, 2005
Walter wrote:

> 
> "Anders F Björklund" <afb@algonet.se> wrote in message news:csmvth$ul0$1@digitaldaemon.com...
>> The "minimal test suite" suite.ds fails, by the way ?
>>
>> > Error: assert() line 1407
> 
> Hmm. It works on my machine. It might be because you're in a different timezone.

Yes, Walters timezone -0800 behind UTC, so time 0 ( 1 Jan 1970 ) becomes 31
Dec 1969.

Regards, Paul Clinch.

January 24, 2005
Thanks!


January 29, 2005
after some slight modification, I was able to get IE, Firefox and ds working. Here are the results: (winxp, amd xp 2500, 512MB ram)

(ds)
standard makfile settings: 187

(IE)
standard .html file: 500
Lionello's timer patch: 281

(Firefox)
standard .html file with 'scriptengine' line removed: 625
Lionello's timer patch + some modifications: 250

------------------

in firefox, there appears to be a bug in the js parser, because the timer won't release the browser into "page loaded" mode.

I'm also not really sure where there is such a huge increase in time between the timer and not.

And, on a side note, I just discovered D yesterday, and already have huge plans for it. I had to write a quick RLE implementation, and I chose D to do it, and I have been more than pleased :)

Thanks so much for D, and great job on DMDscript!

Kenny

Lionello Lunesu wrote:
> Haven't tried 'ds' yet, but using Microsoft's cscript I get a result of ~578.
> 
> Using the html IE I got something similar, but to prevent IE's downloading/html threads from getting CPU, I changed the html file (see below) so that it waits 1 second (for the HTML to be loaded and parsed) before it runs the test and then I get ~297 (tested several times).
> 
> I don't really trust these results. Does IE do some pre-parsing to byte-code?
> 
> No result from within FireFox, even after commenting out the line with ScriptEngine(). Just keeps running and running....
> 
> Lionello.
> 
> -------------------------------------------
> <HTML>
> <BODY onload="timer=setTimeout('doit()',1000);">
> <SCRIPT LANGUAGE="JavaScript">
> 
> document.write(navigator.appName);
>  var b = navigator.appName
>  if (b=="Netscape") this.b = "ns"
>  else if (b=="Microsoft Internet Explorer") this.b = "ie"
>  else this.b = b
> document.writeln(" " + b);
> 
> document.write("<br> ScriptEngine " + ScriptEngine() + " Build " + ScriptEngineBuildVersion() + "<br>");
> 
> document.write("<h2>Eratosthenes Sieve prime number calculation</h2><br>");
> 
> function doit()
> {
> //.............
> }
> 
> </SCRIPT>
> </BODY>
> </HTML>
> 
> 
1 2 3 4
Next ›   Last »