unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Some observation of current ECMAScript implementation
@ 2011-01-05 15:37 Kan-Ru Chen
  0 siblings, 0 replies; only message in thread
From: Kan-Ru Chen @ 2011-01-05 15:37 UTC (permalink / raw)
  To: guile-devel

Hello list,

I originally wanted to use guile to simultaneously load some small js
library (~2K LOC) and the main program wrote in scheme.  But I found the
current ECMAScript still not suitable to run real world js library
because of its lexer/parser cannot handle some pattern that often appear
in real programs, and its compiled function object is not semantically
conforming to ECMAScript Function Object, etc.

Although I cannot use guile for ECMAScript now, I want to share some
observation with you.  After read the ES3.1 spec, I found the most
difficult part of parsing ECMAScript that guile is lacking are:

  - Unicode identifiers         (7.6 Identifiers)
  - Regular expression literals (7.8.5 Regular Expression Literals)
  - Semicolon insertion         (7.9 Automatic Semicolon Insertion)

RegularExpressionLiteral and Semicolon insertion are very hard to do
right while they need the grammar context to help to decide how to lex
next token.

Example that didn't parse or emit correct tree-il:

  a()/b();           // regexp literals may not contain newlines in
                     // form "b();"

And there is no Function object, where the spec says every built-in
object/constructor are either Function or Object class.  In practice new
objects are created/inherited from object object or function object.

The question is how to pull in the Function object semantic and retain
the interoperability between ECMAScript and scheme procedure?  OK, I'm
reading GOOPS in order to understand the magics happened in (language
ecmascript function)

Thanks,
Kanru
--
I'm very new to guile, but I believe it has future.
Currently reading R⁵RS and guile manual.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-05 15:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 15:37 Some observation of current ECMAScript implementation Kan-Ru Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).