115 points | by kristianp5 天前
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).
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 ..)
It's based on Scala, supports turtle (imperative) graphics, picture (functional) graphics, gaming at different levels (imperative, functional, OO), and more...
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.
With kids you kind of have to tease out their motivations. A lot of them default to "make a game" because it's something they know and it's tangible, but once they start to see the potential they reorient. For example I've had multiple "game dev" classes devolve into "pull live sports scores and text it to me" once they realize how possible that is.
I've had discord bots brought up before by multiple kids, so that is a good one too. Generative art is another, or like I've seen really academically-focused kids get excited about just using jupyter to make graphs. The younger they are the bigger the swings between excitement and frustration, and the more your value shifts from technical prowess to emotional nurturer.
When I taught adults it was the "fundamentals of programming" module of a web dev bootcamp, the first thing they encountered there. For the most part these were disciplined motivated professionals and the thing they actually wanted to do was learn web development. So it was pretty easy to connect to their goals by just saying like "trust me you need this."
I haven't done a specific goal-oriented focused class like that for adults. But I think the main thing is still just keep it pointed towards the target and don't get bogged down in configuration or tooling. The great thing about an environment like roblox or I assume excel is that you have the total runtime & dev env right there without having to deal with external tools.
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.
I've used it in million-dollar products where other languages cowered in fear at the memory BOM. Lua can go places many other programming lanuages simply cannot, such as in embedded/low resource systems, high performance engines, and even scientific realms.
Its not 'just a scripting language', as if that were some sort of valid pejorative.
On top of that, its not just a "language" but also can be used to create an extremely powerful engine for any application, systems software, or high-profile component.
Its a highly flexible and powerful VM-based language which can be wired into EVERYTHING and ANYTHING a competent programmer might find worthwhile.
Lua can do anything and everything, from teaching tools and video games, to network switching equipment to high-precision jet fuel analysis systems.
(Disclaimer: I've shipped all of these types of products using Lua.)
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.