New iPhone Wax Version: New XML, JSON, SQLite Extensions & More
iPhone Wax is a framework that lets you write native iPhone apps in Lua. Developing in Lua is fast and objects are garbage collected. Wax bridges Objective-C and Lua using the Objective-C runtime. With Wax, anything you can do in Objective-C is automatically available to you in Lua.
Wax has been in active development since it was unveiled in September and has just released version v0.9:
Along with new XML, JSON and SQLite extensions, the new version uncouples much of the development from Xcode, allows all code — even the UIApplicationDelegate — to be done in Lua, and supports easier usage from the command line.
v0.9 features these updates:
- Run tests from the command line with “rake test”
- Interact with your app from the command line with the Wax Interactive Console using “rake repl”
- Added key/value support so IB outlets can be created and referencedĀ in Lua
- For people using legacy code or only using Lua for portions of your app: uou can init and call classes created in Lua via Objective-C
- Lots of syntax cleanup and descriptive error messages added
- Run your app from the command line with “rake run”
- Reload your app from the terminal with SIGQUIT or Control- — no need to recompile and run
You can download/clone Wax on GitHub.
In some ways, I wish Apple was more like Microsoft in that MS allows a lot of language choice when targeting their platform. That said, I think knowing Objective-C is still the way to go. I haven’t played with this, but I have played with the old Cocoa/Java bridge and the current Ruby/Cocoa bridge.
Even though these technologies work, getting the most out of the platform, and understanding the platform is probably best done in Objective-C.
whenever I hear “garbage collection” in connection with mobile devices I think of nature disasters š
srsly, learn to code if you don’t get along without garbage collection. but I guess that even understanding what a pointer is is too much for our new generation coders who only know javascript and lolhtml.
@fred – where’s the problem? if you know one language you know them all. the principle of building software (problem solving) does not change.
@iknowthetruth Tools change and evolve. Your argument is always brought out by people afraid of learning new technology. Machine Coders hated on Assembly, Assembly Coders hated on C, C coders hated on Objective-C, etc.
Using a modern language has nothing to do with being lazy or stupid, just as you aren’t lazy for neglecting to hand optimize your assembly code. It’s about being more efficient with your time and being able to do more with less code.
@ProbablyCorey – Well played…
@iknowthetruth – I’m all for more languages. I’m just not thrilled with shoehorning languages is. If you take a look at the design of the .net platform and the common language runtime, you can see that MS laid a great foundation to cleanly suport a wide range of languages. In .net, multiple languages was baked in from the get go.
When you look at bridges to Cocoa and the Objective-C runtime, it’s not as clean. Generally you still need to know how arguments are passed to Objective-C methods, you still need to learn Objective-C style so you can understand how to call into the Cocoa and Foundation APIs, and you’ll likely end up reading Objective-C documentation. You’re either going to end up being limited by the language that’s hacked onto Apple’s SDK, or you’re going to spend a good amount of time grocking Objective-C anyway.
So, I’m not against multiple languages, I’m just pointing out that Apple only seems seriously interested in one.
Does Wax support using any arbitrary Objective C code or only specific APIs?
For example, can I use Cocos2D library from Lua?
@Ken Yeap, I’m making a game with Wax and Cocos2d right now. Some things need to be added by you (like the Cocos2d enums) but everything else works!
@iknowthetruth srsly, learn to drive if you donāt get along without automatic transmission. but I guess that even understanding what a stickshift is is too much for our new generation drivers who only know anti-lock brakes and seatbelts.