5 ms·
TLC (The Tiny Lua Cocoa Bridge) RC1 Released
- mrcharles 15y agoAwesome! I love Lua and I love integrating it into everything I do. I'll get some use out of this.
- gwillen 15y agoWow, this is great. I recently spent a bunch of time integrating Lua and ObjC for a project; I'll have to see if I can replace all that glue with this library, or if I have something I can contribute to it. EDIT: What's the license on this? There's no indication at the top of the source, or anywhere that I can see. It turns out not to be the same as what I'm doing -- I'm calling from ObjC into Lua and back -- but there are still bits I'd love to reuse, if I could.
- seany 15y agoLuaCocoa does both sides of the bridge. You might try that.
- fyolnish 15y agoThe license is ISC, so you can do whatever you want with it. in order to call back into lua you can either use the standard C api. (This file from another project of mine might be a useful starting point: https://github.com/aptiva/Tranquil/blob/master/Tranquil/Core/ScriptContext.m https://github.com/aptiva/Tranquil/blob/master/Tranquil/Core...) Or use addMethod to add a lua function as a method to a class (You can use createClass to create a new class) I'll add a subclassing demo to the readme later today
- YuriNiyazov 15y agoIf someone with more knowledge than me would answer this I'd appreciate it: Does this mean I can write a full-blown iOS app in Lua? Or will there be technical and TOS limitations?
- jacktoole1 15y agoI can't respond on technical, as I haven't used TLC. As to Apple's TOS (I can't seem to find TLC's), I'm pretty sure you can write a full-blown iOS app in Lua. You can already write a complete iOS game in Lua: http://www.anscamobile.com/corona/ http://www.anscamobile.com/corona/ . Around summer 2010 they changed their terms so that embedded, non-JIT languages are allowed, as long as all executed code is bundled in your application (not downloaded). Many apps already embedded lua. I don't think using TLC would affect an app's chances of being approved.
- seany 15y agoLuaJIT requires mprotect which was disabled in version of iOS pre 5.0. It has been secretly activated in 5.0+, but it's unclear if apple will allow anyone to use it. Feel free to try and let us know the results.