lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Lua v5.3.4 compiles to appx 230k when built with optimisation (-Os) on my
system... which is quite compact, and is often touted as a primary benefit
for embedding the language.

As I've been hacking on Lua and adding more features this size has been
increasing, with all my patches I have just hit a megabyte in size in a
release build. However, it should be noted that a bulk of this size is in
the parser/lexer portion of the code. I have strived to make the runtime
portion of the code remain as lean as possible. I do not have numbers yet
but will be adding the ability to calculate the growth of the Lua binary,
including compiling with the parser/lexer and without, for all my patches.

I was wondering at which size would the Lua binary be considered "too large"
for embedding and the like. I am going to guess that this really would just
depend on the target environment... however, as I know there are people on
the list using Lua in embedded environs I thought I would get some feedback.

For embedded systems the parser/lexer could just be left out, obviously this
would require all necessary Lua code be pre-compiled (another good reason
for adding cross-platform bytecode genereration to 'luac' in my opinion). I
was also wondering if people who embed Lua precompile the source or not?

The target for my Lua variant is game engines, so while embedding is not
necessarily my target audience I am just curious about embedded use cases.
I am also curious just at which point people consider the binary to become
"bloatware" vs the vanilla binary size.

Thanks for your thoughts!

~Paige