News for hackers. Stuff that matters.
Re:What the hell is Forth? (2019) by slaymaker1907 on Friday January 13, 2023 @04:34PM (#34374196)
I 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.
Re:What the hell is Forth? (2019) by avmich on Friday January 13, 2023 @05:48PM (#34374981)
> 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; }.