https://www.bittwiddlegames.com/lambda-spellcrafting-academy...
The demo is playable in the browser too thanks to Rust + WASM.
It's probably a better learning experience for kids to be able to get to a point where they can make fun things like games and websites, and then teach them how to improve the correctness of programs.
(Obviously there are some great options for functional creation like elm, but there obviously isnt the same level of available learning resources yet)
As for your more general point: it’s easy to go from functional -> imperative. It’s a lot harder to do the same thing in reverse.
Source: anyone who learned LOGO before BASIC in the 1980s.
Functional programming sits on a difficulty range: spreadsheets on the low-end (debatable but I'll say it!), and on the high-end, well, I think that everything else FP sits there with minor exceptions.
I'm developing a language for numbers that is conceptually closer to spreadsheet formulae than imperative programming or hard-FP, therefore I think hopeful for this kind of task in the long-run. It's "only for numbers", so really think spreadsheet-formula type complexity, but I won't stop anybody from going wild with interpretation.
To see things you pair it with some other language like JS, but code for these "apps" can be simple/declarative and pre-rolled. I have a JS visualization library that will probably be graphical one day.
I'm working on the project website [1]. Following spreadsheet fashion some examples are a little bore, but there is a raycaster rendering to a bar chart and heart shapes, bouncing balls and projectiles, to lighten the mood for early developer-adopters or contributors.
For some more project background: by encapsulating numbers in a language (and not a mad one and one that we can safely and actually run), it can facilitate transparency for numbers. Transparency and education go hand-in-hand. I'm talking about numerical literacy primarily, but I think that too goes hand-in-hand with.. programming on computers.
[1] https://calculang-quarto-site-messing.pages.dev/examples
I'm a fan of functional programming, but I also sympathize with OP's observation that even python might be too far from the CPU to be a good introduction to computing. It probably depends a lot on the child and the teacher—a functional programming language would probably appeal more to older kids (high school) who are comfortable with math.
IMO Python is useful as a didactic tool not so much for teaching kids how computers work as for giving them an emotional experience of "Wow, I can make the computer do things! I'm basically a wizard!" that then might motivate some of them to keep learning about computing.
But yeah, there will also be kids who are already well past that stage and ready for meatier stuff. So probably a combination of approaches is best to provide kids with the level of detail they'll find most engaging.
Anecdotally, I grew up on Logo, Lego Mindstorms, and HTML, and got my early career started in Python before I really dug in and learned about how hardware makes the magic happen because I realized I was going to be handicapped until I knew that.
Trying to please everyone is the road to madness, while acomplishing nothing.
That depends on what one considers to be the best way to introduce computing. I personally think kids are a lot less likely to be engaged by a bottom-up approach (start with "this is what hardware does") than a top-down approach (start with "you can make cool things with it").