I have been experimenting with the emscripten C to JavaScript compiler. I have used it to compile the Gambit interpreter into JavaScript. This allows the Gambit interpreter to run in the browser! Just direct your browser to
http://feeley.github.io/gambit-in-the-browser
Be patient... it can take 30 seconds to a minute to load the page (there's about 11 MB of JavaScript code). Use a fast JIT based browser if possible (Firefox or Chrome have been tested).
Marc
Afficher les réponses par date
On Sun, 09 Jun 2013 10:47:39 +0200, Marc Feeley feeley@iro.umontreal.ca wrote:
I have been experimenting with the emscripten C to JavaScript compiler. I have used it to compile the Gambit interpreter into JavaScript. This allows the Gambit interpreter to run in the browser! Just direct your browser to
http://feeley.github.io/gambit-in-the-browser
Be patient... it can take 30 seconds to a minute to load the page (there's about 11 MB of JavaScript code). Use a fast JIT based browser if possible (Firefox or Chrome have been tested).
Very nice work Marc!
I haven't used Gambit Scheme lately, but wow, that is a great idea. I hadn't thought of it! I have worked a lot with asm.js, and I noticed that it's failing to run with asm.js because it uses setjmp/longjmp. I know that Alon is working on getting that to work with emscripten. I wonder how much work it would be to get all of Gambit working with asm.js.
This might make me want to start hacking on Gambit again!
On Sun, Jun 9, 2013 at 4:52 AM, Ralph Moritz ralph.moeritz@outlook.comwrote:
On Sun, 09 Jun 2013 10:47:39 +0200, Marc Feeley feeley@iro.umontreal.ca wrote:
I have been experimenting with the emscripten C to JavaScript compiler. I have used it to compile the Gambit interpreter into JavaScript. This allows the Gambit interpreter to run in the browser! Just direct your browser to
http://feeley.github.io/gambit-in-the-browser
Be patient... it can take 30 seconds to a minute to load the page (there's about 11 MB of JavaScript code). Use a fast JIT based browser if possible (Firefox or Chrome have been tested).
Very nice work Marc!
-- Is it possible that software is not like anything else, that it is meant to be discarded: that the whole point is to see it as a soap bubble? -- Alan Perlis _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Hello James!
On Jun 10, 2013, at 10:09 AM, James Long longster@gmail.com wrote:
I haven't used Gambit Scheme lately, but wow, that is a great idea. I hadn't thought of it! I have worked a lot with asm.js, and I noticed that it's failing to run with asm.js because it uses setjmp/longjmp. I know that Alon is working on getting that to work with emscripten. I wonder how much work it would be to get all of Gambit working with asm.js.
I'm currently working on that problem with Alon. I'm also tracking down the bug causing sudden termination after a minute or so of execution.
This might make me want to start hacking on Gambit again!
Hmmm! Care to try to get networking working? WebRTC would allow two browsers running Scheme code to exchange data, migrate threads, etc. Now *that* would be neat!
Marc
On Mon, Jun 10, 2013 at 1:15 PM, Marc Feeley feeley@iro.umontreal.cawrote:
This might make me want to start hacking on Gambit again!
Hmmm! Care to try to get networking working? WebRTC would allow two browsers running Scheme code to exchange data, migrate threads, etc. Now *that* would be neat!
That would be awesome! The peer-to-peer connection stuff in WebRTC is very cool, and I've been meaning to play around with it more. I'm a bit backlogged on stuff right now, but I'll keep this in mind!
Awesome!
2013/6/9 Marc Feeley feeley@iro.umontreal.ca
I have been experimenting with the emscripten C to JavaScript compiler. I have used it to compile the Gambit interpreter into JavaScript. This allows the Gambit interpreter to run in the browser! Just direct your browser to
http://feeley.github.io/gambit-in-the-browser
Be patient... it can take 30 seconds to a minute to load the page (there's about 11 MB of JavaScript code).
gzip -9 brings the 11.2MB to 1.88MB which is really fair.
The feeley.github.io server has automatic gzip (-6?) compression enabled already so what's transfered currently is 2.6MB. Download time seems to be ~1.5s so the server probably cached the compressed content, so all that is not a bottleneck.
Then, probably what takes the most time here is the web browser JS parsing. Probably browsers will improve this, with the advent of asm.js and alike.
Maybe if doing emscripten compilation with ASM_JS as target configuration and running on Firefox nightly that includes asm.js now, the parse/initialization time would go down alot already.
Use a fast JIT based browser if possible (Firefox or Chrome have been tested).
Marc
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
2013/7/23 Mikael mikael.rcv@gmail.com
Awesome!
2013/6/9 Marc Feeley feeley@iro.umontreal.ca
I have been experimenting with the emscripten C to JavaScript compiler. I have used it to compile the Gambit interpreter into JavaScript. This allows the Gambit interpreter to run in the browser! Just direct your browser to
http://feeley.github.io/gambit-in-the-browser
Be patient... it can take 30 seconds to a minute to load the page (there's about 11 MB of JavaScript code).
gzip -9 brings the 11.2MB to 1.88MB which is really fair.
The feeley.github.io server has automatic gzip (-6?) compression enabled already so what's transfered currently is 2.6MB. Download time seems to be ~1.5s so the server probably cached the compressed content, so all that is not a bottleneck.
Then, probably what takes the most time here is the web browser JS parsing. Probably browsers will improve this, with the advent of asm.js and alike.
Maybe if doing emscripten compilation with ASM_JS as target configuration and running on Firefox nightly that includes asm.js now, the parse/initialization time would go down alot already.
Parsing will still be done by the Javascript engine so this won't improve the loading time. I'm not sure this is practical.
You might be interested by http://www.rfk.id.au/blog/entry/pypy-js-first-steps/
Is it possible to access the dom ?
On 2013-07-23, at 7:52 PM, Amirouche Boubekki amirouche.boubekki@gmail.com wrote:
Is it possible to access the dom ?
Yes. Use the jseval procedure to evaluate JavaScript code. For example:
(jseval "document.body.innerHTML")
Marc