Omnimaga

General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: NecroBumpist on August 21, 2011, 12:51:13 pm

Title: LuaSrcDiet
Post by: NecroBumpist on August 21, 2011, 12:51:13 pm
NOTE: I did not make this, but since the NSpire does not have gigabytes of memory, I though I would share it with you guys

LuaSrcDiet (http://luasrcdiet.luaforge.net/)

I found this project a while back (It's made by the author of ANoFrillsIntroToLua51VMInstructions.pdf), and I think it could be of use for NSpire Lua developers.

Basically, what it does is it removes as much unnecessary information as possible.
This means removing whitespace, comments, and renaming/reusing variables whenever possible.

I just used it again on a script of mine that was 38,513 bytes long.
It outputted a file 21,899 bytes long.
That's a 41% reduction

Everything should run the same. (Though if you have an error it might be harder to figure out which variable it was really from)

So if you're looking to save space in large projects of yours, you might want to give this a try :)
Title: Re: LuaSrcDiet
Post by: Adriweb on August 21, 2011, 01:02:18 pm
Thanks for that link, definitely interesting !

I thought about making something like that before but never had the courage to actually code it...

:P
Title: Re: LuaSrcDiet
Post by: Jim Bauwens on August 21, 2011, 04:42:52 pm
Yeah, very nice!
Thanks for the link :)
Title: Re: LuaSrcDiet
Post by: willrandship on August 22, 2011, 12:02:24 am
So, you use this like you would the -O2 option on gcc: For finished products. Having problems catching bugs is fine once all the bugs are gone :P

Nice find!