[Mono-list] Re: Javascript and Mono

Jeroen Janssen japj@xs4all.nl
Mon, 06 Jan 2003 22:49:37 +0100


Steve Newman wrote:

>Yes, I think you will find that Microsoft's JScript is using helper functions.  At any rate, I don't know how you would implement J[ava]Script without them, because (unlike C#) there is a lot of potentially complex logic implied in basic operations like "+" -- see Miguel's AddTwoThings example.
>  
>
We probably need to know exactly what helperfunctions (runtime) 
Microsoft JScript contains (don't know exactly where to find it in the 
Microsoft documentation)..

>In the JANET source, the files JPrimitive.cs, JObjects.cs, and JRuntime.cs are essentially all "helper code" in this sense.  The other files are only needed for compilation (and operations like "eval"), but these three files, two of which are fairly large, are needed to support the compiled code.
>  
>
Ok, so there is good 'seperation' of runtime and compiler? (or do we 
need to make this more explicit?)

>One key point is that currently, JANET generates a call to the support library for every operation.  This is because so far I've only implemented ECMAScript 3, which doesn't include type declarations.  In JScript, you may have type information at compile time, in which case the support library operations can often be optimized away.  I haven't tried to address that yet in JANET.
>
In what way does the support library look like the Microsoft JScript 
'helper' functions (or not at all yet?)

>Slightly off-topic: can anyone point me at a complete specification for JScript.NET?  Failing that, is there a reasonably complete reference manual that can be used in lieu of a specification?  The last time I looked on the Microsoft site (which was a while ago), all I could find was a brief "introduction to JScript" -- not very satisfying if you're trying to produce your own language implementation.
>  
>
Have a look at 
http://msdn.microsoft.com/library/en-us/jscript7/html/jsoriJScript.asp

I'll put a link in the readme for janet.
---
Jeroen