luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
245 stars 58 forks source link

Support for Smartphone platforms #147

Open darmie opened 8 years ago

darmie commented 8 years ago

Hello, I am currently working on a runtime which is a fork of an existing NodeJS based framework. My main goal in this project is portability across mobile devices. So I am asking if Luvit is embed-able in Android, iOS or WP8 using existing Lua bridges.

creationix commented 8 years ago

What do you mean by existing lua bridges? If you want libuv's event loop to play nice with with something like the cocoa event loop, I doubt existing bindings have that.

I do know that luajit can run in all those platforms and I assume libuv does as well, but haven't tried or know for sure.

kaustavha commented 8 years ago

I'd say maybe. I only have experience with cordova/phonegap, which basically builds on top of the android-js bridge and gives you a proper js engine, which is sometimes v8 which itself relies on libuv which we also rely on here http://phonegap.com/2011/01/14/android-your-js-engine-is-not-always-v8/ So cramming libuv, luajit, lua and luvit onto a phone app before any app specific code seems justified and feasible.

So it's definitely possible, but afaik the groundwork to write mobile apps in luvit does not exist as of yet. This project i just forked from google code and glanced at seems like a good starting point for building that base at least for android. https://github.com/kaustavha/android-lua

Also afaik I dont think the nodejs cross platform dev frameworks care too much about being friendly about the event loops of the underlying systems and willfully accept that tradeoff. Anything that uses the native event loop are treated like i/o, e.g. a native barcode scanning library will be called and waited on to return, which will in its own loop use the camera to capture an event and then translate it and finally return some kind of textual or binary data.

It's a good idea though if you succeed. Luvit should theoretically have a lower memory footprint than v8/node whilst offering a similiar ideally isomorphic api.

darmie commented 8 years ago

Thanks for the responses. I was actually asking if it's possible to embed Luvit in a Lua bridge like LuaJava or Android-Lua.

So I guess Kaustav must have answered my question. Thanks again.

On Wed, Dec 2, 2015, 21:05 Kaustav Haldar notifications@github.com wrote:

I'd say maybe. I only have experience with cordova/phonegap, which basically builds on top of the android-js bridge and gives you a proper js engine, which is sometimes v8 which itself relies on libuv which we also rely on here http://phonegap.com/2011/01/14/android-your-js-engine-is-not-always-v8/ So cramming libuv, luajit, lua and luvit onto a phone app before any app specific code seems justified and feasible.

So it's definitely possible, but afaik the groundwork to write mobile apps in luvit does not exist as of yet. This project i just forked from google code and glanced at seems like a good starting point for building that base at least for android. https://github.com/kaustavha/android-lua

Also afaik I dont think the nodejs cross platform dev frameworks care too much about being friendly about the event loops of the underlying systems and willfully accept that tradeoff. Anything that uses the native event loop are treated like i/o, e.g. a native barcode scanning library will be called and waited on to return, which will in its own loop use the camera to capture an event and then translate it and finally return some kind of textual or binary data.

It's a good idea though if you succeed. Luvit should theoretically have a lower memory footprint than v8/node whilst offering a similiar ideally isomorphic api.

— Reply to this email directly or view it on GitHub https://github.com/luvit/lit/issues/147#issuecomment-161417295.