-
Notifications
You must be signed in to change notification settings - Fork 113
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
Comments
What are the major engines?
|
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). |
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. |
I have no idea how the various JS engines interface to the operating system. Or how to run this in a browser.
The text was updated successfully, but these errors were encountered: