4 ms·
Learn Lua the Hard Way
- marcamillion 14y agoSomething about this doesn't sit well with me. I am just a consumer of Zed Shaw's "Learn X the hard way" series...but this feels like a blatant mooching of his hard-earned credibility and intellectual property. I would a) consult him and either distribute it through him with his permission, or b) rename it.
- brianobush 14y agoThis is exactly why we can't have nice things. The phrase "learn X the hard way" has been around ages. Get over it.
- bchjam 14y agoThere's a "learn X the hard way" template linked from the http://learncodethehardway.com http://learncodethehardway.com homepage (https://gitorious.org/learn-x-the-hard-way/learn-x-the-hard-way https://gitorious.org/learn-x-the-hard-way/learn-x-the-hard-...), encouraging people to reuse the format to make their own
- bsg75 14y agoI found out about it from Zed: http://twitter.com/#!/zedshaw/status/204994953699536896 http://twitter.com/#!/zedshaw/status/204994953699536896
- duck 14y agoWhich is definitely different than the first time his idea was copied: http://news.ycombinator.com/item?id=1874271 http://news.ycombinator.com/item?id=1874271 (github page no longer exists).
- marcamillion 14y agoVery well....I stand corrected. For all those people that hate on Zed, he seems like a pretty stand-up dude. Many people would be pissed about this.
- stantona 14y agoActually I learned about this from Zed himself on twitter. From the tone of his announcement he doesn't seem to mind.
- hkarthik 14y agoI've been wanting to learn Lua for a while and this seems like a good resource. But it'd be nice to have some Mac-friendly setup instructions. I'm sure I can figure it out for myself but others may find the information useful.
- bsg75 14y agoInstalling Lua on a Mac is quick: 1) Download the source (http://www.lua.org/ftp/), and un-tar 2) Run "make macosx" 3) Optionally run "sudo make install" to place binaries in /usr/local If you don't "make install", the interpreter can be run from the src directory.
- ndrake 14y agoLua is available via Homebrew too (brew install lua).
- hkarthik 14y agoNice, I figured there'd be a brew for it. I'll give that a shot. Thanks!
- seclorum 14y agoFor an even better environment in which to learn Lua, consider checking out LOAD81: http://github.com/antirez/load81 http://github.com/antirez/load81 Its an SDL-based environment for learning to program with Lua, and it includes an editor - as well as access to a number of useful primitives that can be used to draw graphics. I love Lua (been using it for years), but LOAD81 makes me really, really squeee with delight, because its just an easy environment to do things fast. If you go with the OS-based/homebrew-based Lua, you'll just get the interpreter - but with LOAD81 you get the interpreter plus graphics capabilities. Plus, the samples in the LOAD81 project are pretty good ways to get some bootstrap knowldege, too ..
- bsg75 14y ago
- QuarkSpark 14y agoThis tutorial hasn't been updated in a long time (~1 year) Honestly, I haven't learnt anything significant about Lua from this tutorial. Lua was initially designed as an embedded scripting language.The most popular applications built using Lua are games! It's also used a lot in building plug-ins, most often embedded into other languages. This tutorial explains nothing significant about meaningful programming using Lua : how to write functions? how to build Tables(most important data structures in Lua) Arrays? Object-oriented programming in Lua? Lua was a boon to game enthusiasts with no programming experience. Can an amateur even start developing the simplest of games using this tutorial? I think not. I am a big fan of Zed Shaw's tutorials, and if one wants to follow a similar trend, they should be more consistent with updating their material for everyone.
- FuzzyDunlop 14y agoI opened it up thinking, "wow, I might finally get a good idea of how to configure my old Awesome install." From the first bits I read (up to the arithmetic bit), I think it falls into the pitfall of rambling about boring stuff and not getting straight into it. Yeah, aspiring programmers need to know the difference between a comment and a string. Do they need to see a several page explanation of a comment and a string put in different places? Hell no. Do they need to see how their script can do the same things a basic calculator does? If they're learning programming, then credit them with some intelligence. How about a basic app that does something useful? We have so many APIs available to use now, and while it might be difficult to put them in a printed book (the API might not be around forever), I can think of few things more engaging than, say, replacing the 'Hello world' with a simple Twitter timeline fetching script. Through that one example you can explain functions, types, variables, control structures, and documentation, and establish a solid base for delving deeper into the language and what you can do. This will of course test the skill of the author more than it will test the patience of the eager learner. No bad thing.
- Derbasti 14y agoHonestly, the official book is just so very good and Lua is just so very compact that I don't quite see the need for a tutorial like this. But whatever, someone spent a lot of effort doing this, and it does not seem bad, so more power to that person. However, the basic syntax and library of Lua is extremely simple. There is just not much to be said about it that you can not see from a few code samples. What I would like to see is a comprehensive tutorial for the interesting stuff: How to use metatables, how to build great scripting APIs, how to implement object systems, how to use the C API efficiently. But then, as I said, the official book does a good job of that already.
- bsg75 14y agoI am looking at this as a "quickstart", to be followed up with PiL as a deeper dive.
- xxiao 14y agothis is pretty decent, like it!
- bsg75 14y agoI find the level of interest in this article on HN surprising. Lots of Lua learners lurking.