• Features Wishlist 5 1
Currently:  

Author Topic: Features Wishlist  (Read 692230 times)

0 Members and 3 Guests are viewing this topic.

Offline Kiruahxh

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +1/-0
    • View Profile
Re: Features Wishlist
« Reply #2490 on: August 03, 2011, 03:07:23 pm »
Another idea, but not to include in the language : is there any computer asm code optimizer for z80 (based on output state and input state)?
I think it could decrease a lot the size of programs...
And there is no 8 bits maths, I mean that it would be cool to declare vars 8 or 16 bits; and for example to have
x = -x equal to x = 256-x when x is 8 bits, instead of 32656-x. This would be faster too I think.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #2491 on: August 03, 2011, 03:26:07 pm »
The #If and #End would be super easy to code, but what would be good symbols for those to replace?


I had two ideas for this:

  • The first and most obvious solution would just be to make 3 unrelated tokens the tokens for #If, #Else, and #End. The tokens under VARS → Table... could be useful for this, as it's a menu containing exactly 3 unused tokens. #ElseIf would probably just be a combination of #Else and the normal If. This method would have the advantage of looking nicer with Axe-tokenized code, but they would look pretty confusing without Axe token replacements like in SourceCoder.

  • My other idea would be to replace IS<( with #If and just use the normal Else and End. This would have the advantage of looking just about as good in something like SourceCoder and being easier to type on both platforms. However, the lack of hash marks preceding Else, ElseIf and End might be undesirable.
« Last Edit: August 03, 2011, 03:27:45 pm by Runer112 »

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: Features Wishlist
« Reply #2492 on: August 03, 2011, 04:51:33 pm »
The #If and #End would be super easy to code, but what would be good symbols for those to replace?


I had two ideas for this:

  • The first and most obvious solution would just be to make 3 unrelated tokens the tokens for #If, #Else, and #End. The tokens under VARS → Table... could be useful for this, as it's a menu containing exactly 3 unused tokens. #ElseIf would probably just be a combination of #Else and the normal If. This method would have the advantage of looking nicer with Axe-tokenized code, but they would look pretty confusing without Axe token replacements like in SourceCoder.

  • My other idea would be to replace IS<( with #If and just use the normal Else and End. This would have the advantage of looking just about as good in something like SourceCoder and being easier to type on both platforms. However, the lack of hash marks preceding Else, ElseIf and End might be undesirable.
I like your first option a lot better; I think Else, ElseIf, and End should have hashes in front of them.

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 #2493 on: August 04, 2011, 12:37:53 am »
The #If and #End would be super easy to code, but what would be good symbols for those to replace?
How about Pmt_Bgn and Pmt_End (in the Finance menu)? I can't see them being used anywhere else.
Also, octothorpe?  Haven't heard that used.
Lol I don't think that's the one usually used, especially in coding.
The convention I use when reading code aloud is:
Code: [Select]
# - Hash
! - Bang
* - Splat
/ - Whack
I love those terms :D Oddly appropriate too.




Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Features Wishlist
« Reply #2494 on: August 04, 2011, 02:41:02 am »
I think that the whole #If idea is very good. There, I have shared my two-cents.

Ashbad

  • Guest
Re: Features Wishlist
« Reply #2495 on: August 06, 2011, 11:53:22 am »
Quote
Also, octothorpe?  Haven't heard that used.
Lol I don't think that's the one usually used, especially in coding.

No, it's just called "hash".  Someone was trying too hard to sound smart when they used that one :P.  In fact, calling it anything other than "hash" or "crunch" usually makes other programmers look at you funny.

Also, here's my two cents on the new XXX.XXX decimal notation, with a discussion leading up to why I would prefer an XX.XX notation instead: http://ourl.ca/916578
« Last Edit: August 06, 2011, 11:54:05 am by Ashbad »

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 #2496 on: August 07, 2011, 06:50:44 am »
Ashbad, I disagree with that view.  You could make the same argument with regular floating point numbers in other programming languages.  When you type 0.7 for a float in Java or C++, it cannot represent 7/10 in binary and must perform rounding.  Does this mean we should instead represent it as some crazy decimal to avoid confusion?  I don't think so, the programer should always be expecting some rounding when doing floating point calculations.
___Axe_Parser___
Today the calculator, tomorrow the world!

Ashbad

  • Guest
Re: Features Wishlist
« Reply #2497 on: August 07, 2011, 09:09:13 am »
But if it was made to help TI-BASIC programmers translate easier, they would wonder why numbers like 255.998 and 255.999 are equal.  And then they have to lear about how floating point notatio. In Axe works with binary terms anyways.  Rather pointless?..

And when you type 7/10 in Java/C, it DOES equal 0.7f/d, not something like 0.66f/d.  You know as well as I do that's not a good comparison; the two forms of floating point notations work entirely differently, using different techniques (and in most languages, the amount of numbers that can be stored is already specified in digits, not in 256 base-units).  I.E: you know that 0.00000000001f and 0.00000000000002f are equal due to the digit length and the fact they'll either be treated as generic infitesmals or simply zero (possibly even throw a warning!); in axe, you don't know if two consecutive small numbers are equal, or even what they really represent.  5.001 is equal to 5.002 which is equal to 5.003, but why are they not equal to 5.004 then?  It's not sane.  It's pointless to have large precision for the hell of it when the user doesn't know what things will truncate to.  I still stick by the XX.XX argument.  The programmer should expect that high precision floating point numbers will retin their value; if there is rounding involved in the thousands place, and things are stored in 8.8 notation for high precision work, something is wrong with the implementation.
« Last Edit: August 07, 2011, 09:12:56 am by Ashbad »

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 #2498 on: August 07, 2011, 10:02:06 am »
It's fairly common knowledge that you shouldn't use equal/not-equal comparison for floating-point numbers, and this applies to fixed-point as well.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Ashbad

  • Guest
Re: Features Wishlist
« Reply #2499 on: August 07, 2011, 10:38:55 am »
It's fairly common knowledge that you shouldn't use equal/not-equal comparison for floating-point numbers, and this applies to fixed-point as well.

That's after operations like comparing a calculus function that simulates a sine function to a built in sine function, that could get things off by a few millionths per calculation.  Not by thousandths.  And, the main point is not returned values from operations being slightly off, it's that the programmer doesn't know the storing limit directly of thousandths FP numbers.  That's a large problem.  If there's an option for sot ring things to 3 decimal points, there should be assurance that everything in those 3 digit points will be completely represented, and anything past that won't do much.  XX.XX rules because you know everything will be represented fairly.  With XXX.XXX, that sixth X is really questionable because no one has an idea how it will be represented.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #2500 on: August 07, 2011, 11:10:14 am »
And when you type 7/10 in Java/C, it DOES equal 0.7f/d, not something like 0.66f/d.  You know as well as I do that's not a good comparison; the two forms of floating point notations work entirely differently, using different techniques (and in most languages, the amount of numbers that can be stored is already specified in digits, not in 256 base-units).

In Java, C, C++, and most other modern languages, 0.7 DOES NOT equal 0.7. They use binary-encoded floats, not decimal-encoded floats, and 0.7 cannot be perfectly represented in binary. If you don't believe me, check out this IEEE 754 converter. The number of decimal digits that can be stored in a regular float is 7.22. That's right, it's not an integer. Just like the number of decimal digits that can be stored in an Axe fixed-point number is 2.41. Java, C, and C++ don't throw an error if you enter an 8-digit float, so why should Axe throw an error if you enter a 3-digit decimal?


It's fairly common knowledge that you shouldn't use equal/not-equal comparison for floating-point numbers, and this applies to fixed-point as well.

This is very true. Just like you would never check if a float is exactly 112.453 after some calculation, you wouldn't check if a fixed point number is exactly 112.453.
« Last Edit: August 07, 2011, 11:13:50 am by Runer112 »

Ashbad

  • Guest
Re: Features Wishlist
« Reply #2501 on: August 07, 2011, 01:19:03 pm »
It's 7.22 because it can get an 8th, though you know that eighth has no usable purpose.  With Axe, if the XXX.XXX must stay, make sure to warn people that the sixth X is crap and never ever to use it.

And of course .7 doesn't equal .7 in binary.  But it doesn't equal .701 either.  You can't do it.. all that matters is the representation and that there is a given standard on how many digits you should go to.  Since Axe is a language used mostly by inexperienced programmers that haven't touched face with computer languages like C++ or Java, the third should be eliminated since the BASIC coders, who wont know anything about represented digits and how they work, will get confused (and the reason it was put in there was to make a nice transition for them?  Yeah, right, that wont confuse them whatsoever).  I'm not an idiot, I know how FP IEEE754 numbers work, and I know how many digits can be stored.  But if this is being added to cut confusingness for lower-experience Axers, then it's 1000% pointless and 50% stupid.  It's not even a good idea for advanced programmers, since it still doesn't represent numbers well enough for high-precision applications, so what's good about it again?  Those extra .41 digits could be used for something much more useful than storing another .41th of a digit, they could be used for flags and other commodities.

C and c++ (with decent compilers) usually have some sort of compilation option to check for over-extended FP numbers and warn at compile-time about them, so, yes they can.

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 #2502 on: August 07, 2011, 02:14:56 pm »
Well personally in BASIC I didn't use much decimals. 2 were enough for me, like 99.99. When I made a RPG, often I didn't even need this much precision for damage formulas anyway, especially that in the end I got rid of the decimal part.

Also for precision stuff, well... BASIC is so slow that I doubt a lot of people use more than 2 decimals to move stuff around. Most of the time they move stuff every few pixel.

Ashbad you need to calm down a bit, though. Don't become angry at people because they disagree with you. This leads to nothing good and Quigibo can do whatever he wants with his language anyway. (I didn't want the new token names to be added at first, and they went in anyway)
« Last Edit: August 07, 2011, 02:18:10 pm by DJ_O »

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #2503 on: August 07, 2011, 02:16:41 pm »
It's 7.22 because it can get an 8th, though you know that eighth has no usable purpose.  With Axe, if the XXX.XXX must stay, make sure to warn people that the sixth X is crap and never ever to use it.

The 3rd decimal digit of Axe fixed point numbers has a purpose. Try representing 1/256, a very useful number for transformations, without it. Or try representing 1/3. Whereas 0.33 would equal 84/256, 0.333 would equal 85/256, the latter of which is 4x more precise. I, and I believe many others, would not want to forfeit this additional precision. Saying that the 3rd decimal digit doesn't matter is like telling someone to ignore the units digit of a 3-digit integer.

If you limited numbers to 99.XX, people will think 99.99 is the maximum number possible, although it's really 255.997. If you thought they'd be confused when 0.138 equals 0.139 (I'm simply obliging your suggestion here; not once in my programming experience have I seen someone check for exact equality to a number with more than one decimal place), think about the confusion caused when they learn that, in a system that presents itself as a mod 100 system, 50+50 doesn't overflow. And I know you might suggest having BCD math routines for this purpose, but there are multiple problems with this. To list the ones that come to mind:
  • Bloated code in regard to both size and speed.
  • Cannot optionally interpret the highest bit as a sign bit to easily use signed and unsigned numbers interchangeably.
  • Most importantly, Axe doesn't have types (and it shouldn't, it's much more flexible and optimizable without them), so there's no way for Axe to know if you're operating on a BCD number. Every single operation Axe has would need to have a second token representation for the BCD operation. Weigh the following: which would be more confusing? 0.138 equaling 0.139? Or + not equaling +?



EDIT: As a note, I just want to mention that I'm not dragging this out for the sake of trying to prove anybody wrong. I just think it's simplest to leave fixed point numbers the way they are.
« Last Edit: August 07, 2011, 03:24:53 pm by Runer112 »

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Features Wishlist
« Reply #2504 on: August 08, 2011, 11:28:18 am »
I'll agree with Ashbad that the loss of precision in the third decimal digit will probably confuse some people. Perhaps just a mention of this in the readme would do?