> Arjun Guha, Claudio Saftoiu and Shriram Krishnamurthi have a recent paper on 
> the topic:
>   
> http://www.cs.brown.edu/~sk/Publications/Papers/Published/gsk-essence-javascript/
> Having had some experience with this question myself, let me just say that 
> while formalization is
> appealing, it's a very subtle and time-consuming task.

I don't agree with this. Two of us formalized, implemented, and tested
that paper in a month. That is hardly time-consuming, and it's not
very subtle since we have test suites to test our formalization.

We haven't perfectly matched the *entire* spec.  (e.g. we mapped JS
regexps to regexps in Scheme). But, I believe we got a covered a good
portion of ES3 (see section 3 of the paper).

> That includes more rigorous approaches like operational semantics

Don't try to build a semantics for the entire language. Instead, build
a semantics for the "essentials" (i.e. objects and functions) and
write a function that elaborates all the details of language into the
semantics.

> Math gives you more wiggle-room, but it's still finicky and much slower going 
> than code.

You do not have to choose between "math" and "code". You can use both
as appropriate. If you look at the paper, think of LambdaJS as the
essential math, and desugaring as code for the remaining details.

 And > even most research languages don't have fully formalized
semantics. [ Standard ML is about the only
> one I know of that is 100% formalized. Don't tell me Scheme is

I don't think anyone claims that it is.

> (I'm not saying improving the spec language is a bad idea, just trying to 
> spell out some of the challenges.)

Btw, Joe Politz (student at Brown) is currently formalizing ES5
following the approach Claudiu and I used for current-JavaScript. He's
striving to conform to the conformance suite and has already made some
progress. The project is on Github, as usual:

http://github.com/arjunguha/ML-LambdaJS

It's the LambdaJS approach: a semantics for the essentials, which lets
you write precisely write down the algorithms in the spec:

http://github.com/arjunguha/ML-LambdaJS/blob/master/data/es5-lib.es5

Arjun
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to