Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port asm.js target to more engines #36

Open
larsbrinkhoff opened this issue Apr 20, 2017 · 3 comments
Open

Port asm.js target to more engines #36

larsbrinkhoff opened this issue Apr 20, 2017 · 3 comments

Comments

@larsbrinkhoff
Copy link
Owner

I have no idea how the various JS engines interface to the operating system. Or how to run this in a browser.

@larsbrinkhoff
Copy link
Owner Author

What are the major engines?

  • SpiderMonkey, TraceMonkey?, JägerMonkey?; just how many monkies?? Odin, Ion, ...
  • Rhino? In Java? Is that useful?
  • V8, yay Scandinavia!
  • Node, based on V8
  • Nitro, SquirrelFish?
  • Chakra

@pipcet
Copy link
Contributor

pipcet commented Apr 21, 2017

I don't know too much about the non-SpiderMonkey engines, but the current code should work under IonMonkey, the Baseline compiler, and the SpiderMonkey JS interpreter, though I say that without having tested it. Node.js has its own OS interface, which makes it hard to read input synchronously; V8 has a shell with a minimal OS interface similar to what SpiderMonkey offers.

I think the interesting target is the browser environment, ideally using only W3C APIs, but there is at least one obstacle: asynchronous APIs (and they all are) require control to pass back and forth between the Forth interpreter and the JavaScript top level. Nothing too hard to do, but a bit fiddly.

I've got a very WIP WebAssembly backend displaying "ok". (This is literally the first version that passes my sophisticated "3 4 * ." test.) Ideally, this should share some code with the asm.js backend. (Code at https://github.com/pipcet/lbForth/tree/wasm).

@pipcet
Copy link
Contributor

pipcet commented Apr 21, 2017

Nothing too hard to do, but a bit fiddly.

Okay, I've got something working with nodejs at https://github.com/pipcet/lbForth/tree/asynchronous-js. I'll try to turn that into "official" nodejs support next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants