<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Over the weekend I ported Narcissus to run in a Chrome web page, but ran into a few issues that I'd like help with. Most of the changes that needed to be made were straightforward, but I still need help with two of them. Any advice or suggestions would be appreciated!</span><div style="font-family:arial,sans-serif;font-size:13px">
<div><ol><li style="margin-left:15px">There's a reference to a "Proxy" in interpreter.js that I don't recognize. Is there a JS implementation, or a definition of the API for this object somewhere that I can use to implement something reasonable? I wrote a tiny stub that's probably completely wrong, with methods for create() and createFunction() that were mere wild guesses.</li>
<li style="margin-left:15px">I don't have any evalWithLocation method, so the fallback to regular eval is being used, which works OK until I run into errors. Is there a JS implementation for evalWithLocation that I could use instead, or does someone have an idea for how it could be written fairly easily in JS? It looks like using RequireJS might be a better way to load the Narcissus scripts than using evalWithLocation -- does anyone know if Narcissus works with RequireJS?</li>
</ol><div>Details on the changes I made for Narcissus to run in a Chrome client, in case other folks end up trying something similar:<br></div></div><div><ul><li style="margin-left:15px">Added Narcissus source files to my AppEngine server.</li>
<li style="margin-left:15px">Implemented a read() method in JavaScript to return the Narcissus source files (prefetched from my server). Maybe using RequireJS would be better? (<a href="http://requirejs.org/">http://requirejs.org/</a>). </li>
<li style="margin-left:15px">Used the SpiderMonkey shell.js and init.js files to shim the other CommonJS requirements, like require().</li>
<li style="margin-left:15px">Changed occurrences of "<font face="courier new, monospace">let</font>" to "<font face="courier new, monospace">var</font>" because Chrome doesn't seem to recognize the "let" keyword.</li>
<li style="margin-left:15px">Changed occurrences of "<font face="courier new, monospace">catch (e if e ...</font>" to "<font face="courier new, monospace">catch (e) { if (e ... }</font>" because Chrome complains about these constructs too.</li>
<li style="margin-left:15px">Wrote the Proxy stub (referenced above).</li></ul><div>Some background on my project: I want to experiment with different language control structures, such as state-machines and spreadsheet-style dependency trees. I'd like to build an IDE that can run in any browser to allow building simple web-based games using these language features, in order to get a feel for the pros and cons of these new constructs. Starting with JavaScript as a base language seemed like a good idea, but it's taken me a while to find the right hackable JavaScript. Over the weekend I discovered Narcissus, and it seems like a pretty good fit for these goals!</div>
<div><br></div><div>I'm really glad that Narcissus is available, and open source! It looks like it will be fun to play with.</div></div></div></div>