having a blast reading the JavaScript spec. (ECMAScript Language Specification - ECMA-262 Edition 5.1) Just occurred to me it's possible to turn ECMAScript spec into a formal language. Big project though. But easier than say Python or Java.

you see, there are hundreds pages of English verbosity. And quite imprecise and open to interpretation. So, the desire is to turn it into symbolic logic. More specifically, formal language. That is, a set of strings and string transformation rules, that fully specify JavaScript.

ECMAScript Language Specification - ECMA-262 Edition 5.1
http://xahlee.info/javascript_ecma-262_5.1_2011/JavaScript_ECMA-262_5.1_2011.html

Programing Language Design
http://xahlee.info/comp/comp_lang.html

Math Notations, Computer Languages Syntax, and the “Form” in Formalism
http://xahlee.info/cmaci/notation/index.html
7
Xah Lee's profile photoJerry Saravia's profile photoThomas Burleson's profile photoJohn McCullough's profile photo
10 comments
 
+Xah Lee, tell me about it. The ECMAScript spec is particularly horrible as language specs go -- it's like it was written to be really hard to write an implementation from. (I commend the C Standard unto you for a lovely example of how to write the things properly.)
Xah Lee
 
+Nick Alcock i've read some Java lang spec and Python lang spec (and most of R4RS some decade ago). To me the ECMAScript spec is easier to read than java or python. But perhaps that's due to having read fully JavaScript book by David Flanagan http://xahlee.info/comp/js_book_man_made_complexity.html
which i enjoyed thoroughly.

C standard is the
http://en.wikipedia.org/wiki/C11_(C_standard_revision)
?
i assume C is simpler lang than js? but glancing at that wp page... omg those low level terms and threading stuff... i no unstand!
 
+Xah Lee, of course languages you are familiar with are easier to read the specs of!

C, well, hm. It's both simpler than JS (no closures, no first-class functions, no dynamic data structures more complex than arrays) and more complex (structs / unions / bit-fields / const/volatile/restrict / register, lots of implementation-defined behaviour to allow optimizers to work nicely...)

It's hard to gauge. Both are much simpler than C++, of course.

There've been several C standards over the years. C89/C90, C99, and now C11. C11 is still being implemented and very little code uses it yet. C99 is widely supported and used by now, but a lot of code using C89 is still in use. (Almost all implementations use the same ABI for all three, so programs can be written in a mixture of the three and can inter-call. So sooner or later you have to know all of them! :P )

The C/C++ relationship is even more fraught. C++90 was pretty much a superset of C89, but C99 made changes that C++ did not take up, and the same again with C11. In all sorts of ways they are basically different languages now (though not so different that header files can't generally be shared between the two, thank goodness).
Xah Lee
 
+Kasper Lund thanks for the link. That's very interesting. Anyone know what happened to that?
 
I read it after trying JavaScript first and the spec definitely helped clear some things up about how the prototyping works.

I tried reading it before programming in JavaScript and it was horribly difficult to understand.

I definitely use it as a reference for the built in functions and have the PDF ready on my desktop if I have doubts. Jsfiddle definitely helps a ton and so do the developer tools in the browser. Good luck with the formal definition.
 
"having a blast reading the JavaScript spec" LOL!! My kind of guy. After watching a bunch of Crockford videos, I've been meaning to take a look. Will do it over spring break. My wife and boys will think I'm crazy. If they could only understand...
 
@John- that is crazy and I love it.

Sometimes, I will hear my kids ask my wife:
    "Mom, what is Dad doing staring like that and not responding my question?"
 She replies:
   "Kids, he looks like that when he is programming in his head. He will be `back` later."
 
+Thomas Burleson LOL!! I definitely have those moments. I frequently use terms like "task switch" and "background task" with my family. I absolutely love what I do.
Add a comment...