3 ms·
I didn't really understand forth till I tried implementing eforth in c. https://github.com/tehologist/forthkit https://github.com/tehologist/forthkit Managed
by tehologist 4y ago
I didn't really understand forth till I tried implementing eforth in c.
https://github.com/tehologist/forthkit https://github.com/tehologist/forthkit
Managed to write a compiler/interpreter that could understand enough forth to implement the entire system. Less than 500 lines and only uses stdio.h and compiles using TCC
https://bellard.org/tcc/ https://bellard.org/tcc/
That was so much fun I built a second one in under 300 lines of javascript for experimenting with canvas api in web browser. Single file doesn't require a server, you can drag and drop code onto text window.
https://github.com/tehologist/ecma6-forth https://github.com/tehologist/ecma6-forth
Runs standalone, I want to get back to it again.
- thejvexperience 4y agoAlong similar lines, i once watched this guy on YouTube implement a Python-based Forth _compiler_ (not interpreter) and optimize the crap out of it. It was a great video, if anyone’s interested it was called “Porth” and i think his GitHub page has a link to the video.
- tehologist 4y agoFound the video you referenced. https://www.youtube.com/watch?v=8QP2fDBIxjM&list=PLpM-Dvs8t0VbMZA7wW9aR3EtBqe2kinu4 https://www.youtube.com/watch?v=8QP2fDBIxjM&list=PLpM-Dvs8t0... I met the creator Charles Moore a few times. When I lived in the bay area and used to go to the svfig (silicon valley forth interest group) meeting. He would often talk about forth was like solving a puzzle, likened it to sudoku. It is a good exercise for the brain and I highly recommend it. https://www.forth.com/starting-forth/ https://www.forth.com/starting-forth/
- no-s 4y agoBack in the eighties I went to a presentation by Moore on VLSI design featuring a GUI design tool he wrote in Forth. The physical user interface was via contacts taped to his fingers and thumb, he would touch them together to navigate the UI. We were very impressed. I still have a tshirt that reads “Be Moore Like Chuck”…
- Karrot_Kream 4y agoI know it's a lot of fun writing Forths and that's how most people tend to experience Forth, but I like to urge people to actually build applications on Forth. Understanding Forth by writing applications is probably the best way to get a feel for Forth.
- anta40 4y agoIs there any "battery-included" ANS Forth (more or less like Python/Go) which provides access to concurrency, networking, database, GUI, etc? Not an embedded device programmer, but mostly deals with frontend apps, and occasionally backend, so those are very relevant to me. Or perhaps use "non-traditional" Forths like 8th (https://8th-dev.com https://8th-dev.com) or Factor (https://factorcode.org https://factorcode.org)?
- Karrot_Kream 4y agogForth is probably the closest you'll get to a batteries-included ANS Forth. It has a lot of libraries and does have some GUI libraries. It definitely has networking and some amount of db words, I'm not sure what it's concurrency situation is like. 8th is a great not-Forth. Highly recommended because of how practical is.
- deleted 4y ago[deleted]