HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
remko
waforth
WebAssembly2018–2026
remko / waforth

waforth

Small but complete dynamic Forth Interpreter/Compiler for and in WebAssembly

10Distinct people
15Mentions
1Explicit recommenders
596GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Small but complete dynamic Forth Interpreter/Compiler for and in WebAssembly

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

It is, actually! I didn’t realize that until I read the handwritten WASM s-expression source code of WAForth. Languages like Lisp or Forth that run on WASM — or even…

DonHopkins used a recommendation phrase. 5 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year15 dated mentions

Observed mentions: 2018-08-01 11:35:28 UTC to 2026-05-22 02:26:00 UTC.

01232018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 3 mentions; 2 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC110
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC303
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC303
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC321
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC312

What Hacker News says

15 sources
Any reason this can't be compiled to wasm and run in browsers that way? Networking (protocol) issues? Ed: I guess you'd need a way to run wasm in wasm, and a way to author wasm contracts - and there's not yet a wasm-hosted rust compiler? Ed2: I'm not up to date on the state of self-hosted wasm compiler/languages... But I did come across: https://github.com/remko/waforth I guess it's time to dig out the thesis[t] again and look at movable code and p2p classifications again ... [t] https://ics.uci.edu/~fielding/pubs/dissertation/net_arch_sty...
In Show HN: Freenet, a peer-to-peer platform for decentralized apps
90s_dev·Jun 29, 2025Submission

Ask HN: Languages Designed for WASM?

Hi everyone. I'm on a hunt to find all languages that are designed specifically to compile to WASM. I have a project (hram.dev -- hand-rolled assembly machine) that I want to build to share the joy of unwrapping a new computer in the 80s/90s that boots up with an editor so that you can program it directly in assembly, and I plan to use wamr+llvm for near-native performance while still having isolation so that you can mess things up. Obviously the ability to write WAT directly will be fundamental and certainly fun, but I am looking for higher level languages that make it slightly less convenient to write, to bundle with it internally so that users have at least two choices of how to write code. Do you know of any other languages designed specifically for wasm? These are all I could find: Most likely: curlywas (https://github.com/exoticorn/
Read the rest
curlywas) -- c-like but very low-level; seems very complete; rust impl; mit license; short but seemingly thorough docs? wa (https://github.com/wa-lang/wa) -- go-like, not clear how high/low level it is, thorough docs, seems promising, agpl license, lots of mandarin in docs virgil (https://github.com/titzer/virgil) -- ruby-like? gc; cant find license; last commit 3 hours ago; thorough docs but all in md files in repo assemblyscript (https://github.com/AssemblyScript/assemblyscript) -- typescript-like; apache 2 license, minimal runtime with gc; implemented in js walt (https://github.com/ballercat/walt) -- JavaScript-like made for wasm, 25 contributors! decent looking docs, might actually be usable! most commits 7 years ago but last commit 3 years ago though, mit license onyx (https://wasmer.io/posts/onyxlang-powered-by-wasmer, https://github.com/onyx-lang/onyx) -- ocaml-like? recent activity, full docs, bsd license, not sure if it has lower level capabilities or how much the higher level features cost at runtime or build time waforth (https://github.com/remko/waforth) -- forth for wasm! upside is that its forth, downside is that its forth; mit license; great docs; seemingly inefficient due to constant lookups? Less likely: thinscript (https://github.com/evanw/thinscript) -- js-like with macros; abandoned 9 years ago; not yet licensed wase (https://github.com/area9innovation/wase) -- C-like syntax but still wasm-like, not super recent but not super old, only a few contributors, not sure how complete it is but its docs give a feeling of being mostly-complete, MIT license wam (https://github.com/kanaka/wam) -- wasm macro preprocessor, just one guy, last commit 7 years ago, very few built in macros, mozilla license (???) wah (https://github.com/tmcw/wah) -- wasm but with infix, doesn't seem extensible with macros, two contributors, last commit 8 years ago, eclipse license (???) Honorable mentions: mini-c (https://github.com/maierfelix/mini-c) -- C to wasm compiler, seemingly abandoned 8 years ago, not sure how complete it is c4wa (https://github.com/kign/c4wa) -- c to wasm compiler, no activity in 3 years, no license, written in java
6 points · Open discussion
DonHopkins·Jun 25, 2025Recommendation phrase
It is, actually! I didn’t realize that until I read the handwritten WASM s-expression source code of WAForth. Languages like Lisp or Forth that run on WASM — or even handwritten s-expression-style WASM code like in the WAForth kernel — can dynamically compile and assemble new WASM bytecode and data. They can then call back to the JavaScript host to create and link entirely new WASM modules on the fly, and immediately call into them from the current module or others. A single WASM context can juggle many dynamic modules, large and small, all generated and linked at runtime! So you can compile new code in Forth or Lisp and immediately link and call it using indirect cross-module calls. It’s not the fastest way to call into WASM, but a metacompiler — like Mitch Bradley’s ForthMacs / OpenFirmware — could recompile the whole system into one ef
Read the rest
ficient, monolithic WASM module that uses direct calls. Here's the author's blog post about WAForth: A Dynamic Forth Compiler for WebAssembly https://el-tramo.be/blog/waforth/ https://news.ycombinator.com/item?id=34374057 DonHopkins on Jan 13, 2023 | parent | context | favorite | on: What the hell is Forth? (2019) This is a great article! I love his description of Forth as "a weird backwards lisp with no parentheses". https://blog.information-superhighway.net/what-the-hell-is-f... Reading the source code of "WAForth" (Forth for WebAssembly) really helped me learn about how WebAssembly works deep down, from the ground up. It demonstrates the first step of what the article says about bootstrapping a Forth system, and it has some beautiful hand written WebAssembly code implementing the primitives and even the compiler and JavaScript interop plumbing. We discussed the possibility of developing a metacompiler in the reddit discussion. I posted this stuff about WAForth and a link to a reddit discussion with its author in the hn discussion of "Ten influential programming languages (2020)": https://news.ycombinator.com/item?id=34056735 Yes, I agree FORTH should be probably be on the list, at least if the list was a few languages longer, for as influential as it's been. WAForth for WebAssembly is beautiful and modern! https://github.com/remko/waforth It's a lovingly crafted and hand written in well commented WebAssembly code, using Racket as a WebAssembly macro pre-processor. I learned so much about WebAssembly by reading this and the supporting JavaScript plumbing. The amazing thing is that the FORTH compiler dynamically compiles FORTH words into WebAssembly byte codes, and creates lots of tiny little WebAssembly modules dynamically that can call each other, by calling back to JavaScript to dynamically create and link modules, which it links together in the same memory and symbol address space on the fly! A real eye opener to me that it was possible to do that kind of stuff with dynamically generated WebAssembly code! It has many exciting and useful applications in other languages than FORTH, too. Lots more discussion and links in the reddit article. But here's the beef, jump right in: https://github.com/remko/waforth/blob/master/src/waforth.wat Reddit /r/Forth discussion of WAForth: https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb... remko: Author here If you can't be bothered to install VS Code, you can have a look at a standalone version of the example notebook (in a 26kB self-contained page). And if you're planning to go to FOSDEM 2023, come say hi: I'll be giving a talk there on WebAssembly and Forth in the Declarative and Minimalistic Computing devroom. DonHopkins: I really love your tour-de-force design and implementation of WAForth, and I have learned a lot about WebAssembly by reading it. Never before have I seen such beautiful meticulously hand written and commented WebAssembly code. Especially the compiler and runtime plumbing you've implemented that dynamically assembles bytecode and creates WebAssembly modules for every FORTH word definition, by calling back to JavaScript code that pulls the binary bytecode of compiled FORTH words out of memory and creates a new module with it pointing to the same function table and memory. WebAssembly is a well designed open standard that's taking over the world in a good way, and it also runs efficiently not just in most browsers and mobile smartphones and pads, but also on the desktop, servers, cloud edge nodes, and embedded devices. And those are perfect target environments for FORTH! What you've done with FORTH and WebAssembly is original, brilliant, audacious, and eye-opening! I'd read the WebAssembly spec before, and used and studied the Unity3D WebAssembly runtime and compiler to integrate Unity3D with JavaScript, and I also studied the AssemblyScript subset of TypeScript targeting WebAssembly and its runtime, and also Aaron Turner's awesome wasmboy WebAssembly GameBoy emulator . I first saw your project a few years ago and linked to it in this Hacker News discussion about Thoughts on Forth Programming because I thought it was cool, but it's come a long way in three years, and I'm glad I finally took the time to read some of your code, which was well worth the investment of time. Until reading your code, I didn't grasp that it was possible to integrate WebAssembly with JavaScript like that, and use it to dynamically generate code the way you have! Also, the way you used Racket as a macro assembler for WebAssembly was a practical and beautiful solution to the difficult problem of writing maintainable WebAssembly code by hand. Even for people not planning on using FORTH, WAForth is an enlightening and useful example for learning about WebAssembly and its runtime, and a solid proof of concept that it's possible to dynamically generate and run WebAssembly code on the fly, and integrate a whole bunch of tiny little WebAssembly modules together. Playing with and reading through your well commented code has really helped me understand WebAssembly and TypeScript and the surface between them at a much deeper level. Thank you for implementing and sharing it, and continuing to improve it too! remco: Wow, thanks a lot, I really appreciate that! It makes me very happy that I was able to get someone to learn something about WebAssembly by reading the source code, which is exactly what I was going for. [More links and discussion of WAForth, WebAssembly, and Forth Metacompilers:] https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb... Here's the author's blog post about WAForth: A Dynamic Forth Compiler for WebAssembly https://el-tramo.be/blog/waforth/ https://news.ycombinator.com/item?id=34374057 DonHopkins on Jan 13, 2023 | parent | context | favorite | on: What the hell is Forth? (2019) This is a great article! I love his description of Forth as "a weird backwards lisp with no parentheses". Reading the source code of "WAForth" (Forth for WebAssembly) really helped me learn about how WebAssembly works deep down, from the ground up. It demonstrates the first step of what the article says about bootstrapping a Forth system, and it has some beautiful hand written WebAssembly code implementing the primitives and even the compiler and JavaScript interop plumbing. We discussed the possibility of developing a metacompiler in the reddit discussion. I posted this stuff about WAForth and a link to a reddit discussion with its author in the hn discussion of "Ten influential programming languages (2020)": https://news.ycombinator.com/item?id=34056735 Yes, I agree FORTH should be probably be on the list, at least if the list was a few languages longer, for as influential as it's been. WAForth for WebAssembly is beautiful and modern! https://github.com/remko/waforth It's a lovingly crafted and hand written in well commented WebAssembly code, using Racket as a WebAssembly macro pre-processor. I learned so much about WebAssembly by reading this and the supporting JavaScript plumbing. The amazing thing is that the FORTH compiler dynamically compiles FORTH words into WebAssembly byte codes, and creates lots of tiny little WebAssembly modules dynamically that can call each other, by calling back to JavaScript to dynamically create and link modules, which it links together in the same memory and symbol address space on the fly! A real eye opener to me that it was possible to do that kind of stuff with dynamically generated WebAssembly code! It has many exciting and useful applications in other languages than FORTH, too. Lots more discussion and links in the reddit article. But here's the beef, jump right in: https://github.com/remko/waforth/blob/master/src/waforth.wat Reddit /r/Forth discussion of WAForth: https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb... remko: Author here If you can't be bothered to install VS Code, you can have a look at a standalone version of the example notebook (in a 26kB self-contained page). And if you're planning to go to FOSDEM 2023, come say hi: I'll be giving a talk there on WebAssembly and Forth in the Declarative and Minimalistic Computing devroom. DonHopkins: I really love your tour-de-force design and implementation of WAForth, and I have learned a lot about WebAssembly by reading it. Never before have I seen such beautiful meticulously hand written and commented WebAssembly code. Especially the compiler and runtime plumbing you've implemented that dynamically assembles bytecode and creates WebAssembly modules for every FORTH word definition, by calling back to JavaScript code that pulls the binary bytecode of compiled FORTH words out of memory and creates a new module with it pointing to the same function table and memory. WebAssembly is a well designed open standard that's taking over the world in a good way, and it also runs efficiently not just in most browsers and mobile smartphones and pads, but also on the desktop, servers, cloud edge nodes, and embedded devices. And those are perfect target environments for FORTH! What you've done with FORTH and WebAssembly is original, brilliant, audacious, and eye-opening! I'd read the WebAssembly spec before, and used and studied the Unity3D WebAssembly runtime and compiler to integrate Unity3D with JavaScript, and I also studied the AssemblyScript subset of TypeScript targeting WebAssembly and its runtime, and also Aaron Turner's awesome wasmboy WebAssembly GameBoy emulator . I first saw your project a few years ago and linked to it in this Hacker News discussion about Thoughts on Forth Programming because I thought it was cool, but it's come a long way in three years, and I'm glad I finally took the time to read some of your code, which was well worth the investment of time. Until reading your code, I didn't grasp that it was possible to integrate WebAssembly with JavaScript like that, and use it to dynamically generate code the way you have! Also, the way you used Racket as a macro assembler for WebAssembly was a practical and beautiful solution to the difficult problem of writing maintainable WebAssembly code by hand. Even for people not planning on using FORTH, WAForth is an enlightening and useful example for learning about WebAssembly and its runtime, and a solid proof of concept that it's possible to dynamically generate and run WebAssembly code on the fly, and integrate a whole bunch of tiny little WebAssembly modules together. Playing with and reading through your well commented code has really helped me understand WebAssembly and TypeScript and the surface between them at a much deeper level. Thank you for implementing and sharing it, and continuing to improve it too! remco: Wow, thanks a lot, I really appreciate that! It makes me very happy that I was able to get someone to learn something about WebAssembly by reading the source code, which is exactly what I was going for. [More links and discussion of WAForth, WebAssembly, and Forth Metacompilers:] https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb...
In Web Embeddable Common Lisp
DonHopkins·Feb 8, 2024Recommendation phrase
https://news.ycombinator.com/item?id=34374057 DonHopkins on Jan 13, 2023 | parent | context | favorite | on: What the hell is Forth? (2019) This is a great article! I love his description of Forth as "a weird backwards lisp with no parentheses". Reading the source code of "WAForth" (Forth for WebAssembly) really helped me learn about how WebAssembly works deep down, from the ground up. It demonstrates the first step of what the article says about bootstrapping a Forth system, and it has some beautiful hand written WebAssembly code implementing the primitives and even the compiler and JavaScript interop plumbing. We discussed the possibility of developing a metacompiler in the reddit discussion. I posted this stuff about WAForth and a link to a reddit discussion with its author in the hn discussion of "Ten influential programming languages
Read the rest
(2020)": https://news.ycombinator.com/item?id=34056735 Yes, I agree FORTH should be probably be on the list, at least if the list was a few languages longer, for as influential as it's been. WAForth for WebAssembly is beautiful and modern! https://github.com/remko/waforth It's a lovingly crafted and hand written in well commented WebAssembly code, using Racket as a WebAssembly macro pre-processor. I learned so much about WebAssembly by reading this and the supporting JavaScript plumbing. The amazing thing is that the FORTH compiler dynamically compiles FORTH words into WebAssembly byte codes, and creates lots of tiny little WebAssembly modules dynamically that can call each other, by calling back to JavaScript to dynamically create and link modules, which it links together in the same memory and symbol address space on the fly! A real eye opener to me that it was possible to do that kind of stuff with dynamically generated WebAssembly code! It has many exciting and useful applications in other languages than FORTH, too. Lots more discussion and links in the reddit article. But here's the beef, jump right in: https://github.com/remko/waforth/blob/master/src/waforth.wat Reddit /r/Forth discussion of WAForth: https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb... remko: Author here If you can't be bothered to install VS Code, you can have a look at a standalone version of the example notebook (in a 26kB self-contained page). And if you're planning to go to FOSDEM 2023, come say hi: I'll be giving a talk there on WebAssembly and Forth in the Declarative and Minimalistic Computing devroom. DonHopkins: I really love your tour-de-force design and implementation of WAForth, and I have learned a lot about WebAssembly by reading it. Never before have I seen such beautiful meticulously hand written and commented WebAssembly code. Especially the compiler and runtime plumbing you've implemented that dynamically assembles bytecode and creates WebAssembly modules for every FORTH word definition, by calling back to JavaScript code that pulls the binary bytecode of compiled FORTH words out of memory and creates a new module with it pointing to the same function table and memory. WebAssembly is a well designed open standard that's taking over the world in a good way, and it also runs efficiently not just in most browsers and mobile smartphones and pads, but also on the desktop, servers, cloud edge nodes, and embedded devices. And those are perfect target environments for FORTH! What you've done with FORTH and WebAssembly is original, brilliant, audacious, and eye-opening! I'd read the WebAssembly spec before, and used and studied the Unity3D WebAssembly runtime and compiler to integrate Unity3D with JavaScript, and I also studied the AssemblyScript subset of TypeScript targeting WebAssembly and its runtime, and also Aaron Turner's awesome wasmboy WebAssembly GameBoy emulator . I first saw your project a few years ago and linked to it in this Hacker News discussion about Thoughts on Forth Programming because I thought it was cool, but it's come a long way in three years, and I'm glad I finally took the time to read some of your code, which was well worth the investment of time. Until reading your code, I didn't grasp that it was possible to integrate WebAssembly with JavaScript like that, and use it to dynamically generate code the way you have! Also, the way you used Racket as a macro assembler for WebAssembly was a practical and beautiful solution to the difficult problem of writing maintainable WebAssembly code by hand. Even for people not planning on using FORTH, WAForth is an enlightening and useful example for learning about WebAssembly and its runtime, and a solid proof of concept that it's possible to dynamically generate and run WebAssembly code on the fly, and integrate a whole bunch of tiny little WebAssembly modules together. Playing with and reading through your well commented code has really helped me understand WebAssembly and TypeScript and the surface between them at a much deeper level. Thank you for implementing and sharing it, and continuing to improve it too! remco: Wow, thanks a lot, I really appreciate that! It makes me very happy that I was able to get someone to learn something about WebAssembly by reading the source code, which is exactly what I was going for. [More links and discussion of WAForth, WebAssembly, and Forth Metacompilers:] https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb... Here's the author's blog post about WAForth: A Dynamic Forth Compiler for WebAssembly https://el-tramo.be/blog/waforth/
In Thinking Forth: A Language and Philosophy for Solving Problems (2004) [pdf]
DonHopkins·Aug 6, 2023Recommendation phrase
Here's some ideas about WASM forth I wrote about previously: https://news.ycombinator.com/item?id=34374057 >This is a great article! I love his description of Forth as "a weird backwards lisp with no parentheses". >Reading the source code of "WAForth" (Forth for WebAssembly) really helped me learn about how WebAssembly works deep down, from the ground up. >It demonstrates the first step of what the article says about bootstrapping a Forth system, and it has some beautiful hand written WebAssembly code implementing the primitives and even the compiler and JavaScript interop plumbing. We discussed the possibility of developing a metacompiler in the reddit discussion. [...] Check out this beautiful hand written wasm code, a dynamic wasm based Forth compiler: https://github.com/remko/waforth/blob/master/src/waforth.wat It compiles new Forth w
Read the rest
ords into teenie tiny little wasm modules, and hooks out through JavaScript in the browser to create and link them in to the main module, so it can call the code it just compiled. Wasm doesn't let you modify compiled code, but you can compile new code and link it in and execute it!
In My history with Forth and stack machines (2010)
DonHopkins·Jan 13, 2023Recommendation phrase
This is a great article! I love his description of Forth as "a weird backwards lisp with no parentheses". Reading the source code of "WAForth" (Forth for WebAssembly) really helped me learn about how WebAssembly works deep down, from the ground up. It demonstrates the first step of what the article says about bootstrapping a Forth system, and it has some beautiful hand written WebAssembly code implementing the primitives and even the compiler and JavaScript interop plumbing. We discussed the possibility of developing a metacompiler in the reddit discussion. I posted this stuff about WAForth and a link to a reddit discussion with its author in the hn discussion of "Ten influential programming languages (2020)": https://news.ycombinator.com/item?id=34056735 Yes, I agree FORTH should be probably be on the list, at least if the list was a few
Read the rest
languages longer, for as influential as it's been. WAForth for WebAssembly is beautiful and modern! https://github.com/remko/waforth It's a lovingly crafted and hand written in well commented WebAssembly code, using Racket as a WebAssembly macro pre-processor. I learned so much about WebAssembly by reading this and the supporting JavaScript plumbing. The amazing thing is that the FORTH compiler dynamically compiles FORTH words into WebAssembly byte codes, and creates lots of tiny little WebAssembly modules dynamically that can call each other, by calling back to JavaScript to dynamically create and link modules, which it links together in the same memory and symbol address space on the fly! A real eye opener to me that it was possible to do that kind of stuff with dynamically generated WebAssembly code! It has many exciting and useful applications in other languages than FORTH, too. Lots more discussion and links in the reddit article. But here's the beef, jump right in: https://github.com/remko/waforth/blob/master/src/waforth.wat Reddit /r/Forth discussion of WAForth: https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb... remko: Author here If you can't be bothered to install VS Code, you can have a look at a standalone version of the example notebook (in a 26kB self-contained page). And if you're planning to go to FOSDEM 2023, come say hi: I'll be giving a talk there on WebAssembly and Forth in the Declarative and Minimalistic Computing devroom. DonHopkins: I really love your tour-de-force design and implementation of WAForth, and I have learned a lot about WebAssembly by reading it. Never before have I seen such beautiful meticulously hand written and commented WebAssembly code. Especially the compiler and runtime plumbing you've implemented that dynamically assembles bytecode and creates WebAssembly modules for every FORTH word definition, by calling back to JavaScript code that pulls the binary bytecode of compiled FORTH words out of memory and creates a new module with it pointing to the same function table and memory. WebAssembly is a well designed open standard that's taking over the world in a good way, and it also runs efficiently not just in most browsers and mobile smartphones and pads, but also on the desktop, servers, cloud edge nodes, and embedded devices. And those are perfect target environments for FORTH! What you've done with FORTH and WebAssembly is original, brilliant, audacious, and eye-opening! I'd read the WebAssembly spec before, and used and studied the Unity3D WebAssembly runtime and compiler to integrate Unity3D with JavaScript, and I also studied the AssemblyScript subset of TypeScript targeting WebAssembly and its runtime, and also Aaron Turner's awesome wasmboy WebAssembly GameBoy emulator . I first saw your project a few years ago and linked to it in this Hacker News discussion about Thoughts on Forth Programming because I thought it was cool, but it's come a long way in three years, and I'm glad I finally took the time to read some of your code, which was well worth the investment of time. Until reading your code, I didn't grasp that it was possible to integrate WebAssembly with JavaScript like that, and use it to dynamically generate code the way you have! Also, the way you used Racket as a macro assembler for WebAssembly was a practical and beautiful solution to the difficult problem of writing maintainable WebAssembly code by hand. Even for people not planning on using FORTH, WAForth is an enlightening and useful example for learning about WebAssembly and its runtime, and a solid proof of concept that it's possible to dynamically generate and run WebAssembly code on the fly, and integrate a whole bunch of tiny little WebAssembly modules together. Playing with and reading through your well commented code has really helped me understand WebAssembly and TypeScript and the surface between them at a much deeper level. Thank you for implementing and sharing it, and continuing to improve it too! remco: Wow, thanks a lot, I really appreciate that! It makes me very happy that I was able to get someone to learn something about WebAssembly by reading the source code, which is exactly what I was going for. [More links and discussion of WAForth, WebAssembly, and Forth Metacompilers:] https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb...
In What the hell is Forth? (2019)
DonHopkins·Dec 19, 2022Recommendation phrase
Yes, I agree FORTH should be probably be on the list, at least if the list was a few languages longer, for as influential as it's been. WAForth for WebAssembly is beautiful and modern! https://github.com/remko/waforth It's a lovingly crafted and hand written in well commented WebAssembly code, using Racket as a WebAssembly macro pre-processor. I learned so much about WebAssembly by reading this and the supporting JavaScript plumbing. The amazing thing is that the FORTH compiler dynamically compiles FORTH words into WebAssembly byte codes, and creates lots of tiny little WebAssembly modules dynamically that can call each other, by calling back to JavaScript to dynamically create and link modules, which it links together in the same memory and symbol address space on the fly! A real eye opener to me that it was possible to do that kind of s
Read the rest
tuff with dynamically generated WebAssembly code! It has many exciting and useful applications in other languages than FORTH, too. Lots more discussion and links in the reddit article. But here's the beef, jump right in: https://github.com/remko/waforth/blob/master/src/waforth.wat Reddit /r/Forth discussion of WAForth: https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb... remko: Author here If you can't be bothered to install VS Code, you can have a look at a standalone version of the example notebook (in a 26kB self-contained page). And if you're planning to go to FOSDEM 2023, come say hi: I'll be giving a talk there on WebAssembly and Forth in the Declarative and Minimalistic Computing devroom. DonHopkins: I really love your tour-de-force design and implementation of WAForth, and I have learned a lot about WebAssembly by reading it. Never before have I seen such beautiful meticulously hand written and commented WebAssembly code. Especially the compiler and runtime plumbing you've implemented that dynamically assembles bytecode and creates WebAssembly modules for every FORTH word definition, by calling back to JavaScript code that pulls the binary bytecode of compiled FORTH words out of memory and creates a new module with it pointing to the same function table and memory. WebAssembly is a well designed open standard that's taking over the world in a good way, and it also runs efficiently not just in most browsers and mobile smartphones and pads, but also on the desktop, servers, cloud edge nodes, and embedded devices. And those are perfect target environments for FORTH! What you've done with FORTH and WebAssembly is original, brilliant, audacious, and eye-opening! I'd read the WebAssembly spec before, and used and studied the Unity3D WebAssembly runtime and compiler to integrate Unity3D with JavaScript, and I also studied the AssemblyScript subset of TypeScript targeting WebAssembly and its runtime, and also Aaron Turner's awesome wasmboy WebAssembly GameBoy emulator . I first saw your project a few years ago and linked to it in this Hacker News discussion about Thoughts on Forth Programming because I thought it was cool, but it's come a long way in three years, and I'm glad I finally took the time to read some of your code, which was well worth the investment of time. Until reading your code, I didn't grasp that it was possible to integrate WebAssembly with JavaScript like that, and use it to dynamically generate code the way you have! Also, the way you used Racket as a macro assembler for WebAssembly was a practical and beautiful solution to the difficult problem of writing maintainable WebAssembly code by hand. Even for people not planning on using FORTH, WAForth is an enlightening and useful example for learning about WebAssembly and its runtime, and a solid proof of concept that it's possible to dynamically generate and run WebAssembly code on the fly, and integrate a whole bunch of tiny little WebAssembly modules together. Playing with and reading through your well commented code has really helped me understand WebAssembly and TypeScript and the surface between them at a much deeper level. Thank you for implementing and sharing it, and continuing to improve it too! remco: Wow, thanks a lot, I really appreciate that! It makes me very happy that I was able to get someone to learn something about WebAssembly by reading the source code, which is exactly what I was going for. [More links and discussion of WAForth, WebAssembly, and Forth Metacompilers:] https://www.reddit.com/r/Forth/comments/zmb4eb/waforth_wasmb...
In Ten influential programming languages (2020)

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.