builderboy2005 wrote:
Yeah this sounds like a whole project just on its own rather than a section of a larger program. For now i think i am going to focus more on the simpler optimizations, and gradually work my way up towards the more complicated ones. Like optimizing =0 into Not() is a medium challenging one, since you still need to count for order of operations, but it is a ton simpler. Also things like If+Store optimizations and If:then optimizations exc...
Definitely, and we can separately discuss what's feasible to put into SourceCoder. What new is implemented in your program, or haven't you gotten an opportunity to do anything new with it lately? Smile
Right now everything mentioned in the first post is what is currently added Smile Im going to work on negative canceling (should be pretty easy) and divisions by 10 using the sub() trick
builderboy2005 wrote:
Right now everything mentioned in the first post is what is currently added Smile Im going to work on negative canceling (should be pretty easy) and divisions by 10 using the sub() trick
Cool deal, I hope you give us a version we can play with soon. By negative canceling, you mean -A+B to A-B? Or do you mean A-(-)B -> A+B?
Its A-(-)B -> A+B and A+(-)B -> A-B. And i didn't realize that sub() was a two byte token, and so there really isn't any place where it can be used for optimization Sad

I have the concept working for #=0 into Not() but it seems i will need to make two large tables for things that have a parenthesis and things that are found in an expression :/
Meh, that's a pain, and yeah, sub() is a two-byte token. What about converting 0.NNN to .NNN? That wouldn't be a bad one...
Ah, good idea, ill put it on my list of things to do Smile And then once i get all the easy ones finished ill post a little demo, so people can help me find those really weird exceptions that are no doubt going to be there x.x
builderboy2005 wrote:
Ah, good idea, ill put it on my list of things to do Smile And then once i get all the easy ones finished ill post a little demo, so people can help me find those really weird exceptions that are no doubt going to be there x.x
Sounds like a plan. My concern with this kind of thing, of course, is that I worry beginners wouldn't know about the program, and people who knew about it would already automatically do all these things themselves. That's one of the things that's held me back from investing the time into improving SourceCoder's optimizer.
Alright crosspost from Omnimaga Smile

Alright ladies and gents, this is the moment you've all been waiting for! I am releasing a beta of the Optimizer App Feel free to try it on all your programs and test them out to make sure i didnt break them XD Im also including the source because it has a really handy program browser built into it and that was very difficult to make. Props to Buckey for all the help he gave me with the Vat entries! ^^

These are the codes it optimizes in this version:
Ending brackets, braces, and parentheses
Powers of 10 and other large constants
Squared and Cubed
Eliminating Empty lines
Delvar
Negative/Positive canceling

And here is a screenie of it in Action!



and the Zip with the source and the App

http://www.omnimaga.org/index.php?action=dlattach;topic=4300.0;attach=3119
Wait, why is it an app? That seems a bit unnecessary to me; how big of a program would it be? Very nice regardless, though. I feel like trying to write a duplicate in pure ASM with DCS and see if I can get it to be a few KB. Razz
Haha it's an app just because I felt like it, and I wanted it to be out of the vat in case I accidentaly messed it up Razz the total program size is really only 3000 - 4000 bytes
builderboy2005 wrote:
Haha it's an app just because I felt like it, and I wanted it to be out of the vat in case I accidentaly messed it up Razz the total program size is really only 3000 - 4000 bytes
Ahhh, good, that's much more reasonable. Smile You could have asked me about VAT stuff, btw; I would have been more than happy to share my low-level knowledge. Smile Do you anticipate the final version(s) being an app as well, or might there be a program released?
It will probably be a program, although its the kind of program you might like to keep on your calc at all times, and have it not get in the way, so there is the appeal of an app for this type of program. I'll have to see what the final size is and decide if its worth it or not.

And Buckey was a great help Smile I dont think you were on at the time i wrote this last night.
Ah, fair enough. Well, I'd be happy to assist in any similar circumstances in the future. Smile Aight, I look forward to seeing how it evolves. I feel like a lot of people would be willing to use 4K of archive, but maybe not as much a full app space, particularly on a TI-83+ with only 10 spaces.
Alright this is going through a rewrite as i type. Instead of searching through the program token by token, it now goes through the program optimization by optimization. This is because i discovered an axe command that will search a file for a specific value (token) lightning fast! This will make the program a lot faster, and will also make it a lot easier to add optimizations Smile
builderboy2005 wrote:
Alright this is going through a rewrite as i type. Instead of searching through the program token by token, it now goes through the program optimization by optimization. This is because i discovered an axe command that will search a file for a specific value (token) lightning fast! This will make the program a lot faster, and will also make it a lot easier to add optimizations Smile
That's awesome to hear! Can you describe quantitatively some of the time differences between the two methods?
Well im not sure just yet how fast the methods compare to, but with this new command it can traverse over 9000 bytes of code in less than a second! Put in a 9000 byte program into the older version and it takes a lot longer Smile
builderboy2005 wrote:
Well im not sure just yet how fast the methods compare to, but with this new command it can traverse over 9000 bytes of code in less than a second! Put in a 9000 byte program into the older version and it takes a lot longer Smile
That's excellent (and good choice of size Wink). I presume the parser stuff is still on the sidelines for now?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement