1. Lua vs. Obj-C

    Lua

    For some time now I’ve been digging into Lua. Coming from Python, the power of a clean syntax and good documentation is impossible to ignore.

    Lua is a powerful, fast, lightweight, embeddable scripting language.

    Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

    It’s that exotic, super-fast scripting language that very few use, right? Partially right. It’s extensively used in the gaming industry (e.g. World of Warcraft) usually together with C++.

    Lua comes with a console, which is great tool for fast experimenting of logic and syntax.

    Lua + iOS

    spidey vs hulk

    All fine and dandy, but how can this help me on iOS development? Stefan found the right answer: iPhone Wax .

    Wax is a framework that lets you write native iPhone apps in Lua. It bridges Objective-C and Lua using the Objective-C runtime. With Wax, anything you can do in Objective-C is automatically available in Lua!” Corey Johnson, main guy behind Wax

    As anyone with iOS development experience knows, Obj-C is very strict about classes, requiring a certain mindset to write good, maintainable and modular applications. Wax doesn’t alter this approach at all.

    Memory management is another worry that goes away in Wax, because of the automatic garbage collection.

    By this point, Wax looked completely different than any other write-quick-iphone-apps gimicks out there, including PhoneGap, Titanium, Rhomobile, Corona SDK. Do note that I mention “iPhone apps”, since the result of Wax is not cross platform. Well, a solid application should take advatage of the hardware platform and the only part that can be cross platform is the interface, even that within certain limits.

    Cocoa with a sprinkle of Lua

    Wax looked good in theory. A UITabBarController is a UITabBar, a delegate is a delegate, 3rd party libs work how they are intended to (Facebook, ASIHTTPRequest, custom written ones). Now let’s see it in practice.

    Read the full article…

    1. tudorizer posted this