Hacker News new | past | comments | ask | show | jobs | submit login
IOS Programming with Lua (luanova.org)
35 points by wiradikusuma on Nov 5, 2012 | hide | past | favorite | 24 comments



I should note that Codea uses Lua too: http://twolivesleft.com/Codea

You can even code on the iPad itself, and use Codea Runtime to convert it to Objective-C: https://github.com/TwoLivesLeft/Codea-Runtime


Yeah I used it to while I was recovering from an operation. I like lua but still feels like a joke language to me. Anyway heres a video of what I did http://www.youtube.com/watch?v=MOV8j7GM3JA FYI, Everything was made on the ipad.


What do you mean by 'joke language'?

It is used professionally for far longer than some 'enterprisey' languages are around.


Yeah I know the history, I absolutely recommend it as a learning tool and for some professional jobs. It's just, if that then do this end. Feels like a lot of key pushes to get a result. Anyway I'm going to run a lua poetry competition on my twitter feed later today if your interested? @DaveSapien


Wax looks good at least for experiments and prototypes. However, a quick look at Wax issues on github reveals the project has issues that have not been addressed in recent months. So it appears to be a fixer-upper for now.


The problem with using Lua is that you lose debugging/profiling support and incur performance overhead. The loss of the debugging support afforded to Objective-C code might be enough to eliminate any time saved. I do believe that Corona offers debugging support, but Corona has it's own problems: it's a cross-platform engine that necessarily incurs overhead and restricts flexibility.

Furthermore, one of the benefits of Lua that the article cites, automatic memory allocation, is obviated by using automatic reference counting in Objective-C (which also makes Obj-C more concise).


Apple has polished enough of the warts of Obj-C now that I'd be pretty reluctant to throw out all the benefits you get from tight tooling integration. I think in most cases it makes more sense to just use what Apple hath provided (but edit your code in AppCode instead of XCode).


Hm... Is AppCode really that much better than Xcode?


Opinions vary a bit and Xcode is certainly much better at 4.5 than it was at 4.0 but I live in AppCode and would hate to have to actually write much code in Xcode.


There are remote debuggers for Lua, like Zerobrane Studio (http://studio.zerobrane.com/), that allows to patch the code at runtime, enabling live coding, or Koneki (http://www.eclipse.org/koneki/ldt/).

I know there's more, see here for the full list of IDEs:

http://lua-users.org/wiki/LuaIntegratedDevelopmentEnvironmen...


And yet, you cannot use a remote REPL with Objective-C, making experimentation (crucial when developing games) slow and tedious.


Would anyone actually use lua to build a full on ios application though? Is Lua an acceptable alternative to Obj-C?..


This might give you more insight: http://od-eon.com/blogs/alumni/tudor/lua-vs-obj-c/


But make sure to look into comments for insight, not the post itself.


yup. The discussion sparked in the comments and here on HN 1 year ago was quite interesting


That's a flattering post. Lua is a much better language than Objective-C and should see more use.


I'm wondering if MoonScript (http://news.ycombinator.com/item?id=4741331) can be combined with this Lua-based iOS (quick googling reveals nothing).

It's like CoffeeScript for iOS!


Yep, there's nothing preventing it, although I don't know enough about systems like Corona, Codea, or Moai to know whether you'd miss out on any IDE functionality. I'm currently using moonscript to power my side project on iOS. It's great!


One moonscript implementation is a loader, so this would be pretty easy to do.


Another Lua-based framework for iOS programming is Moai. I played around with it a while back and fell in love with Lua. Really simple yet powerful stuff.

http://getmoai.com/


+1 for Moai!


If you want to use the very fast LuaJIT I wrote an Objective-C bridge (purely in lua) for it: https://github.com/fjolnir/tlc


My understanding was that iOS did not have BridgeSupport. Am I mistaken?


You can generate your own with gen_bridge_metadata. But bridgesupport is only necessary if you want automatic access to things you can't get from the runtime.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: