25 comments

[ 4.1 ms ] story [ 61.9 ms ] thread
Would anyone actually use lua to build a full on ios application though? Is Lua an acceptable alternative to Obj-C?..
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.
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
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/

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.
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.
And yet, you cannot use a remote REPL with Objective-C, making experimentation (crucial when developing games) slow and tedious.
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.