Author Topic: Features Wishlist  (Read 703677 times)

0 Members and 1 Guest are viewing this topic.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #2205 on: April 24, 2011, 10:04:37 am »
Runer, how do you suggest I do the token replacement?  The first problem I had was that you have to know ahead of time what Axioms are being used in the program so it knows what to replace.  That can easily be solved with your first suggestion of always requiring the Axioms to come first, but this does remove a possible convenience, however its probably worth it.  The next problem is that for each token the Axioms have to be searched for in the symbol table to find their pointers, which could be costly with a large number of programs.  Then, when finally found, each Axiom would have to be scanned completely to find if the token matches by transversing the offset list (again, for each token).  So if you had 2 Axioms with 25 new commands each, and about 20 tokens on the screen, that's 40 symbol table searches + 1000 checks + the built in checks.  I could definitely see this causing lag in the scrolling.  There might be another way of caching the data in ram somewhere, and maybe setup a binary search, but this would greatly complicate things.  The token hook is only called when tokens are being printed and I don't want to use other hooks so its difficult to have some sort of "pre-parsing".  I am however still open to suggestions of what to name the rest of the custom override tokens.

If there's a way to only parse any #Axiom( tokens immediately when the program editor is opened, that seems like a good route to take. You could get their pointers from the symbol table and cache them at the start, and you'd only need 3 bytes * 5 Axioms of cache storage. If there isn't a specific event that can be triggered upon opening the program editor, you can always fake it by hooking into an event that periodically occurs, but only acting upon it the first time it is triggered.


Your other suggestion, If I'm reading this correctly, is a static offset to optimize doing ld hl,dynamic_ptr; ld de,offset; add hl,de; correct?  This might be an option in the future.  There are other useful features I can think of too, like adding the ability to create Axioms that take a label as their first argument, like how the current interrupt setup command works.

Yeah, something like that. It would be more useful for doing offset calls though, like:
Code: [Select]
OFS_NEXT(7)
call sub_Axiom1
This is the sort of thing you often do with drawing commands so they can work with different buffers.
« Last Edit: April 25, 2011, 09:58:28 pm by Runer112 »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #2206 on: April 24, 2011, 10:28:30 am »
:D That is great, thanks. Does that optimize the program or just the source size?

Source only. Each Fix command is just a four-byte SET/RES instruction, and there's no way to combine them and have the result be smaller except in rare cases where you set a bunch of related flags at once.

EDIT: Four, not three. Not sure what I was thinking.
« Last Edit: April 24, 2011, 10:28:54 am by Deep Thought »




Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #2207 on: April 25, 2011, 10:05:52 pm »
Some more Axiom feature requests: the ability to specify commands that must be followed by a store token, and the ability to specify that the Axiom should be searched before the internal commands.

I understand that you didn't make Axioms parsed first because it would slow down parsing of normal commands, which would probably account for most of the program. But having it as an option would be useful. That way if your Axiom didn't supplement/replace any built-in commands, you wouldn't specify this option and parsing speed would be normal. But if your Axiom was designed to replace internal commands, you could do so by specifying this option.


Also, if you're going to modifying the Axiom system with any feature additions (not necessarily the ones above), it would probably be a good idea to start adding more information to the Axiom header, namely version information. This would signal to the Axe application parsing the Axiom whether or not the application's version is compatible. Adding an expanded header would also allow for the addition of more information, like whether or not to parse with a higher priority than internal commands. Perhaps:
Code: (Axiom header) [Select]
.db $C0,$DE ;Header bytes reversed so old Axe applications won't accept the Axiom
.db Axiom_version
;Possibly additional header data

Offline Compynerd255

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +53/-4
  • Betafreak Games
    • View Profile
    • Betafreak Games
Re: Features Wishlist
« Reply #2208 on: April 26, 2011, 10:29:02 am »
Here's a request that shouldn't be hard to implement: adding If conditionals to sub and Goto. Because this can be done in z80 ASM, it shouldn't be hard to optimize this:
Code: (Original code) [Select]
!If A-1
sub(FOO)
End
to this:
Code: (Optimized code) [Select]
sub(FOO)!If A-1

Also, I would like For loops to work with negative numbers (as a seperate option). For example, For(I,-1,1) is a legitimate loop (check the positions to the left, center, and right, for instance) but would end immediately. So, I would like to specify For(I,-1,1)r to show that the indexes are signed. Oh, and I would also like to specify custom steps in For loops, like we can in TI-BASIC.
The Slime: On Hold, preparing to add dynamic tiles

Axe Eitrix: DONE

Betafreak Games: Fun filled games for XBox and PC. Check it out at http://www.betafreak.com



Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #2209 on: April 26, 2011, 10:42:15 am »
As an addition to the signed For Loop, Could there be a loop that automatically increments negatively or positively so that the loop always runs?
Like, say,
For(Q,A,B,C)rr
where C>0, would increment by -C if A>B and C if A<B
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #2210 on: April 26, 2011, 04:47:07 pm »
Here's a request that shouldn't be hard to implement: adding If conditionals to sub and Goto.

I agree, that would be nice. I think Quigibo was contemplating adding this feature not long ago.

Also, I would like For loops to work with negative numbers (as a seperate option). For example, For(I,-1,1) is a legitimate loop (check the positions to the left, center, and right, for instance) but would end immediately. So, I would like to specify For(I,-1,1)r to show that the indexes are signed.

Having For() loops work with negative numbers would be sort of tricky and larger than normal loops, because signed comparisons are harder than unsigned comparisons. To have a loop like For(I,⁻1,1), you could just use a loop like For(I,⁻1+256,1+256) and change every reference of I in the loop to I-256. Alternatively, you can make a custom While loop that would be smaller and faster:
Code: [Select]
⁻1-2
While 1
  +2→I
  ;Your code goes here
End!If I-1

Oh, and I would also like to specify custom steps in For loops, like we can in TI-BASIC.

I've been wondering why Quigibo hasn't added that as well.

As an addition to the signed For Loop, Could there be a loop that automatically increments negatively or positively so that the loop always runs?
Like, say,
For(Q,A,B,C)rr
where C>0, would increment by -C if A>B and C if A<B

This doesn't seem like a loop structure that would be widely used, especially since modern programming languages don't have loops like this. This is the kind of thing that you would best build a custom loop for.
« Last Edit: April 26, 2011, 04:48:40 pm by Runer112 »

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Features Wishlist
« Reply #2211 on: April 26, 2011, 04:52:19 pm »
Oh, and I would also like to specify custom steps in For loops, like we can in TI-BASIC.

I've been wondering why Quigibo hasn't added that as well.
I suggested that awhile ago and got shot down hard. =/
Apparently, it was thought that While loops were an acceptable substitute.
As an addition to the signed For Loop, Could there be a loop that automatically increments negatively or positively so that the loop always runs?
Like, say,
For(Q,A,B,C)rr
where C>0, would increment by -C if A>B and C if A<B

This doesn't seem like a loop structure that would be widely used, especially since modern programming languages don't have loops like this. This is the kind of thing that you would best build a custom loop for.
Why shouldn't Axe be the first, then?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #2212 on: April 26, 2011, 04:57:01 pm »
As an addition to the signed For Loop, Could there be a loop that automatically increments negatively or positively so that the loop always runs?
Like, say,
For(Q,A,B,C)rr
where C>0, would increment by -C if A>B and C if A<B

This doesn't seem like a loop structure that would be widely used, especially since modern programming languages don't have loops like this. This is the kind of thing that you would best build a custom loop for.
Why shouldn't Axe be the first, then?

Because, in all fairness, that's not a very practical loop structure. Quigibo doesn't want to bog Axe down with commands that will rarely be used or can easily be otherwise produced with the existing features. Technically both For() loop feature addition suggestions qualify as being able to otherwise be produced, but the For() loop with a variable increment is a fairly widely used loop structure in many programming languages and I think would make sense to add.
« Last Edit: April 26, 2011, 04:57:34 pm by Runer112 »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #2213 on: April 26, 2011, 06:16:20 pm »
Here's a request that shouldn't be hard to implement: adding If conditionals to sub and Goto.

I agree, that would be nice. I think Quigibo was contemplating adding this feature not long ago.

His post:

For the goto-if and goto-!if I think I will auto-optimize the existing commands instead of creating entirely new syntax.  It would actually be easier I think to read and write and no one would have to change their syntax.  Same thing with sub().

Still not sure: does that mean this is now optimized? If so, I still want to suggest a Goto LBLIf CONDITION syntax, if only to have it look better. If Quigibo doesn't want to add it he doesn't have to though, if conditional Gotos are already optimized.

EDIT: Doesn't seem to be optimized yet... Goto LBLIf CONDITION, please? :D

EDIT2: Another suggestion: a hotkey to quit from compiling.
« Last Edit: April 26, 2011, 07:53:19 pm by Deep Thought »




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 #2214 on: April 26, 2011, 11:16:07 pm »
Actually I was planning to have for-loops have a step size parameter, but it will most likely have to be a non-negative constant in order to actually optimize.  I really think the syntax for conditional gotos and subs looks a bit ugly which is why I'm planning to auto-optimize it eventually.

Quote from: Runer112
You could get their pointers from the symbol table and cache them at the start, and you'd only need 3 bytes * 5 Axioms of cache storage.
To work reliably, this would require some other kind of hook other than the token hook which I'm trying to avoid.
« Last Edit: April 26, 2011, 11:16:45 pm by Quigibo »
___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 #2215 on: April 26, 2011, 11:17:57 pm »
Actually I was planning to have for-loops have a step size parameter, but it will most likely have to be a non-negative constant in order to actually optimize.
How about optimizing constants and having a less optimized version for non-constants?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Features Wishlist
« Reply #2216 on: April 28, 2011, 03:32:08 am »
My wish is longer labels and user-defined variables, like in assembly "Xpos .equ appbackupscreen" so in Axe that would be like "varXpos ==A" or so. Maybe you could replace the 'grp' token  with it, since its not really much used. (imo ;))
As for labels, try to make them 6 chars or so.
I'm not a nerd but I pretend:

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Features Wishlist
« Reply #2217 on: May 02, 2011, 02:43:05 am »
Not really a feature per se, but might it be possible to release a version of axe 0.5.1 that has the dispgraph bug fixed?

btw on the poll voted no, it would break compatibility with older programs.  As for easier reading, at least to me it's weird seeing a Pt-On( or For( with closed parenthesis :P
« Last Edit: May 02, 2011, 02:46:51 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: Features Wishlist
« Reply #2218 on: May 02, 2011, 02:50:11 am »
I also voted no on the poll. I feel like even though the size of the compiled program will be the same, I still prefer to have smaller source code if it's possible. Seems like closing all parentheses just for the sake of it is an unnecessary addition that would just add bytes to my source code and take away from my free ram.
There's something about Tuesday...


Pushpins 'n' stuff...


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 #2219 on: May 02, 2011, 02:59:39 am »
0.5.2 is coming out this week and I haven't actually gotten to fixing it yet so I think you'll have to wait until then.  Yeah, I forgot to mention that I added a new poll.  This is something big that I was thinking about since the start of the project.  I was avoiding the topic for a while though because I was afraid it was already too late to make a change like that, but I figured I would ask it anyway.  Even though it would break compatibility, it would be fairly easy to fix, and Axe could conceivably add extra closing parenthesis for you automatically as it compiles.

I actually already have been enforcing closed parenthesis on some commands.  I thing getkey(), all the # commands, and a few others currently require them closed right now.

EDIT: And ZippyDee, sig related! :P
« Last Edit: May 02, 2011, 03:01:31 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!