Live data from Hacker News

Teaching Kids Forth

gracefulliberty.com

51–60 of 72 posts

Re: Teaching Kids Forth

#51
Assuming you’re teaching programming and not “coding”, forth is a fantastic language to teach.

First it’s easy to understand. Second, it’s completely unopinionated, and you can take it anywhere you want to. To write a program in forth is to create a domain specific language for solving that problem.

Forth embodies functional as well as procedural programming, is a high level class language (not Assembler) yet also if you understand forth, you will pick up assembler very easily. (Unlike, say, JavaScript)

It sits precisely in the sweet spot of a central set off paradigms that, once understood, form a bridge to every kind of computer programming, as well as to a whole bunch of data abstractions at a low level.

It might even be the -only- language that people who will learn to program using AI would have to learn, as long as they went deep. At that point they could conceptually work with high level descriptions of what they intended for the coding agent to create, without having the underpinnings be completely opaque, regardless of the actual language used.

Re: Teaching Kids Forth

#52
post #42

I used Forth to explain numbers in different radices to my grandson. Being able to interactively try things at the console was really helpful. It also helps to separate the internal number in the machine from how we display it, due to the different operators to print numbers as signed or unsigned. This is something that I have seen young programmers confuse. I think another area where Forth can help young people is i…

Wouldn't something like Python be better for interactivity?

Forth is very good in this regard, because the word names are short and there is no "fluff" around the syntax if you can even call it syntax. Also there is no need to name your data. Literal numbers can be used just as easily even for memory addresses.

However there is no safety net. ;-)

Re: Teaching Kids Forth

#53
post #42

Earlier quoted context omitted.

Wouldn't something like Python be better for interactivity?

Forth is very good in this regard, because the word names are short and there is no "fluff" around the syntax if you can even call it syntax. Also there is no need to name your data. Literal numbers can be used just as easily even for memory addresses. However there is no safety net. ;-)

Aside from shooting yourself in the foot, I don't see anything you've shared that can't be done in python.

Re: Teaching Kids Forth

#54
post #28

> I wanted to avoid teaching syntax. While Python makes sense as pseudocode [...] it is still nearly incomprehensible to new learners [...] I decided I wanted to either teach Forth or Haskell. Sorry but this reads like a joke. If you find python incomprehensible, Forth and Haskell won't even register as languages.

I think that's because Haskell doesn't need to be understood as a language beyond the fact that it works like maths functions.

Procedures are a lot harder to explain the first time to people who work with maths functions, especially if you call procedures functions.

Re: Teaching Kids Forth

#55
post #51

Assuming you’re teaching programming and not “coding”, forth is a fantastic language to teach. First it’s easy to understand. Second, it’s completely unopinionated, and you can take it anywhere you want to. To write a program in forth is to create a domain specific language for solving that problem. Forth embodies functional as well as procedural programming, is a high level class language (not Assembler) yet also if…

yeah kids hate syntax

Re: Teaching Kids Forth

#56
post #21

Earlier quoted context omitted.

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.

> 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.

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.

Re: Teaching Kids Forth

#57
post #51

Assuming you’re teaching programming and not “coding”, forth is a fantastic language to teach. First it’s easy to understand. Second, it’s completely unopinionated, and you can take it anywhere you want to. To write a program in forth is to create a domain specific language for solving that problem. Forth embodies functional as well as procedural programming, is a high level class language (not Assembler) yet also if…

yeah kids hate syntax

lol. Forth is pretty syntax sparse, depending on the implementation. Postfix operators solve a lot of that.

Re: Teaching Kids Forth

#58
post #51

Assuming you’re teaching programming and not “coding”, forth is a fantastic language to teach. First it’s easy to understand. Second, it’s completely unopinionated, and you can take it anywhere you want to. To write a program in forth is to create a domain specific language for solving that problem. Forth embodies functional as well as procedural programming, is a high level class language (not Assembler) yet also if…

yeah kids hate syntax

Also pretty sure that kids won’t ever have to deal with syntax lol. For better or for worse, Human language is the new programming language, it’s just a specialised dialect and field. I do worry that by teaching coding and not programming we are shooting kids in the foot though. You need to ba able to leverage deep insight to lead coding agent swarms to create actually good codebases.

Re: Teaching Kids Forth

#59
post #13

Leo Brodie's "Starting Forth: An Introduction to the Forth Language and Operating System for Beginners and Professionals" is well-suited for any level student. It's quite fun and made a mark on my thinking. It's hard for a postfix dereference operator not to.

>on my thinking

er ...

There is also Thinking Forth.

https://www.forth.com/wp-content/uploads/2018/11/thinking-fo...

Re: Teaching Kids Forth

#60
post #51

Assuming you’re teaching programming and not “coding”, forth is a fantastic language to teach. First it’s easy to understand. Second, it’s completely unopinionated, and you can take it anywhere you want to. To write a program in forth is to create a domain specific language for solving that problem. Forth embodies functional as well as procedural programming, is a high level class language (not Assembler) yet also if…

What is the difference between programming and coding? In my mind they're synonymous.
Post reply on HN