Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Quigibo

Pages: 1 ... 14 15 [16] 17 18 ... 135
226
The Axe Parser Project / Re: Features Wishlist
« on: October 04, 2011, 05:29:35 am »
I like that idea calc!  Although I think the ! and ? are both confusing since they mean other things.  Perhaps some other symbol?  Although, yeah, that would be quite a monster to implement... and not entirely clear when to use each one for a beginner.  Also, this would be difficult to logically chain conditions together with and and or, or what to do when more code follows the statement.

227
Keep in mind that the new peephole optimizations make most of the speed/size data for individual atoms of the language inaccurate without context.  But this is still a good guide for general optimization.

228
The Axe Parser Project / Re: Axe Parser
« on: September 30, 2011, 05:38:25 pm »
I've finally figured out how to easily and intuitively allow stack usage for Axe programs that's so easy, even beginners can do it  ;D

Its so simple, I don't know why I didn't think about it before.  The syntax will simply be "keep(EXP1,EXP2)".  All it does is evaluate expression2 and then return expression1.  You might be like "Wait, what?  That seems so pointless, why can't I just do EXP2:EXP1 then?  Isn't that the same thing?"  The answer is no.

Consider this:
Code: [Select]
A->B:B->A
In that example, first, A is stored to B and then B is stored back to A again.  Not useful at all.
But now consider this:
Code: [Select]
keep(B,A->B)->A
What happens now?  You might think that since keep returns the first expression B and then stores it to A that its still the same piece of code. But no!  Keep evaluates B first and then keeps that value until the end of the keep.  So even though B changed value during the 2nd argument, the original B is returned and stored into A.  In other words, this is how you perform an exchange with only 2 variables, and its 4 bytes smaller than using an extra one too!

So where is the original value of B stored then?  That's what the stack is, but you don't need to know that.  All you need to know is that keep is magical and super efficient for this kind of thing.

EDIT: OOOOH, I just realized you can also make recursive function calls with this!  O.O
Code: [Select]
:Lbl FUN
:keep(r1,keep(r2,FUN(r1,r2)->r3)->r2)->r1
:Return r3

229
The Axe Parser Project / Re: Features Wishlist
« on: September 30, 2011, 04:56:13 pm »
Freyaday, I don't understand what you're trying to do in the code snippet.  What I think you might be trying to do is allow:
Code: [Select]
:If A
:Stuff
:End
to be written as:
Code: [Select]
A?Stuff
If so, that would not be physically possible due to the way Axe uses the stack.  There are several commands which MUST be "stack free" in order to run, Goto and Return are 2 of them.  This is the same reason why you cannot use those commands in a single argument for loop, so your first example would never work.  Some commands could work in there, but I would rather not use those since writing it the standard way is FAR less limiting.

I don't see the difference between the loop counter in a for loop and the regular for loop other than the fact that because it counts backwards to zero it can be slightly more optimized.  The single argument for loop as you are probably aware does not use a 16 bit register format, and requires 4 bytes of instructions to convert, and another 3 to write to the variable.

However, even though I don't think its necessary, I could always add a new 2-argument for loop For(A,5) for instance that counts down from 4 to zero (5 numbers total).  This might save around 3 bytes compared to a typical for loop since it doesn't need the subtraction

230
Axe / Re: Axe Q&A
« on: September 30, 2011, 06:37:59 am »
Theoretically, it could be abused, but it wouldn't be any more optimized than a regular if statement, just more cluttered and less readable.  I added the ? and ?? as operators specifically to avoid chains of if/while statements like If A:If B:If C:something:End:End:End should just be if A?B?C:something:End.  I don't want to allow intentionally misleading code as legal syntax when there is already a better way to represent it.

231
Some of those are already fixed/implemented.  Some are purposely left out.  Should I edit it to reflect changes, at least in the discussion tags?

This is a great idea though, to keep them in a neat list, it should make it easier for me to find things to improve.  But I think it is currently cluttered with a lot of things that I have no intention to add at any point in the future.  A lot of the feature requests are just way too specific to be included internally.

232
Axe / Re: Axe Q&A
« on: September 29, 2011, 10:19:19 pm »
Code: [Select]
A?Pt-On(X,Y,Pic1)Is supposed to throw an error?  It seems like every time I try to do a Pt-blarg() it errors x.x

Yeah that should error.  That's like saying "A and Pt-On()" which doesn't make any sense since Pt-On() doesn't return a value.  In general, you can only use Axe commands that start with lowercase letters inline.  Uppercase commands have to start from a new line.

233
Miscellaneous / Re: Why Johnny Can't Code
« on: September 27, 2011, 05:32:29 pm »
I don't know if it was mentioned in this thread yet, but I used to use YaBasic for windows which is even easier to learn than TI-BASIC.  Its also very small (the entire interpreter is under 300KBs) so it has the ability to imbed the interpreter and your code into a single executable for portability.  Its also really fast by BASIC standards; I made an entire 3D engine using it.

234
The Axe Parser Project / Re: Bug Reports
« on: September 26, 2011, 05:49:05 pm »
Whaaaaaaaaat!  It was just working!  I swear!  One sec.

Eh... I'd rather keep string parsing simple for now, so no multi character tokens.

EDIT: That was it Runer, I just found it lol.  That's what I get for coding so fast  <_<

235
The Axe Parser Project / Re: Axe Parser
« on: September 26, 2011, 05:34:23 pm »
Yeah, all the new zoom option does is disable the peephole optimizations, which makes it both slower and larger (but only slightly).  As Runer suggested, its really only for testing purposes in large programs that otherwise take a really long time to compile.

I'm just getting started with the more major peephole optimizations.  Some optimizations, like for instance 2->A:{A+L1}->B now automatically optimize to {2->A+L1}->B , which should help make code more readable.  The fact that finding optimizations like this is getting significantly harder to do in the disassembly means that Axe is inching closer and closer to the ASM limit.

236
The Axe Parser Project / Re: Bug Reports
« on: September 26, 2011, 05:30:20 pm »
That makes so much sense now, lol!  I can't believe you were able to get that from disassembly, awesome job!

Those other 2 are not bugs though:

Tokens that are more than 1 character are clipped to create their character counterparts.  For example, the token "det(" just turns into "d" to make it consistent since these are character strings, not token strings.  Also, this is the same routine used for individual character reading in single quotes so it wouldn't make sense there either.

The 'var' token is not a 1-to-1 mapping to a character in a searchable string form.  There is an extra zero that has to be added.  It is handled separately in the string parsing routine instead, just like the string, matrix, and custom list tokens.

237
The Axe Parser Project / Re: Latest Updates (***DO NOT POST HERE!***)
« on: September 26, 2011, 04:57:32 pm »
Axe Parser
Omega 1.0.5b



New Features:
  • Press [zoom] for a speedy fast (but less optimized) compile time!

Changed:
  • Fixed compile error when overwriting an archived executable.
  • Fixed error with random 'r' appearing in strings.
  • New peephole optimizations should reduce executable size another percent or so.

EDIT: Okay, now it should be good...  ::)

238
The Axe Parser Project / Re: Bug Reports
« on: September 26, 2011, 03:19:03 am »
Horizontal should only be unnoticeably faster... regular multiplication was the only routine that received a significant speedup, but only when you don't use ** or *^ anywhere in the code.

I've fixed the A429992 error now, I'll upload the patch soon.  I just need to find a couple other easy things to add to make the update have some kind of new features.  For that other problem, could you post some source code that caused the error (if it was indeed the compiler's fault)?

239
The Axe Parser Project / Re: Axe Parser
« on: September 25, 2011, 09:08:47 pm »
There is enough space (I have about 5KB left on the 2nd page) and I think Floppus suggested I could include it at some point.  I just don't think its that high on the priority list right now since how often do you need to send someone an app without a computer?  I'd rather spend the time fixing known bugs and you can always add DuckSign to your calculator separately.

240
The Axe Parser Project / Re: Axe Parser
« on: September 25, 2011, 04:57:52 pm »
Thank you SO much!  I can now narrow down the problem. :)

Axe apps still need to be signed to transfer to another calculator, but at least it won't delete itself.

EDIT: HAHA!  I found it!  Turns out the problem was that TI's "DelVarArc" bcall re-locks flash again whenever it deletes from flash.  My flash unlocking routine was above it, so all I had to do was move it down after that call.  Has anyone gotten the random 'r' error yet with 1.0.4?

Pages: 1 ... 14 15 [16] 17 18 ... 135