Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
lua "lpeg.so" module — Gideros Forum

lua "lpeg.so" module

jack0088jack0088 Member
edited February 2012 in General questions
Hey folks,
I got moonscript up and running on my machine, with some help of the developer.. this was quite awful process... But now I'm ready to begin.
I wanted to try out moonscript with GiderosMobile. Theoretically this should work fine! - BUT I get this error:
Uploading finished.
error loading module 'lpeg' from file '/usr/local/lib/lua/5.1/lpeg.so':
	dynamic libraries not enabled; check your Lua installation
stack traceback:
I've checked. The file exists! Also tried terminal:
If I try
$ lua -l lpeg
inside terminal, it works. But why is the error above rising inside GiderosStudio?

Outside of GiderosStudio, moonscript is working very good. I have no problems to require("moonscript"); and require("files"); with *.moon extensions. Compiling and everything else is working also. So this has obviously to to with GiderosStudio.


PS: Also - I don't know if it's my machine or not, but - I've noticed that Studio is lagging .. it has some performance issues.. it kind of slow! And there is no CMD+S to save a file I'm working on??!


-jack0088

Dislikes: TheOddLinguist

Owltwins. Smart design and creative code.
»Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
+1 -1 (+0 / -1 )Share on Facebook

Comments

  • atilimatilim Maintainer
    Hi,

    lpeg is a C library. If you want, you can add it as a plugin (for iOS and Desktop, not Android yet).

    Yes, 2012.2 has a lagging issue on some machines and it's solved. We'll release 2012.2.1 in a couple of days (most probably tomorrow).

    btw, cmd+s is working on me?
  • Is there a tutorial on how to add this lpeg plugin to my desktop and iOS devices? Very important for me :)
    -
    I've edited a file (main.lua) hit CMD+S and nothing happening. Inside the Menu bar is no entry to save a file - just one for saving whole project. But this saves not the current file! The dot above (indicating that the file was modified is not disappearing) and I can only save if i close the file. Then a window pops up and asks me if i want those changes to be saved...
    Owltwins. Smart design and creative code.
    »Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
  • atilimatilim Maintainer
    edited February 2012
    For iOS devices (or iOS simulator) it's easy:

    1. copy lpeg.c and lpeg.h to the Plugins directory of GiderosiPhonePlayer Xcode project
    2. create lpeg_stub.cpp with this content in Plugins directory
    /*
     
    This code is MIT licensed, see <a href="http://www.opensource.org/licenses/mit-license.php" rel="nofollow">http://www.opensource.org/licenses/mit-license.php</a>
    (C) 2010 - 2012 Gideros Mobile 
     
    */
     
    #include "gideros.h"
     
    extern "C"
    {
    int luaopen_lpeg(lua_State *L);
    }
     
    static void g_initializePlugin(lua_State* L)
    {
    	lua_getglobal(L, "package");
    	lua_getfield(L, -1, "preload");
     
    	lua_pushcfunction(L, luaopen_lpeg);
    	lua_setfield(L, -2, "lpeg");
     
    	lua_pop(L, 2);
    }
     
    static void g_deinitializePlugin(lua_State* L)
    {
     
    }
     
    REGISTER_PLUGIN("LPeg", "1.0")
    3. add lpeg.c, lpeg.h and lpeg_stub.cpp to the GiderosiPhonePlayer Xcode project

    But for desktop, adding lpeg is complicated. Therefore with the next version, I can provide an official lpeg plugin.

    -
    I really don't know why CMD+S doesn't work for you. btw, which version are you using?

  • ist would be nice if you provide both iOS and desktop implementation with the next release. until then I try your suggestion for iOS.
    -
    I'm using the official 2012.2 version
    Owltwins. Smart design and creative code.
    »Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
  • atilimatilim Maintainer
    I'll look at the CMD+S issue but I'm not sure I can catch a clue. Is there a possibility that a 3rd party application installed on your Mac interfering with CMD+S?
  • jack0088jack0088 Member
    edited February 2012
    Nope. Worked since today always! Also it worked in the latest Beta. In other apps it works NOW too. But not in the new Gideros. I'm not an expert, but since there is no menu entry .. it doesn't work - it just can't I think.

    I can make a video if you like, and email it to you.. Maybe this helps somehow.
    Owltwins. Smart design and creative code.
    »Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
  • jack0088jack0088 Member
    edited February 2012
    PS: are you sure that lpeg is a C lib? I have just this one lpeg.so file inside the Lua installations path, and no one of the above suggested... OK, i think I have to rely and waitin till you implement it :(
    I would be honestly thankful, if you could make those two plugins (for iOS and Desktop). btw. Have you looked at MoonScript?
    -
    I'll make the video grab tomorrow, as soon as I can! - I mean today... it's 01:06 right now. I'm tired a bit)))
    Owltwins. Smart design and creative code.
    »Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
  • Just out of curiousity, why do you want to use a script language inside a script language?
  • I don't know if I'll use it in development later on, but I wanted to try it out, because its simple and quick to write. Also I wanted to support the author, because I like what he does.
    I'm just as curious as you - it's that simple :)
    Owltwins. Smart design and creative code.
    »Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
  • atilimatilim Maintainer
    btw, you can download the C code of LPeg from http://www.inf.puc-rio.br/~roberto/lpeg/#download

    Although I appreciate the effort behind MoonScript, I don't feel myself confortable while using languages like MoonScript or CoffeeScript.
  • jack0088jack0088 Member
    edited February 2012
    Like I said - I maybe won't use this in production, but its nice to try!
    Also GiderosMobile would not suffer from it, because there are maybe some devs who will use moon with Gideros and every member is a Plus! So why not implementing this little plugin and let user decide himself about how he will approach..
    Gideros always cared and always let decide! And thats fantastic!

    #Edit: @Atilim: you got an eMail :)
    Owltwins. Smart design and creative code.
    »Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
  • atilimatilim Maintainer
    edited February 2012
    totally agree :) and I got it. thanks for the detailed video :)
Sign In or Register to comment.