alt.hn

7/26/2026 at 9:39:17 PM

Teaching Kids Forth

https://gracefulliberty.com/articles/teaching-kids-forth/

by rbanffy

7/27/2026 at 5:09:11 PM

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.

by K0balt

7/27/2026 at 8:25:03 PM

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

by fasterik

7/28/2026 at 12:39:42 AM

It’s not really a completely clear distinction, but if I was going to try to describe it:

Coding is writing code to solve a problem. Someone can “know how to code” in one language, and have a very hard time moving away from that language because they understand the symbols more than the ideas.

Programming is approaching a problem space as a system specification problem and solving it with an algorithmic solution, and it doesn’t matter what language you use because you are approaching it from the symantic direction rather than the syntactic one.

You are a programmer when all languages are roughly similar to you, even though you may be much more familiar with the syntax of one than you are with others.

You are a coder when you can write programs, maybe even complicated ones, but you think of the solution in terms of a computer language rather than data structures, transformations, and state machines.

Most people start as coders, unless they come from a computer science background, or start out in assembly or with a little extra push, languages like forth. If you keep going and start to branch out a bit, most people will become programmers to one degree or another within a few years of working or playing in the field.

In short and to overgeneralise to the extreme, the focus is on the code vs the data.

You can also be so far in to the theoretical side that you are a data scientist or mathematician and a coder, but not really a programmer, even though you are solving complex data and algorithmic problems by programming a computer…. So it’s kinda nuanced? I think maybe it’s a matter of how you think about practical computation? But there’s definitely a difference in the depth of knowledge that crosses some kind of inflection point that is non-linear.

by K0balt

7/27/2026 at 8:50:10 PM

In my mind, programming is the concepts, especially around problem solving with code as a tool, where coding is specific syntax/implementation, a means to an end. Related, you don't get paid to code, you get paid to program.

by nomel

7/27/2026 at 6:55:27 PM

yeah kids hate syntax

by liveoneggs

7/27/2026 at 7:55:48 PM

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.

by K0balt

7/27/2026 at 8:43:26 PM

that's why most popular languages (python in particular) are the worst of all worlds - if english is the "programming language" why not use a good runtime?

by liveoneggs

7/27/2026 at 7:51:28 PM

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

by K0balt

7/28/2026 at 7:53:19 AM

Apart from : and ;, does it even have a syntax?

by rbanffy

7/26/2026 at 11:56:21 PM

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.

by jeberle

7/26/2026 at 9:52:41 PM

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.

by veltas

7/27/2026 at 2:07:06 AM

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.

by ndiddy

7/27/2026 at 11:55:45 AM

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

by HelloNurse

7/27/2026 at 7:38:16 PM

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.

by ndiddy

7/26/2026 at 9:58:06 PM

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.

by rbanffy

7/27/2026 at 12:26:38 AM

Well that’s next weekend sorted, thanks!

by JSR_FDED

7/27/2026 at 2:53:32 AM

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.

by fuzztester

7/27/2026 at 8:17:19 AM

Paul Lutus is a treasure of humankind.

by rbanffy

7/27/2026 at 1:49:55 AM

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.

by noosphr

7/27/2026 at 4:55:20 AM

what aspect of school level “mathematical notation” is so bad as to be brain damage inducing?

by pitchlatte

7/27/2026 at 7:59:16 AM

probably the arbitrariness of it. PEMDAS is more or less burned into my brain at this point but its basically the qwerty of notations.

by cultofmetatron

7/27/2026 at 8:11:24 AM

that’s not even notation though, that’s a rubric for the order of operations.

by pitchlatte

7/27/2026 at 8:40:49 AM

The need to remember operator precedence is a consequence of the infix notation syntax.

by lioeters

7/27/2026 at 9:30:25 AM

It’s a tradeoff against lots of irritating silly parentheses.

by antonvs

7/27/2026 at 10:07:48 AM

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.

by Someone

7/27/2026 at 9:55:13 AM

Hence Forth.

by lioeters

7/27/2026 at 2:55:38 PM

claps

by WolfeReader

7/27/2026 at 2:27:31 AM

[flagged]

by songhonglei1985

7/27/2026 at 12:36:40 AM

I doubly enjoyed reading this because I feel like I'm reasonably sure the author never ran this through an LLM because of the "cirriculum" typo.

by sudb

7/27/2026 at 7:37:16 AM

This is exactly the kind of spelling mistake ChatGPT makes if you ask it to make spelling mistakes to make text look more authentic.

What seems to happen is it will get a lot of words like curriculum wrong that people rarely spell incorrectly because they're long enough that if your English isn't confident you would look it up or use a spell checker, or spell words incorrectly that people don't usually spell wrong like 'imediate' or 'puzzel'.

by veltas

7/27/2026 at 7:56:00 AM

Let it be known that this is a spelling mistake I have made for years. I thought I had rooted out of this article. It must have made it back in with later drafts.

by gracefulliberty

7/27/2026 at 8:09:36 AM

To be clear, I'm not accusing you of plagiarism at all. I'm just saying this kind of typo unfortunately doesn't prove anything.

by veltas

7/27/2026 at 1:19:01 AM

Because it occurred more than once, my first thought was it must be a British variant. But I guess not.

by encomiast

7/27/2026 at 2:06:01 AM

The u and i keys are adjacent, so it's a plausible typo.

by WillAdams

7/27/2026 at 7:36:51 AM

I thought it was made on purpose so people have something xtra to chat about. Clever.

by dgrabla

7/27/2026 at 2:34:02 AM

Decker, a hypercard style app, seems to give quick gratification. Looks like an easy and fun way to get started with programming. Was just posted to HN: https://news.ycombinator.com/item?id=49060856

by bolangi

7/27/2026 at 3:16:48 AM

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 in understanding some low level details like memory addresses and reading and writing memory. It seems simpler than abstracting it to "pointers", more like assembler but interactive.

by lebuffon

7/27/2026 at 9:36:56 AM

Wouldn't something like Python be better for interactivity?

by rwmj

7/27/2026 at 5:32:04 PM

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

by lebuffon

7/27/2026 at 6:30:49 PM

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

by exe34

7/28/2026 at 2:51:26 PM

The "no safety net" means that Forth is a low level language. You can touch anything in the machine. Many times it is used without an O/S. So if you push a random number onto the hardware stack you will get burned.

by lebuffon

7/28/2026 at 2:39:32 PM

Of course not. I was merely expressing that Forth makes interactively very easy. And like all languages, it is impossible to evaluate them if you don't use them for some significant amount of time.

by lebuffon

7/28/2026 at 5:23:42 PM

Python also makes "interactively" very easy!

by exe34

7/27/2026 at 8:59:43 AM

From personal experience, I strongly disagree with the negative comments saying Forth isn't suitable for teaching children.

"Starting Forth" by Leo Brodie was the first programming book I ever read when I was about 6 or 7 years old, after my dad brought it home from work (where they used Forth). To me, the language felt very intuitive and easy to grasp. And Brodie's illustrations helped a lot with visualizing how it all worked.

by 6581

7/26/2026 at 10:44:14 PM

Writing RPL on my HP48 as a young teenager influenced the way I thought about programming significantly. RPL IMO is underrated as an educational tool. It introduces the stack based concept, but also the "everything is an object" concept. As a useful language I'm not sure, but it was definitely fun to think about.

by cameldrv

7/27/2026 at 9:35:06 AM

I wonder if Logo wouldn't be better for kids, especially if you could pair it with a real "turtle".

by rwmj

7/27/2026 at 9:58:18 AM

Python turtle with logo parser and 3D support https://github.com/tkfoss/pylogo3d/tree/main#pylogo3d

by tkfoss

7/27/2026 at 10:09:58 AM

Are there physical turtles available? Good for kids to take home an actual plot from their classes.

by rwmj

7/27/2026 at 10:01:30 PM

Didn't publish the backend yet but I experimented with DIY plotter based on Drawing Robot by henryarnold and it works fairly well. I m not sure what to do with the layer between plotter backend and different plotters though.

by tkfoss

7/27/2026 at 8:48:14 AM

OP is speedrunning how to make kids hate programming.

This language is simple unintuitive and the Polish math notation will cause even more confusion.

>> Overall, I don't believe the programming language matters all too much.

Delusional. There is a reason why 99.99% of large projects are done in imperative languages.

I like programming a lot but if my programming journey were started by this teacher and might just became a chef instead.

This seems to be a "do novel things for novelty sake" thing.

Kids need to see the practical applications in the simples and most intuitive way of the things they are learning.

Forth or similar languages are not it.

Even in university level students these languages are both confusing and unintuitive and slow to develop in compared to imperative languages.

by NotGMan

7/27/2026 at 9:30:08 AM

I don't know.

It's got some extremely simple rules. 1 data structure. And nothing is particularly hidden.

Python might be better for actually producing something, but from a 'teaching how computers work' pov, forth would seem to have it's merits. Python hides a lot of stuff, thus we have a situation where people think compilers and interpreters are magical things. If you don't care how the computer works, that's fine, but personally I'd like to teach my kid how a computer works, not how to use some programming language.

by benj111

7/27/2026 at 10:01:30 AM

>> but personally I'd like to teach my kid how a computer works, not how to use some programming language.

I wonder if assembly is a better choice... hmmm...

by anta40

7/27/2026 at 10:19:06 AM

Well one can follow on from the other.

Assembly is add R1 R2. Forth takes the 2 numbers from the TOS and puts it in those registers. That wasn't obvious what was happening in the post, I wonder if student me would have wondered.

You could make the case for going all the way down to the silicon.

We teach English, maths, science to give a rounded understanding, not to make student productive or give them information that will be immediately useful. IT/computing in secondary school should be doing a similar thing. It should remove the mystery of what a computer is. That it is programmable. Hopefully it's improved since I was young and we were basically shown how to use Excel.

by benj111

7/26/2026 at 10:27:39 PM

[dead]

by AI_hacker

7/26/2026 at 9:55:58 PM

[flagged]

by hecreto

7/26/2026 at 9:58:19 PM

Why ?

by beyonddream

7/26/2026 at 11:05:10 PM

I'm betting the mask and pronouns. Because no one can do anything anymore, even if that thing has zero impact on anyone else, without having their mental fitness attacked.

by Loughla

7/27/2026 at 5:23:15 AM

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

by sieste

7/27/2026 at 6:32:40 PM

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.

by exe34

7/26/2026 at 11:17:52 PM

Why not Processing or P5.js?

by q2dg

7/26/2026 at 11:54:20 PM

did you read the post? it doesn't mention those by name but the reasons it gives for not teaching other languages/tools apply to those too

by peesem

7/27/2026 at 8:46:28 PM

Yes, of course. I just wanted to say that I think these tools are very suitable for teaching programming to beginners in a very short time and with excellent feedback. There's no need to go to the margins.

by q2dg

7/27/2026 at 2:06:01 AM

All things considered, unfortunately, we are better off teaching them plumbing or painting ...

by pbgcp2026

7/27/2026 at 2:22:46 AM

Or just concentrate on reading writing and 'rithmetic and let them find a career they want that isn't forced on them

by assimpleaspossi

7/28/2026 at 3:18:29 AM

Extremely hard to predict what the world of careers will look like to someone starting out 20 years from now.

by qgin