| ▲ | veltas a day ago |
| I really love Forth and spend almost all my free programming time playing with it and I'd never teach it to a class of kids. |
|
| ▲ | ndiddy a day ago | parent | next [-] |
| Yeah Forth doesn't seem very good as a teaching language. Maybe the "first lesson" part where you're just showing how you can build a toy program from simple words would go well, but any nontrivial project where you have to start incorporating DUP and OVER and ROT and PICK and friends seems like a nightmare to teach to anyone who hasn't programmed before. |
| |
| ▲ | HelloNurse 16 hours ago | parent [-] | | > start incorporating DUP and OVER and ROT and PICK and friends If one understands adding and consuming values at the top of the stack, putting the stack in the state you want it is certainly a small logical step without new theoretical baggage. Word definitions and the accompanying pointer tricks are more likely to be challenging. | | |
| ▲ | ndiddy 8 hours ago | parent [-] | | The stack is functionally very simple, but keeping a mental model of what exactly is on it at each point in your code and how to transform it to perform the calculations you need can be tricky. |
|
|
|
| ▲ | a day ago | parent | prev | next [-] |
| [deleted] |
|
| ▲ | rbanffy a day ago | parent | prev | next [-] |
| My kid was curious about my HP-35 and I taught them how it works. They got it in no time and I made it an exercise to rewrite math expressions in RPN. Not sure they are that interested in programming, but FORTH is a little sweet language. My first experience with it was Paul Lutus’ GraFORTH. On the Apple II it was ridiculously fast. |
| |
| ▲ | JSR_FDED a day ago | parent | next [-] | | Well that’s next weekend sorted, thanks! | |
| ▲ | fuzztester a day ago | parent | prev [-] | | lutus also created arachnophilia and sailed or is sailing around the world. n coined the term careware. iirc. first-hand info. i had downloaded n used arachnophilia. he is on hn. | | |
|
|
| ▲ | noosphr a day ago | parent | prev | next [-] |
| Kids need an antidote to the brain damage that is standard mathematical notation. I prefer lisps variadic prefix notation, but if you're just doing fixed arity functions without higher order functions than prefix and post fix are as good as each other, and you don't have the dreaded sea of parenthesis. |
| |
| ▲ | pitchlatte a day ago | parent [-] | | what aspect of school level “mathematical notation” is so bad as to be brain damage inducing? | | |
| ▲ | cultofmetatron 19 hours ago | parent [-] | | probably the arbitrariness of it. PEMDAS is more or less burned into my brain at this point but its basically the qwerty of notations. | | |
| ▲ | pitchlatte 19 hours ago | parent [-] | | that’s not even notation though, that’s a rubric for the order of operations. | | |
| ▲ | lioeters 19 hours ago | parent [-] | | The need to remember operator precedence is a consequence of the infix notation syntax. | | |
| ▲ | antonvs 18 hours ago | parent [-] | | It’s a tradeoff against lots of irritating silly parentheses. | | |
| ▲ | Someone 17 hours ago | parent | next [-] | | Postfix doesn’t need parentheses. Prefix technically doesn’t need, either, if you avoid functions taking variable number of arguments and have a grammar that can reliably detect function calls (could be hard if you’re allowing higher-order functions) Even with functions taking a variable number of arguments, you could do it the C way and use the argc, argv trick, giving you * 2 + 3 5 6 7 3 ⇒ (* (+ 5 6 7) 3) ⇒ 54
I think you’d have to be a bit of a masochist to do that, though.That also is why I think varargs functions tend to be rare in bare bones forths. You’d have to write 5 6 7 3 + 3 2 *
Using custom names for the varargs functions would help for the 2-argument version. | |
| ▲ | lioeters 18 hours ago | parent | prev [-] | | Hence Forth. | | |
|
|
|
|
|
|
|
| ▲ | songhonglei1985 a day ago | parent | prev [-] |
| [flagged] |