Author Topic: Features Wishlist  (Read 615514 times)

0 Members and 6 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #90 on: February 07, 2010, 12:49:54 am »
Keep in mind, though, that most of us have little to no asm knowledge, though, so it is hard for us to figure out why something will work and why it won't, and while it can be easy for some people to understand some stuff it can be much harder for others, not to mention there's a lot of info so eventually we forget some stuff. You have to understand that and make sure to not make people feel bad in any way. We don't want to scare away users from the forums (or from contributing to these project topics/ideas) after all. We welcome everyone, regardless of if they understand quickly or not.

That said good luck with your stuff including school and the like, I hope they won,t overload you with too much projects and stuff x.x
« Last Edit: February 07, 2010, 12:50:54 am by DJ Omnimaga »
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

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 #91 on: February 07, 2010, 10:32:55 am »
I never heard of tokenized sprite before x.x
DJ, this is what the calc stores Asm Programs in as AsmComp( takes them from Hex to Tokenized binary.
It basicly combines two hexadecimal numbers into one token.  Therefore, it's twice as small. :)

Have fun being busy. Good luck! ;D
« Last Edit: February 07, 2010, 10:53:09 am by ztrumpet »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #92 on: February 07, 2010, 02:20:39 pm »
Aaah that, I see. I always thought it was "compiled" or "squished" (the first is because of the Comp part of the AsmComp( command and the later is because some ASM programmers said "squished" ASM programs to define non-hex ASM program format.)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

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 #93 on: February 09, 2010, 06:45:40 pm »
I have a suggestion for the parser. You should have a character (I'm thinking "?") that acts as an operation modifier, for things that can possibly have more than one use. For example, "?>" could be used as signed compare, and "? or " would be bit-wise or, while " or " would be boolean or. It could also be used in strings as an escape character, for example ?" would put a quotation mark in the string and ?X41 would put the character 0x41 (or "A")
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #94 on: February 09, 2010, 07:09:16 pm »
Great idea!  I assume you mean strings would look like this: "Part 1"+?41+"Next Part"+Str1  If Str1 was "Hi" then it would result as "Part 1ANext PartHi".  Sounds cool. :D

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #95 on: February 09, 2010, 07:19:46 pm »
I'm confused what would it do x.x

I would need concrete examples of it in action to figure out x.x, as I am more visual
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

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 #96 on: February 09, 2010, 07:25:56 pm »
Great idea!  I assume you mean strings would look like this: "Part 1"+?41+"Next Part"+Str1  If Str1 was "Hi" then it would result as "Part 1ANext PartHi".  Sounds cool. :D
Actually, I was thinking "Part1?X41Next Part"+Str1. The X might not be necessary I guess, but it might simplify parsing. To put a question mark in a string, you would use "??"
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Features Wishlist
« Reply #97 on: February 09, 2010, 07:29:59 pm »
Usually what escape characters are for is for getting 'illigal' characters into strings, like -> or ".  Generaly speaking anything after an escape character is ALWAYS considered to be text, no matter what.  so "?->" would be a string containing the -> character.  It could also be used to access characters that are not type-able, like the percent sign or perhaps even the newline character.

Other uses it has is keeping up with the limited tokens that we have to work with.  If we wanted to be able to do both Bitwise OR and Boolean OR, without the escape character (which in this case can modify functions) we would need two different tokens for the two different functions.  With this escape/modifier, we could have individual tokens mean different things.

(And to get the ? character in your string, i guess you would have to do ?? in your string :P)

EDID: Ninja'd by Calc84

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 #98 on: February 09, 2010, 08:16:10 pm »
The next version has already taken care of getting 'illegal' characters into strings using standard tokens.

Let me just explain signed vs unsigned so it doesn't confuse anyone.  All the numbers are unsigned meaning they represent a number between 0 and 65535.  Negative numbers act just like the regular numbers counted backwards instead of forwards, that is -1 is really 65535, -2 is really 65534, etc.  This allows normal subtraction and addition with negative numbers that everyone is used to.

That's all well and good until you have a statement like -1<1.  That would actually be false since 65535 is not less than 1.  You can get around this by doing a 'signed comparison' which is what calc84maniac is talking about.  The limitations with signed comparison is that your numbers can only be half the size, that is -32768 to 32767.  So you would not be able to use the signed comparison (and get the correct answer) if the number is too large or too small.

This is an good idea to implement, but I think I would want it more intuitive than a question mark.  Maybe something like -1<<1 would be better?  Repeating any operation twice will do the signed version of the operation.  So -4<<2 equals 1 and -2**8 would equal -16.

Oh and by the way, bitwise and Boolean or are identical, there is no reason to separate the 2.
« Last Edit: February 09, 2010, 08:18:34 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 #99 on: February 09, 2010, 11:38:20 pm »
The next version has already taken care of getting 'illegal' characters into strings using standard tokens.

Let me just explain signed vs unsigned so it doesn't confuse anyone.  All the numbers are unsigned meaning they represent a number between 0 and 65535.  Negative numbers act just like the regular numbers counted backwards instead of forwards, that is -1 is really 65535, -2 is really 65534, etc.  This allows normal subtraction and addition with negative numbers that everyone is used to.

That's all well and good until you have a statement like -1<1.  That would actually be false since 65535 is not less than 1.  You can get around this by doing a 'signed comparison' which is what calc84maniac is talking about.  The limitations with signed comparison is that your numbers can only be half the size, that is -32768 to 32767.  So you would not be able to use the signed comparison (and get the correct answer) if the number is too large or too small.

This is an good idea to implement, but I think I would want it more intuitive than a question mark.  Maybe something like -1<<1 would be better?  Repeating any operation twice will do the signed version of the operation.  So -4<<2 equals 1 and -2**8 would equal -16.

Oh and by the way, bitwise and Boolean or are identical, there is no reason to separate the 2.
But shouldn't << be shift left or something?

Also, bitwise and boolean OR are different.
5 | 2 = 7
5 || 2 = 1 (and the "2" expression isn't evaluated because 5 is non-zero)
"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 #100 on: February 10, 2010, 12:14:53 am »
If you want 5 | 2, then you can do "5 or 2".
If you want 5 || 2, then you can do "5≠0 or 2≠0" since this is basically what a Boolean "or" would do for you anyway.  While I agree it could be made more efficient by a c style Boolean operator where the second argument may be skipped if it does not need to be checked, I don't think its worth it.  You're almost always going to use "or" and "and" when comparing two expressions that already have some type of equality operator.  I think the introduction of 2 different types of "or" will just confuse many programmers and make the coding more complicated since there would have to be some weird way to differentiate the two.

But now that I think about it, maybe I should make the regular "or" "and" "xor" the Boolean versions (like basic) and then add new commands for the bitwise operations.  I'm thinking to use the plot symbols for this.  The little dot will be "and", the little plus sign will be "or" and the little square will be "xor".
___Axe_Parser___
Today the calculator, tomorrow the world!

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 #101 on: February 10, 2010, 04:27:37 pm »
But now that I think about it, maybe I should make the regular "or" "and" "xor" the Boolean versions (like basic) and then add new commands for the bitwise operations.  I'm thinking to use the plot symbols for this.  The little dot will be "and", the little plus sign will be "or" and the little square will be "xor".
I like this way, as I think all the basic programmers would wonder something like why dosn't "A or not(C" work right.  I really like booleans as " and " " or " and " xor ".  Also, are you using not( ?
« Last Edit: February 10, 2010, 04:27:55 pm by ztrumpet »

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 #102 on: February 11, 2010, 12:28:58 am »
So I've redone a lot of the code.  You won't notice it, but it is much more organized on the inside now making it easier for me to add future features, and there's still a lot more that could be organized further.  Anyway, I've got a to-do list a mile high right now.  I still haven't actually made many of the mentioned corrections yet.  Most of these things are very minor, but very important like parsing order of operations, rewriting some code so that I will be able to handle pointers, the for loop, etc.

Although I could get to doing sprites right away, they're very easy to do, I feel I should finish these corrections first so that everything will just work better.  So either I will release the next version with sprites a little later than I anticipated, or I will release an intermediate version with some of the corrections and then the version after that will finish most of the corrections and include sprite handling.

btw, haven't made use of "not(" yet.  Its on my list.

Oh and I'd like some feedback on this: Should I continue to exclusively use multiblock "If" statements?  Or should I do what BASIC does and allow single or multiblock?  The disadvantage is that then you would have to add the token "Then" after every multiblock statement.  The compiled program will be the same either way, but what is more convenient, never needing the "Then", or sometimes not needing the "End"?
« Last Edit: February 11, 2010, 12:29:29 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Features Wishlist
« Reply #103 on: February 11, 2010, 12:32:05 am »
Hmmm thats a good question.  I'm tempted to have it be done the way TiBasic has it, if only for readability.  Then again, i do see how usefully it is to not have the burden of a Then after each if (especially since it sometimes takes a whole line x.x)

Soooo i'm on the fence on this one, so I say keep it the way it is :P

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 #104 on: February 11, 2010, 12:42:33 am »
By the way, I am considering adding the ternary operator to take the burden off of quick if statements.

The syntax will like this:

statement ?( expression1 , expression2 )

If the statement is true, the expression becomes expression1, if it is false, it becomes expression2.  So for instance:

A<B?(A,B)

Returns the minimum of A and B.  It is equivalent in BASIC like this:

:If A<B
:A
:Else
:B
:End

So quick things like

:If K=15
:A+1->A
:End

can be written like this:

K=15?(A+1->A,)
___Axe_Parser___
Today the calculator, tomorrow the world!