10 ms·
I believe that any programmer should at least know a little about Forth. It's like Lisp. Just knowing about them is extremely enlightening, even if you don't us
by amalgamated_inc 4y ago
I believe that any programmer should at least know a little about Forth. It's like Lisp. Just knowing about them is extremely enlightening, even if you don't use them in your daily life.
Obligatory link:
https://github.com/nornagon/jonesforth/blob/master/jonesforth.S https://github.com/nornagon/jonesforth/blob/master/jonesfort...
This well-written tutorial will have you implement a Forth in 500 lines of assembly and another 500 lines of Forth.
You will feel like a different person after having done this. People will like you more. Food will taste better. You'll never be alone again, always knowing that you can re-create a fully-functional programming language from assembly within half an hour, if you needed to. It is said that people who know Forth die happy.
- seanw444 4y agoI've also heard it cures cancer. Any truth to this?
- amalgamated_inc 4y agoResults not in yet but it looks promising, yes.
- agumonkey 4y agoIt can alleviate the symptoms of javadenomas
- shrubble 4y agoThe percentage of people with cancer who are Forth users is very low. Take that as you wish...
- vram22 4y agoCHECK FACTH FIRTH YOUR
- vram22 4y agoDid you mean: THIS TRUTH ANY TO?
- jll29 4y agoAgree with the parent, it's a language worth knowing like LISP is worth knowing, but (unlike LISP) it is not a good language choice for almost all use cases in 2023 (almost all use cases are not that memory constrained any more, even embedded systems), for the same reason you shouldn't use Perl (it is very hard to read code). I was going to say "its main disadvantage is that the only way to find out what a piece of code does is to execute it mentally" (non-declarative) but one may say that of every language to an extent. Instead I will say it feels like using a macro-assembler for a stack VM. Clifford Stoll, author of "The Cuckoo's Egg", in which he described how he chased a hacker, allegedly used FORTH to control a radio telescope (https://www.amazon.co.uk/gp/product/1416507787 https://www.amazon.co.uk/gp/product/1416507787) back in the days (not sure, I might have got this nugget from the book).
- pkaye 4y agoThe original use for FORTH was to control radio telescopes.
- macintux 4y agoI was delighted (and saddened) when I discovered a Forth manual written by W. Richard Stevens for Kitt Peak observatory. A great writer lost far too young.
- slaymaker1907 4y agoI don't know, I think it can be a pretty solid language depending on what variant you use. There are few pieces of code in Forth that make me think "man, this seems repetitive, but I don't know how to actually generalize this" because abstraction is little more than structured copy+paste.
- avmich 4y ago> abstraction is little more than structured copy+paste Which perhaps is logical, since Forth is a concatenative language. Roughly, one can split a program in half at any point and get two subprograms which can be called one after the other - in the same order - to get the same result. Like, to calculate 2 + 3 * 4 one would write 2 3 4 * + in Forth, this sequence can be split in two 6 different ways, and we can even meaningfully interpret those two parts each time. E.g. part 4 * + is a two-argument function which multiplies first (closest to the top in the stack) by 4 and sums the result with the other argument - in JavaScript it would be function(x, y) { return 4*x+y; }.
- amatic 4y agoI couldn't get jonesforth to compile correctly. Not sure why. I found a python and a javascript implementation, not sure if I like them. Any recommendations?
- amalgamated_inc 4y agoI made tons of typos in both the assembly and Forth part when I did mine, but it did end up compiling correctly. Hunting the typos down was hard though because you get literally 0 feedback.
- anyfoo 4y agoDo you maybe want to tell us how exactly "not compile correctly" manifested?
- gerdesj 4y agoA million errr 40 odd (my back is dim etc) years ago the end of year stuff (open day etc) was fast approaching. Our science teacher asked a few chaps (all boys prep school - Devon, UK) to have a go at showing off this computing thing or something, oh and I have this Forth thing on tape and this: ZX Spectrum. We'd graduated from ZX80s and 81s. We had 20 brand new Speccies newly bought. The Promised Land beckoned. We cobbled together text whizzing smoothly across the screen and changing colours within about 20 mins of loading the thing. Loading from tape took a good five minutes. Unlike the C64 and Vic20 the Speccy used consumer tape units. I have absolutely no idea what you are on about with your big boy modern programming terms but I managed to convince quite a few parents that their sprogs were at the cutting edge or at least wasting time well, back in the day!
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- sramsay 4y ago> It's like Lisp. Just knowing about them is extremely enlightening . . . I agree. My introduction to Lisp was Seibold's Practical Common Lisp -- a very hot book back in the mid-to-late aughties, that I suspect introduced a lot of people to Lisp. Forth feels like it's having a similar moment (by which I simply mean: a lot of people are talking about it in terms of enlightenment, not that it's going to replace JavaScript!). So I wonder. Think someone will write a Practical Forth?