Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 09:58:09 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: LuaSrcDiet -  (Read 465 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
NecroBumpist
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 04 November, 2012, 07:02:18
Date Registered: 18 August, 2011, 05:44:50
Location: In my IDE, programming shit
Posts: 129


Topic starter
Total Post Ratings: +9

View Profile
« on: 21 August, 2011, 18:51:13 »
0

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

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 Smiley
Logged

Developing Lua scripts for the NSpire ?
Check out the Necrotorium
Need a few routines to run faster ? Checkout the MODS Lua Assembly Toolkit.
Need to save space for your scripts ? Checkout LuaSrcDiet
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: Today at 01:08:16
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1194


Total Post Ratings: +185

View Profile WWW
« Reply #1 on: 21 August, 2011, 19:02:18 »
0

Thanks for that link, definitely interesting !

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

Tongue
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 00:21:22
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #2 on: 21 August, 2011, 22:42:52 »
0

Yeah, very nice!
Thanks for the link Smiley
Logged

willrandship
Omnimagus of the Multi-Base.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 08 May, 2013, 01:10:38
Date Registered: 11 April, 2010, 03:08:32
Location: Between Venus and Mars
Posts: 2638


Total Post Ratings: +66

View Profile
« Reply #3 on: 22 August, 2011, 06:02:24 »
0

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 Tongue

Nice find!
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.178 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.