<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 09/06/2014 19:35, Jim Blandy wrote:<br>
</div>
<blockquote
cite="mid:CAHgb+0=NatVp_Sm6-zYmSkOWBu+rOaSutos5gCumeXBzV4uV8Q@mail.gmail.com"
type="cite">
<div dir="ltr">On Mon, Jun 9, 2014 at 11:12 AM, Gijs Kruitbosch <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:gijskruitbosch@gmail.com" target="_blank">gijskruitbosch@gmail.com</a>></span>
wrote:<br>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Considering the amount of spew this generates on
startup, I would actually suggest that spending time
on writing an ASI->source transformation tool, if
we don't have one already, for SM's version of JS,
would take less time, and that should allow us to do
these kinds of transformations relatively painlessly.
Is dehydra still alive?<span class=""><font
color="#888888"><br>
<br>
<br>
</font></span></div>
</div>
</blockquote>
<div><br>
</div>
<div>Dehydra analyzed C++, not JS. (The analyses were
written in JS.)<br>
<br>
</div>
<div>There are many JS parsers available, some of which
understand SpiderMonkey's extensions. The built-in
Reflect.parse actually uses SpiderMonkey's own parser,
although it has some other limitations that make it not
ideal for code generation (patches welcome!).<br>
<br>
</div>
<div>I think this project would end up spending more of its
time getting formatting right, preserving comments, and so
on, and the actual rewrites would be trivial.<br>
</div>
</div>
<br>
</div>
</div>
</blockquote>
Doesn't Reflect.parse not have an output method, ie no way to go
from AST back to source?<br>
<br>
As long as there was a way to have a 1:1 source->AST->source
conversion already, and you could manipulate the AST in the middle,
it shouldn't be hard to do that without all that much extra work.<br>
<br>
As for the triviality of the rewrites - maybe so, but once we
actually have a decent static rewriting tool for JS, it can be
reused, whereas all the energy put into doing the manual rewrite
once isn't reusable. I guess it boils down to where we think this
falls in this diagram: <a class="moz-txt-link-freetext" href="http://xkcd.com/1205/">http://xkcd.com/1205/</a> :-)<br>
<br>
~ Gijs<br>
</body>
</html>