115 points · by kristianp · 2y ago · 46 comments
BTW: a modern, maintained alternative (With Python instead of Lua) would be Pyxel (https://github.com/kitao/pyxel -> discussion: https://news.ycombinator.com/item?id=40899520).
It's based on Scala, supports turtle (imperative) graphics, picture (functional) graphics, gaming at different levels (imperative, functional, OO), and more...
And since then, I've helped a few of those aspiring programmers become Lua gods! LOAD81 is really a gateway to a lot of wonderful things .. easy/simple programming in Lua, to SDL .. to the Lua VM .. to exending LOAD81 .. to an introduction to antirez other cool projects (redis, lol!) and on it goes ..
So, thank you antirez, this is probably one of my most cloned repo's over the years. ;) I should probably clean up some of my PR's and give you a bit of a laugh to review, one of these days (I added sfxr for sound effects, joystick support, MIDI and a few other things along the way ..)
To this day, I still believe it's one of the best ways to learn to program:
- You're exposed to low-level primitives instead of complicated high-level frameworks (like Unity) that abstract the fun/educational code away.
- The Lua manual is arguably the best programming manual for students learning to program.
- Includes a built-in GLSL shader editor makes advanced graphics programming a small stepping stone.
- They automatically shipped in-depth examples with the app that are intentionally built for learning by reading the code.
- In-app docs encouraged discovering new APIs; I took it as a challenge to use all of the APIs they exposed and learned a lot in the process.
- No package managers, no complicated install steps, no security concerns, and a unified editor.
P.S. If you have an iPad and haven't played Two Lives Left's Crabitron [1] – it's easily the most creative game shipped for iPad.
[1] https://apps.apple.com/se/app/crabitron/id440462182?l=en
Programming using a language like Lua has the advantage over Scratch-like environments (which a friend suggested I use instead) that you can talk about your code more easily if it is based on keyboard entry of keywords and operators rather than GUI events (such as moving graphical blocks by drag and drop) - although that is based on my intuition rather than backed up by any empirical study (please let me know if you are aware of one to support or refute this).
The initial learning hump in programming is difficult and frustrating and lua does nothing to alleviate that. The main resource learners do have is curiosity, and usually an interest in some goal like making a game or website for a particular purpose.
Lua gets them bogged down in writing string manipulation functions that aren't in the standard library or whatever. One of the main things learners want to do is make an http request to an api, you need a library for that. There's no obvious & reliable way to get one, now your beginners are trying to configure luarocks or compile C modules.
To be clear lua is fine, great even, it's an incredible technical accomplishment. But the spiritual admiration experienced programmers have for the simplicity of implementation does not matter to a beginner. Its minimal standard lib and flexible distribution methods are a liability to teaching. I've never seen a language more reliably kill that learner's spark that is the best asset of someone new to coding.
This is somewhat alleviated if you're using it in a controlled environment for a specific goal, like roblox scripting or love. I've had success with that and would do it again. But as a general introduction to programming it's terrible.
Now that you point it out, I'm in agreement with your comment about how Python would be a recipe for counterproductive frustration in many, many other contexts, where people have many other contexts and real-world experiences that motivate coding.
I really do respect the challenge of teaching to very different age ranges, and I acknowledge I've only taught in one context! I'm curious – what you do find engages children vs. adults? (I imagine kids might actually love making Discord bots etc.)
I'm mulling over a proposal for a community ed. class in my local community college about "programming for accountants" – I've informally heard from some accountant friends that they're really motivated to learn Excel macros for example with very bespoke accounting worklfows – but I'm dreading the thought of VBA.
It’s just a terrible language. Full stop.
Lua is touted by supporters as this orgasmic language.
But there’s a reason it’s relegated to the role of scripting language embedded in something else. It’s small, sure, but it *sucks* in literally every way other way from functionality, to tools, to libraries, to community.
He was excited enough about it to want to learn about robotics and aspire to be a programmer for Mars rovers and the like.
And yeah, turtle graphics is the time-honored method of teaching things like loops, recursion, and parametrization via functions step by step in a way that is visually intuitive. Things like polygons, stars, spirals, and eventually basic fractals like snowflakes and ferns.