Forth. You either love it or you hate it. If you have struggled to work on tiny microcontrollers, you probably are in the first camp. After all, bringing up a minimal Forth system is pretty simple and requires very little resources on the CPU. Once you have such an environment it is then easy to extend Forth in Forth. [Remko] decided he wanted to build a Forth compiler that uses WebAssembly and runs in your browser. Why? We’ve learned not to think about that question too much.
16 thoughts on “Web Pages Via Forth”
Am I correct in thinking that Waforth is the Wario version of Forth?
There are so many plugin compiled languages for a browser now.
There are also some interpreters and VMs as well.
LUA is a little like Lisp in some regards as even the data structures can first class. That is a function can be data and data can be a function.
LUA has a lot of nice surprises about what you “can do” as opposed to other languages that have nasty surprises about what you “can’t do”.
Taking time out of my busy day to respond to this because I’ve seen dumb shit before, but this just leveled it all.
That depends on who you talk to.
I can’t comment on Java today as I haven’t used it for a long time but the most common complaint I hear about Java can be summarized by the following pseudocode –
Once again, the title is wrong. It’s “Forth via web pages”, not the other way around.
It’s in RPN: WEB_PAGES VIA FORTH => FORTH VIA WEB_PAGES when popped from the stack
FORTH WEB_PAGES VIA
it be should.
You think not do?
Hey now, these are stack elements (for some reason), not words
Wow, the WASM forth is only 58K transfer (155K). The js forth version referenced above is 10-20X the size (508K/2110K).
Forth is my fourth choice generally but I go back and forth sometimes.
why not using web from postscript (meybe printer?)
Hi Folks. Reading about Forth is certainly a trip backwards to younger and finer days. I started learning Forth on a IIgs then a //c and finally a ][+ then and finally on a monochrome PC. Heady days certainly, DOS, CP/M, USCD Pascal on one PC! It was just too much for a high school kid to absorb in one day, so I spent the rest of my years doing so. Forth, Cobol, RPG, asm’s, Forth, Pascal, and so many others of all subjects, machines, opsyses,hardware. Finally Linux.
I learned how to think analytically from Charles, Albert, Niklaus, and so many other men who were the luminaries of though and programming in those days.
Forth was my first true love in any language, written or spoken. It was small, fast, light, portable, and simply confoundingly complex.
I didn’t truly begin to comprehend it until I began to try to write my own Forth engine. I preferred indirect threading in 32bits on Linux using Fasm. Took more than a few interations to figer out the cause of the faulting, but I did. It was a mental coup for me.
Then I found Lisp. Hated the parens, but after learning it too, I discovered more similarities between the two languages than differences. So much as to be able to easily port concepts and functions! That was fun… Cons, car, and cdr in forth certainly did simplify alot of code. Actually made Factoring easier in Forth! Designing words too became easier, and allowed more flexibility in the headers too.
My 32bit, x86 code had separated code and data segs, as any normal ELF object. All code addresses were stored in dataseg pointer vars, just as in C, and reg swapping ESP and EBP didn’t cause any problems at all.
After a few simple words were coded in asm, I began writing the high level ones that were easy, then assembling, until I had a decent incomplete dictionary.
Connecting to studio needed a little pondering because I didn’t want to use the libs/. Eventually, I did figer that out too.
And so it went Wirth’s successive refinement, and Liberal incrementalism! LoL.
It’s been some years, but I was quite fond of saying back then that I have forgotten more knowledge from more subjects than most people learn in one lifetime. It’s still true, more so now. Swiss cheese ram.
Stay well and remember that Simple is always good. flexible code is always better so that User can do what you don’t expect them to do. They will do the unexpected with code that Coders write.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)