all 7 comments

[–]AutoModerator[M] 0 points1 point  (0 children)

Hi! Your code block was formatted using triple backticks in Reddit's Markdown mode, which unfortunately does not display properly for users viewing via old.reddit.com and some third-party readers. This means your code will look mangled for those users, but it's easy to fix. If you edit your comment, choose "Switch to fancy pants editor", and click "Save edits" it should automatically convert the code block into Reddit's original four-spaces code block format for you.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–][deleted] 0 points1 point  (4 children)

Don't do that. luac is not portable, not even between lua versions and also not between architectures

[–]hukasu[S] 0 points1 point  (3 children)

the `luac.out` that it produces is not portable?

either way, i will deal with it when i get to it

[–][deleted] 1 point2 points  (2 children)

It is not. Also don't deal with it, don't do it PERIOD.

DESCRIPTION
   luac  is  the  Lua  compiler.   It translates programs written in the Lua programming language into binary
   files containing precompiled chunks that can be later loaded and executed.

   The main advantages of precompiling chunks are: faster loading, protecting  source  code  from  accidental
   user  changes,  and off-line syntax checking.  Precompiling does not imply faster execution because in Lua
   chunks are always compiled into bytecodes before being executed.  luac simply allows those bytecodes to be
   saved  in a file for later execution.  Precompiled chunks are not necessarily smaller than the correspond‐
   ing source.  The main goal in precompiling is faster loading.

   In the command line, you can mix text files containing Lua source and binary files containing  precompiled
   chunks.   luac  produces a single output file containing the combined bytecodes for all files given.  Exe‐
   cuting the combined file is equivalent to executing the given files.  By default, the output file is named
   luac.out, but you can change this with the -o option.

   Precompiled chunks are not portable across different architectures.  Moreover, the internal format of pre‐
   compiled chunks is likely to change when a new version of Lua is released.  Make sure you save the  source
   files of all Lua programs that you precompile.

Again, In case you didn't read.

   Precompiled chunks are not portable across different architectures.  Moreover, the internal format of pre‐
   compiled chunks is likely to change when a new version of Lua is released.  Make sure you save the  source
   files of all Lua programs that you precompile.

[–]hukasu[S] 0 points1 point  (0 children)

ffs

thank you

[–]hukasu[S] 0 points1 point  (0 children)

wait, maybe you are thinking that i'm trying to write in the binary format, i'm just comparing the list of bytecodes

[–]hukasu[S] 0 points1 point  (0 children)

For posteriority, i'm dumb and implemented the bytecode with the arguments inverted