• Features Wishlist 5 1
Currently:  

Author Topic: Features Wishlist  (Read 690971 times)

0 Members and 4 Guests are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #450 on: April 11, 2010, 12:56:48 am »
In cases like this though, it could make the compiled size smaller if you are using enough options, because it can use a table of jumps instead of a bunch of, well, if statements
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #451 on: April 11, 2010, 12:58:22 am »
OOooh! ok I see! It would be MUCH handier this way! Much easier to read and to code.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Features Wishlist
« Reply #452 on: April 11, 2010, 02:10:47 am »
In cases like this though, it could make the compiled size smaller if you are using enough options, because it can use a table of jumps instead of a bunch of, well, if statements
Right, its much more efficient in an assembly program to do switch statements than a bunch of if statements.

Unfortunately, it would be way too hard to automate this into the parser since its not just simple templated code.  It would have to check all the conditions in the beginning (non-linear parsing) and then create a jump table to each of the switch labels.  It's just way too complex to code and it would need a lot of extra memory.  I mean I could just do it as something that just makes it "easy on the eyes" but I don't feel like its worth the extra effort.  ElseIf statements should take care of this for the most part anyway.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #453 on: April 11, 2010, 02:14:34 am »
In cases like this though, it could make the compiled size smaller if you are using enough options, because it can use a table of jumps instead of a bunch of, well, if statements
Right, its much more efficient in an assembly program to do switch statements than a bunch of if statements.

Unfortunately, it would be way too hard to automate this into the parser since its not just simple templated code.  It would have to check all the conditions in the beginning (non-linear parsing) and then create a jump table to each of the switch labels.  It's just way too complex to code and it would need a lot of extra memory.  I mean I could just do it as something that just makes it "easy on the eyes" but I don't feel like its worth the extra effort.  ElseIf statements should take care of this for the most part anyway.
My idea was that it would be required to be from 0 to some number N, and the values must be typed in increasing order. Any missing numbers would jump to the "default" tag
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Features Wishlist
« Reply #454 on: April 11, 2010, 02:41:50 am »
hmm... If they are forced to be in order from 0 to N that would greatly simplify the statement.  But since the parser doesn't know how many labels are in the switch statement, I would have to dynamically expand the table in the end of program location.  And I think I would still need nonlinear parsing.

What I could do is have the switch statement require labels in the program which would take the burden off of the parser and into the programmer's hands.  Something like this:

Switch(A,J0,J1,J2,J3)

Lbl J0
...

Lbl J1
...

etc.

Here, if A is 0, it jumps to label J0, if A is 1, it jumps to label J1, etc.  You can choose any labels you want (including identical labels) and the variable you are comparing can be any expression.

Would this be useful to anyone though?  It does kind of limit the usage a little bit.
« Last Edit: April 11, 2010, 02:47:24 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Features Wishlist
« Reply #455 on: April 11, 2010, 10:57:17 am »
Hmm...

I can't really see the purpose of this command...

What are the benefits of having this over saying If A=0:End, etc... ?
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #456 on: April 11, 2010, 12:28:43 pm »
Hmm...

I can't really see the purpose of this command...

What are the benefits of having this over saying If A=0:End, etc... ?
It would produce faster and smaller z80 code.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Features Wishlist
« Reply #457 on: April 11, 2010, 12:31:53 pm »
Does the parser support conditional form:

While (A=0)(B=0)(C=12)

cuz i use that alot now.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #458 on: April 11, 2010, 12:35:21 pm »
Does the parser support conditional form:

While (A=0)(B=0)(C=12)

cuz i use that alot now.

You will need to put an "and" between each of those statements (there is no implied multiplication in Axe, and you will want to avoid multiplication for speed reasons anyway)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

_player1537

  • Guest
Re: Features Wishlist
« Reply #459 on: April 11, 2010, 12:35:58 pm »
well, you would have to put a '*' symbol in between those, but yes that would be valid (I'm pretty sure at least)

Edit: Yeah, what calc said would be better
« Last Edit: April 11, 2010, 12:36:54 pm by _player1537 »

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Features Wishlist
« Reply #460 on: April 11, 2010, 12:56:38 pm »
Yeah, multiplication can really destroy the speed of a program.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #461 on: April 11, 2010, 01:35:05 pm »
I assume this excludes multiplication by 2, right?

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Features Wishlist
« Reply #462 on: April 11, 2010, 01:40:52 pm »
Of course.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Features Wishlist
« Reply #463 on: April 11, 2010, 04:08:24 pm »
also excludes multiplication of 3,4,5,6,7,8,9,10,12,16,32,256 and more in the future. (see optimization tips)  Also, the multiplication is only optimized if the constant is on the right!  So 2*A is just as slow as regular multiplication.  You need to do A*2 to get the speed and size benefits.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Features Wishlist
« Reply #464 on: April 11, 2010, 06:17:43 pm »
So, wait. I can't even multiply this type of a function for attack power:

1.5*L [store] B

Where L is your level and B is your attack booster.


And can variables in Axe hold fractions (as in 1.34) as a value.