Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RickCarlino/WASM-Forth
A sort-of-kind-of-working Forth interpreter that runs in the browser using Web Assembly (WASM). PRs welcome.
https://github.com/RickCarlino/WASM-Forth
Last synced: 2 months ago
JSON representation
A sort-of-kind-of-working Forth interpreter that runs in the browser using Web Assembly (WASM). PRs welcome.
- Host: GitHub
- URL: https://github.com/RickCarlino/WASM-Forth
- Owner: RickCarlino
- License: mit
- Created: 2017-08-21T23:26:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-21T23:29:36.000Z (over 7 years ago)
- Last Synced: 2024-06-11T21:55:48.873Z (8 months ago)
- Language: C
- Size: 31.3 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- AwesomeInterpreter - WASM-Forth
README
# Forth on WASM
This repo (sort of) runs a [Forth interpreter](https://en.wikipedia.org/wiki/Forth_(programming_language)) natively (no transpilation!) in any browser that supports [Web Assembly](http://webassembly.org/). The Forth interpreter (the part written in C) was originally authored by [Leif Bruder](http://defineanswer42.wordpress.com) in 2014 under a public domain license. Thanks, Leif!
It sort of works, but unfortunately, causes the browser to hang. I would really like to know why, but have yet to find a cause.
# Issues
1. `forth.c` runs great on Linux x64 via `gcc`. See `forth_native_exe` to try it on your own machine. The source was compiled via `gcc forth_native.c -o forth_native_exe`. I only had to change the original source in two places to compile native vs. WASM (relates to cell size).
2. When compiling `forth_wasm.c` to binary (see: `program.wasm` and `index.html`) via [WASM Fiddle](https://wasdk.github.io/WasmFiddle/), the program sort-of-kind-of runs. The problem is that it does not pause and freezes the browser tab on both Chrome and Firefox.# How to Replicate
1. (optional) Run `forth_native_exe` on a Linux machine. Notice that it does not crash.
2. Open `index.html` in Chrome. Notice that it crashes. [This link will cause your tab to hang, probably.](https://rawgit.com/RickCarlino/WASM-Forth/master/index.html)
3. Open `index.html` in Firefox. Notice that it crashes. [This link will cause your tab to hang, probably.](https://rawgit.com/RickCarlino/WASM-Forth/master/index.html)...does anyone have any ideas as to why?
# License
`forth.c` is licensed as public domain software. All other code is licensed under the MIT license.