Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

codea runtime template - memory stuff and calling objective c classes from lua

edited May 2012 in Questions Posts: 1

First of all congratulations! Your work is really fresh and seems a great 'time-saving' engine for most of ios development.
I'm considering to use it for developing quickly an app with realtime generated graphic, but before starting I would like to ask a couple of question:

  1. I read the maximum instructions stuff and from a first look to the parser code it seems the app load in memory all the lua scripting stuff and then execute everything, should this lead to memory leaks if the app is going to be big?

  2. By modifying the parser, it should be possible to call native code? I mean, if I need (i.e.) facebook integration, should be possible to set hooks and pass stuff to functions outside the lua code?

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,008

    Hi @muccio — Thanks for the kind comments!

    1. Loading all the code into memory will not be an issue. The code will use a tiny amount of memory. I wouldn't worry about it (have a look at Cargo-Bot, it's huge). The code files are usually orders of magnitude smaller than things like art assets and sound. The Codea Runtime Library shouldn't leak memory — though if you find any memory leaks be sure to report them or do a pull request so we can patch the library.

    2. Yes it's possible to call native code, and you should not have to modify the parser. Have a look at some of our libraries to see how it's done. Have a look at OSCommands.h/m — that's probably the simplest custom Lua library in Codea. You'll need to develop some familiarity with the Lua C API to extend it in this fashion. There are many more examples in Codea and on the net.

Sign In or Register to comment.