Frontpage News wrote:
Around eight months ago, I began work on a project to chart all of the TI-83/+/84 tokens into a PHP array and human-readable format. After about seven months of progress in decoding the token system, excellent typing inputting help having come from wizard3246, I had a complete chart and a rudimentary interface for importing programs and outputting HTML. After adding a BBCode, Invision BBCode, and HTML boxes for copying and pasting output, I deemed it SourceCoder v1.0 and released it to the public. ticalc.org decided to feature it, in the interim of which I made an image parser that renders .gif, ASCII art, and z80 ASM-compatible code. I began making it modular by providing support for several types of files, and it eventually came to support every type of .83* and .8x* file available. At the same time, Brazucs, a recently-minted staff member at UnitedTI.org, began working on a project to convert the badly-tokenized code generated by GraphLink into readable Unicode for use on forums. As I began v2.0 of SourceCoder, I planned to have a focus on editing and optimizing capabilities, since it is a Basic Elite project after all. After making substantial progress, and noting that Brazucs was making great strides towards a working optimizer and syntax-highlighter, he approached me with a proposal that we join forces to make a single complete and superior SourceCoder. After a bit of discussion, since I am normally wary of such partnerships, I agreed. The project will retain its name of SourceCoder, its home here, and the current forum here, but it will now be subtitled optiBasic and include all of the breakthroughs Brazucs has made. With this, I am releasing the first public link to SourceCoder v2.0 beta:

SourceCoder v2.0 Beta
works great I think, might do some optimizing on my programs, it found some that could be done on my programs
Darn, you beat me to it. Wink

Great job Kerm!
Thankee much all. We shall see what happens...
Problem:
Program Code wrote:
...
:H-.1(H>0?H
:Line(10,10,10-H,10,0
:Z+1?
...
SourceCoder 2.0 Beta Optimized Code wrote:

:H-(H>DelVar HLine(10,10,10-H,10,0
:Z+1?

There should be a "Z' at the end of the 3rd line, and ":H-(H>DelVar HLine(10,10,10-H,10,0" obviously gives a syntax error.
Very Happy Ok, I see why. To make a delvar, it looks for 0-->[A-Z]. I can just add a limiter for a ':' or 'r [A-Z]' necessary before the 0 (that is, newline or previous DelVar command.
Glad to be a part of it all Smile
you could just have it search for DelVar [a-z][space].
But I want it to convert 0-->[A-Ztheta] to Delvar \1...
KermMartian wrote:
But I want it to convert 0-->[A-Ztheta] to Delvar \1...


why? isn't that slower? usually 0->something is done to initialize the variable at the beginning - deleting it means that later on, when its first used, it will have to be created again - i seriously doubt that deleting/creating cycle is faster than storing zero to it
sixe,


Code:
0->A

would take up 3 bytes


Code:
delvar A

is 2 bytes

also after delvar, you can put another statment, saving another byte
Delvar is equivalent to 0-->var: if you delvar, you actually create it and initialize to 0 at the same time.
KermMartian wrote:
Delvar is equivalent to 0-->var: if you delvar, you actually create it and initialize to 0 at the same time.


not to argue or nothing, but i don't think it re-creates it to 0 at the same time. Incase you didn't notice, when you delvar, you get more RAM - this is impossible if it re-creates it to 0 Wink

as for the 2bytes vs. 3bytes (i would never, ever put anything besides another delvar statement right after a delvar - talk about hard to read!), i would rather take the extra speed for a measily byte
OK, let me rephrase that. When you delvar, you do delete the var, but when you first use it, you implicitly create it and set to 0.

eg:
:Delvar A1-->B
:A+B-->A

puts 1 in A.
KermMartian wrote:
OK, let me rephrase that. When you delvar, you do delete the var, but when you first use it, you implicitly create it and set to 0.

eg:
:Delvar A1-->B
:A+B-->A

puts 1 in A.


...did you even READ what i said??? I KNOW that happens! I was saying that it would be SLOWER, as it would have to be deleteted AND created!!! BASIC IS SLOW ENOUGH, DON'T SLOW IT DOWN MORE!!!!!! (and definitely don't call a slowed-down version "optimized" because it shaved 6 bytes Mad )
1000 test on a TI-84+SE:

Code:
:Delvar X
:Repeat X=1000
:DelVar Z
:X=1->X
:End

Finishes in about 11.3 seconds and takes up 33 bytes of RAM.

Code:
Delvar X
:Repeat X=1000
:o->Z
:X+1->X
:End

Finishes in about 12.4 seconds and takes up 33 bytes of RAM
Results are self-explanatory. Try it yourself.
Note that the code isn't completely optimized for readability reasons. ("I would never, ever put anything besides another delvar statement right after a delvar - talk about hard to read!")
Roughly 1 second isn't bad (precisely 0.001 seconds extra for the delvar...)
Kuro wrote:
1000 test on a TI-84+SE:
Code:
:Delvar X
:Repeat X=1000
:DelVar Z
:X=1->X
:End

Finishes in about 11.3 seconds and takes up 33 bytes of RAM.
Code:
Delvar X
:Repeat X=1000
Surprised->Z
:X+1->X
:End

Finishes in about 12.4 seconds and takes up 33 bytes of RAM
Results are self-explanatory. Try it yourself.
Note that the code isn't completely optimized for readability reasons. ("I would never, ever put anything besides another delvar statement right after a delvar - talk about hard to read!")


you miss a major point, I ran a similar program, but after the 0->/delvar, I had it display, and the 0-> beat dlevar by over 15 seconds per 1000, there is a diffrence.
Delvars are 1 millisecond slower (oh, no! Surprised ), but are more mem-efficient. [/debate]
rivereye wrote:
Kuro wrote:
1000 test on a TI-84+SE:
Code:
:Delvar X
:Repeat X=1000
:DelVar Z
:X=1->X
:End

Finishes in about 11.3 seconds and takes up 33 bytes of RAM.
Code:
Delvar X
:Repeat X=1000
Surprised->Z
:X+1->X
:End

Finishes in about 12.4 seconds and takes up 33 bytes of RAM
Results are self-explanatory. Try it yourself.
Note that the code isn't completely optimized for readability reasons. ("I would never, ever put anything besides another delvar statement right after a delvar - talk about hard to read!")


you miss a major point, I ran a similar program, but after the 0->/delvar, I had it display, and the 0-> beat dlevar by over 15 seconds per 1000, there is a diffrence.

Had it display what? And for the record, I did this with a stopwatch (the built-in timer only counts seconds) so the times are approximate.
  
Page 1 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