3 ms·
Show HN: R3forth, a ColorForth-inspired language with a tiny VM
- 13415 8mo agoVery interesting, great work! This reminded me of something. I just checked and to my amazement Mike Hore's Powermops is still around and even has an ARM version.[1] [1] https://www.powermops.org https://www.powermops.org
- jhbadger 8mo agoYes, that's neat -- it is basically a modern Neon, which was an object-oriented Forth for the Mac in the 1980s.
- alexisread 8mo agoVery impressive demos! I did a quick look through the docs- it’s single threaded (in the cpu sense) and not multi process yes?
- phreda4 8mo agonot for now, just launch many instances!
- thristian 8mo agoIn the first code example in the readme ("First program"), there's `sdlcls`, `SDLinit`, and `SDLShow`. Is there some significance to the capitalisation?
- ripe 8mo agoVery nice graphics using SDL2! So many features-- sprite sheets, etc. Well done!
- watersb 8mo agoForth invented as a monitor and control system for one of the radio telescopes at NRAO in West Virginia... So I have a tribal affinity for Color Forth, by original creator of Forth.
- larsbrinkhoff 8mo agoForth was invented before Moore worked at NRAO. Granted, it was gradually expanded from a very small interpreter, so it's hard to say exactly when it became "Forth" as we mean it today.
- larsbrinkhoff 8mo agoSource: "The Invention of Forth", by Chuck Moore. https://colorforth.github.io/HOPL.html https://colorforth.github.io/HOPL.html
- astrobe_ 8mo agoForth should be considered a family of languages; Anton Ertl took its picture some time ago [1]. Chuck Moore agrees I think with the idea [2]: That raises the question of what is Forth? I have hoped for some time that someone would tell me what it was. I keep asking that question. What is Forth? Forth is highly factored code. I don't know anything else to say except that Forth is definitions. If you have a lot of small definitions you are writing Forth. In order to write a lot of small definitions you have to have a stack. Stacks are not popular. Its strange to me that they are not. [...] What is a definition? Well classically a definition was colon something, and words, and end of definition somewhere. : some ~~~ ; I always tried to explain this in the sense of this is an abbreviation, whatever this string of words you have here that you use frequently you have here you give it a name and you can use it more conveniently. But its not exactly an abbreviation because it can have a parameter perhaps or two. And that is a problem with programmers, perhaps a problem with all programmers; too many input parameters to a routine. Look at some 'C' programs and it gets ludicrous. Everything in the program is passed through the calling sequence and that is dumb. [1] https://www.complang.tuwien.ac.at/anton/euroforth/ef04/ertl04.pdf https://www.complang.tuwien.ac.at/anton/euroforth/ef04/ertl0... [2] https://www.ultratechnology.com/1xforth.htm https://www.ultratechnology.com/1xforth.htm
- anotherlab 8mo agoBack in the VIC-20 days, I had the VIC Forth (https://ia800304.us.archive.org/34/items/VIC_Forth_1982_HES/VIC_Forth_1982_HES.pdf https://ia800304.us.archive.org/34/items/VIC_Forth_1982_HES/... and https://photobubba.com/wp-content/uploads/2016/06/an-interview-with-tom-zimmer.pdf https://photobubba.com/wp-content/uploads/2016/06/an-intervi...) cartridge and the book Starting Forth (https://www.forth.com/starting-forth/ https://www.forth.com/starting-forth/). It was my second programming language, after BASIC. Like everything else, it was easy do simple things, much harder to do anything else. My brain also rejected doing stuff with postfix notation. It always fun trying to explain Forth to developers used to higher level languages. It always came down to "a word is like a function, but not really"
- phreda4 8mo agoWord is an internal call, it's a function, but the key is that the parameters and local variables are on the data stack and are separate from the return stack. I can call many levels without touching the data stack! Impossible in other languages. However, this does require practice and a change of mindset. At runtime, the dictionary doesn't exist, and under certain conditions and with the correct compiler, the stack doesn't either; it's converted into registers.