[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: stripping comments
- From: Paul Ducklin <pducklin@...>
- Date: Tue, 25 Jul 2023 20:59:49 +0000
If you want to strip comments to make the source shorter so you can embed it directly into your executable and save space…
…you could just compile it to bytecode with luac instead and load that.
(Sadly, Lua bytecode isn’t truly portable so you have to match the platform and version of compiler to the Lua runtime you embed it into. But compiled code is generally a fair bit smaller than the source, especially if you are liberal with comments.)
> On 25 Jul 2023, at 19:56, Kartik Agaram <ak@akkartik.com> wrote:
>
>
> Ah, that's perfect Milind. Thanks also to everyone else for the suggestions. I spent some time playing with them all. It looks like the answer to my original question is Lpeg, and a byte-by-byte state machine is necessary if I want to avoid native libraries.