Re: JavaScript Implementations

[prev] [thread] [next] [lurker] [Date index for 2006/05/30]

From: Chris Nandor
Subject: Re: JavaScript Implementations
Date: 21:11 on 30 May 2006
At 22:52 +0100 2006.05.29, Dominic Mitchell wrote:
>JavaScript -- the new respectable face of the web.  Until you want to do
>anything with it outside of a browser.  There's apparently lots of choice:
>
>* Rhino -- except that loading a full JVM to run a few lines of
>JavaScript code is living using a JCB to swat a fly.
>* SpiderMonkey -- Mozilla's JavaScript engine, ripped out and zombie-like.
>* njs -- so dormant it's like Rip van Winkle.
>* WSH -- yep, that'll work really well on my mac.
>
>All I wanted to do was run JSLint at the command line.  Surely it can't
>be that hard?  Yet SpiderMonkey has no I/O capabilities at all.  Rhino
>has ReadFile(), but it's Java and slow.  njs couldn't even parse the
>bloody jslint source, let alone try providing some input to it.
>
>That's OK, I'll work around this by using JavaScript::SpiderMonkey and a
>small bit of Perl.  Except that appears to hang completely when run
>against the simplest function().  What a steaming pile of donkey turds.

	[pudge@bourque js]$ cd /usr/local/src/js/src/Darwin_DBG.OBJ
	[pudge@bourque js]$ cat > test.js
	var x = { a: 1, b: 26 };
	print(x.b + x.a);
	[pudge@bourque js]$ ./js test.js
	27
	[pudge@bourque js]$ ./js
	js> var x = { a: 1, b: 26 };
	js> x.b + x.a;
	27

Dunno if this helps you ... but I was able to compile SpiderMonkey for Mac
and run it on the command line without much difficulty.

-- 
Chris Nandor                      pudge@xxxxx.xxx    http://pudge.net/
Open Source Technology Group       pudge@xxxx.xxx     http://ostg.com/

Generated at 08:01 on 31 May 2006 by mariachi 0.52