Author Topic: Axe Q&A  (Read 588426 times)

0 Members and 2 Guests are viewing this topic.

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: Axe Q&A
« Reply #780 on: October 20, 2011, 03:10:00 pm »
I was going to keep it secret, but I'll tell you what I'm working on right now :)

Objects.  Axe currently only has one; the file (Using the Y0 - Y9 tokens).  I am creating a new object; the table (Using [A] - [J] tokens).  Its about time too, it was something I was trying to implement when I was first sketching out possible syntaxes before I started writing the parser.

A table is not a list, nor a matrix.  Its more like a SQL table if you're familiar with that.  The reason I'm able to have this structure in the first place is because I was finally able to optimize it enough given these invariants:

  • The table has a fixed column width, but can grow and shrink the number of rows.
  • The ordering of rows in the table should never matter and could change at any time.
  • An entry in the table cannot be accessed directly, it must be iterated to that entry to modify or delete it.

Iterators are nestable by the way.  This type of structure is perfect for situations where you have to manage one or more list of objects in a room or simulation.  This is exactly what you need for: Physics simulators, bullet code, collision detection, fluids, enemies, etc.  I think this will be a major major utility to coders and will bring the version up to 1.1.  Hopefully I can get everything working soon.
« Last Edit: October 20, 2011, 03:12:07 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: Axe Q&A
« Reply #781 on: October 20, 2011, 03:19:53 pm »
Wow, that looks really good! Also, i never knew about the y1-6 being file objects. guess theres still more to learn about the syntax.

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: Axe Q&A
« Reply #782 on: October 20, 2011, 06:51:26 pm »
Okay, wow O.O Tables sound incredibly useful.
« Last Edit: October 20, 2011, 06:51:42 pm by Deep Thought »




Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Q&A
« Reply #783 on: October 20, 2011, 06:52:51 pm »
This sounds incredible!!  I can't wait to see how I can use this in the future. :D

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: Axe Q&A
« Reply #784 on: October 20, 2011, 07:56:52 pm »
Oo0, sounds good. Where are these things gonna be stored and will we have to allocate them?
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 LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Axe Q&A
« Reply #785 on: October 20, 2011, 08:05:30 pm »
So will future versions of Axe be completely object-oriented? O.O
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



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: Axe Q&A
« Reply #786 on: October 20, 2011, 08:08:29 pm »
So will future versions of Axe be completely object-oriented? O.O
Only if you want it be, I guess.
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 Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Axe Q&A
« Reply #787 on: October 20, 2011, 10:55:12 pm »
I have a question:
so, you import OS var by doing this, right?
Code: [Select]
GetCalc("varA"->B
float{B}->A
Now, is there a way to store that A into constant?
Sig wipe!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Axe Q&A
« Reply #788 on: October 20, 2011, 11:03:44 pm »
Because you get the value of A at run-time, its value is dynamic and not constant at all; by definition it is impossible, and the closest to be had is recompiling the program at every run to fix in a certain value of A.
Edit: Fixed a typo of "it's" for "its". I blame you, Internet! <_<
« Last Edit: October 20, 2011, 11:06:48 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Axe Q&A
« Reply #789 on: October 20, 2011, 11:05:16 pm »
ah ok. :\
Freq(won't work with imported OS var for some reason
Sig wipe!

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Q&A
« Reply #790 on: October 20, 2011, 11:25:01 pm »
I have a question:
so, you import OS var by doing this, right?
Code: [Select]
GetCalc("varA"->B
float{B}->A
Now, is there a way to store that A into constant?
Close your parentheses properly. The pointer to the string "varA" is being stored into B rather than the result of GetCalc().
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Axe Q&A
« Reply #791 on: October 20, 2011, 11:26:37 pm »
!
Oops. Better fix that.
so after I correctly close the (), do I just do Freq(A,something
or Freq({A},something ?
Sig wipe!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Axe Q&A
« Reply #792 on: October 20, 2011, 11:28:21 pm »
A itself is the value, and is not a pointer, so the version without curly braces is correct.
« Last Edit: October 20, 2011, 11:28:30 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

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: Axe Q&A
« Reply #793 on: October 21, 2011, 05:37:47 am »
I have a question:
so, you import OS var by doing this, right?
Code: [Select]
GetCalc("varA"->B
float{B}->A
Now, is there a way to store that A into constant?

To answer the original question for the general case of GetCalc(), there actually IS a way to store it to a constant: you can copy the contents of the file to a known free-ram location (assuming the data in the file will fit there).  If done correctly, this can lead to both a speed and size optimization as well as making code easier to write since there are less arguments you need to pass around.  This of course comes at the cost of overhead loading time for the copy and reduces the amount of free-ram you have left.

EDIT: This probably wasn't the question you were asking, but it should help someone I'm sure.
« Last Edit: October 21, 2011, 05:39:46 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Axe Q&A
« Reply #794 on: October 21, 2011, 09:02:11 am »
So I did this:
Code: [Select]
GetCalc("varF")→X
GetCalc("varP")→Y
float{X}→F
float{Y}→P
freq(F,P)
Return
but it still won't produce the sound D: (I put 314 = F and 16384 = P)
does F or P have to be less than 255?
Sig wipe!