4 ms·
>In fact, if I were to teach programming, I would teach it using Lua. Implementing your own object system is increadibly instructive. Learning about coroutines
by moonchrome 15y ago
>In fact, if I were to teach programming, I would teach it using Lua. Implementing your own object system is increadibly instructive. Learning about coroutines and lambdas is, too. And Lua is still small enough to just read its source when in doubt. It's bytecode consists of just a few dozen instructions.
If these things appeal to you check out lisp (clojure is my personal recommendation)
- BystanderX 15y agoLua itself can stand pretty well, especially with LuaJIT2. That said, I'm starting to learn Lisp right now (Clozure/OpenMCL), and coming from primarily Lua development in the last two years, it seems much less like the leap many play it out to be.. Instead, it has seemed more like simply stepping from a clean, compact room into a large, similarly clean and smooth room but with depth you hadn't imagined before. Well, that and learning Emacs compared to ST2 is a bit of a step at the same time.
- Derbasti 15y agoI know a bit of eLisp and I quite like it. Frankly, it's not that Lisp syntax is bad (it's wonderful), but most popular languages have a C-derived syntax. For teaching to non CS-types, the target is probably a C-like language and I guess Lua is closer to that than Lisp.
- ansible 15y agoIf I were using a Lisp these days, I'd really miss the Lua table. Lisp is built around cons cells and the linked list. But it has seperate containers of various types. Lua is built around the Lua table, which can function as a list, array, and dictionary/hash table. You can then build any other data structure from tables easily. With a metatable, you then also get read-only tables, objects and classes, and more. Now if someone were to design a modern Lisp based around tables...
- moonchrome 15y ago>Now if someone were to design a modern Lisp based around tables... Check out clojure - advanced data structures/primitives + immutability(functional programming)
- ansible 15y agoI don't really want multiple data structure primatives though, just the one. And have the language built up around it. I have been mulling over better support for immutable data structures in Lua, but I haven't figured out a good and clean design yet.
- gruseom 15y agoNow if someone were to design a modern Lisp based around tables... I agree, it's an intriguing possibility. There was a thread about this a while ago: http://news.ycombinator.com/item?id=3291065 http://news.ycombinator.com/item?id=3291065