glue the bytecode with lua

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

glue the bytecode with lua

Andreas Mueller
  Hi,

  is there a way to glue the bytecode (created with luac) together with lua?

  (To get one file to give it to my users)

  Greetings
  Andreas

--
Andreas Müller

Reply | Threaded
Open this post in threaded view
|

Re: glue the bytecode with lua

Tony Papadimitriou
Assuming you're under Windows, I have written this couple of little
utilities that work well for me (YMMV):

1. Convert a pure Lua source to a single file, compile it to bytecode, and
turn it into a C program ready for compilation:
http://chiselapp.com/user/tonypdmtr/repository/PureLua53/uv/lua2c.exe

2. Same as above but without the conversion-to-C step:
http://chiselapp.com/user/tonypdmtr/repository/PureLua53/uv/onelua.exe

(For Linux the same approach works but I haven't yet taken time to create
the related binaries.)

Hope it helps.

-----Original Message-----
From: Andreas Mueller
Sent: Friday, March 24, 2017 10:03 AM
To: [hidden email]
Subject: glue the bytecode with lua

  Hi,

  is there a way to glue the bytecode (created with luac) together with lua?

  (To get one file to give it to my users)

  Greetings
  Andreas

--
Andreas Müller


Reply | Threaded
Open this post in threaded view
|

Re: glue the bytecode with lua

Dirk Laurie-2
In reply to this post by Andreas Mueller
2017-03-24 10:03 GMT+02:00 Andreas Mueller
<[hidden email]>:

>   is there a way to glue the bytecode (created with luac) together with lua?
>
>   (To get one file to give it to my users)

Yes and no.

Yes, because you can dump the bytecode to a string and manipulate it
with string.unpack and string.pack. Luiz's lbci library
   http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/5.3/lbci.tar.gz
makes the task easier.

No, because the information about bytecode structure is not officially
documented outside the Lua source. Luiz's library is authoritative, of
course, but not official.

Reply | Threaded
Open this post in threaded view
|

Re: glue the bytecode with lua

steve donovan
On Fri, Mar 24, 2017 at 10:15 AM, Dirk Laurie <[hidden email]> wrote:
> No, because the information about bytecode structure is not officially
> documented outside the Lua source. Luiz's library is authoritative, of
> course, but not official.

I think OP just wants to include the created bytecode in a project.

srlua can do this, AFAIK, by allowing you to append the bytecode using 'glue'

Reply | Threaded
Open this post in threaded view
|

Re: glue the bytecode with lua

Samir Tine-2
Hi,

If you're on Windows you may take a look at ljc :

Regards,

2017-03-24 9:18 GMT+01:00 steve donovan <[hidden email]>:
On Fri, Mar 24, 2017 at 10:15 AM, Dirk Laurie <[hidden email]> wrote:
> No, because the information about bytecode structure is not officially
> documented outside the Lua source. Luiz's library is authoritative, of
> course, but not official.

I think OP just wants to include the created bytecode in a project.

srlua can do this, AFAIK, by allowing you to append the bytecode using 'glue'


Reply | Threaded
Open this post in threaded view
|

Re: glue the bytecode with lua

Luiz Henrique de Figueiredo
In reply to this post by Andreas Mueller
>   is there a way to glue the bytecode (created with luac) together with lua?
>
>   (To get one file to give it to my users)

See my srlua:
        http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/index.html#srlua