Author Topic: Grammer 3-Concepts, ideas, requests  (Read 66898 times)

0 Members and 2 Guests are viewing this topic.

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #60 on: May 16, 2013, 05:09:22 pm »
It would actually still be fast since this is how Repeat loops are typically handled anyways. I am doing it this way because it will help to prevent stack overflow issues. Math might change, too, by the way. I am still working out how I want to efficiently handle math. I will probably attempt Order of Operations so you can do something like 3+6*(a+b4) like you would in BASIC.
Cool ! Will the app support variables' declaration with the type ? And what about local variables ? Will we be able to do recursive functions ?

I was thinking about this and I at first thought I might be able to make one app for the editor, and one app to run the program. However, I was going to add a lot more commands to Grammer 3, so the parser would still need 2-pages :/ Then you would have a 2-page app for running Grammer programs and a 1-page app for editing them. Instead, I will try to make it just 1 app that is 2-pages.
Why not put the most needed functions in the 1-page app parser, and then put other functions into several appvars which would be used like the DLL ? Programs needing such a appvar would require it, and even though the user would use all the functions, the final size woudn't be 16 kilo bytes. Of course, updating would be more difficult... Finally, a 2-page app isn't so big when be think about Omnicalc and so. And the containing of an editor could appeal users of programs and give them curiosity to try to do something. Will you introduce hooks like the OS to customize the editor, like adding tutorials as you did ?

If the sprite is too big, I will have it display maybe a 16x16 portion and if the user wants to use edit it, a special editor will open.
It's not really a good idea to my mind, because we couldn't see the difference between pictures which don't have any pixel on on the board up left.
Will you add the support of tilemaps and an editor of tilemaps ? Will you add a basic pictures compression ? What about gray-scale sprites ?

That is a good idea. I will probably still stick menu options on the bottom row, though :P For example, 5 options for F1~F5:
Please don't, it is usefull the first 5 minutes, but then we know the keys and don't need their action's description to be shown anymore, and a line of code is removed.

I hope I actually finish it! I have been planning for over two years now, so hopefully you will get a chance to finally use it!
Yes, and I've been waiting for those two years ! And hope you'll finally do it !  ;D

NB : know that you're doing a 2-pages app, will you be able to add a command to parse pieces of code as someone proposed it ? But after having finally done this version 3 for sure.



Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #61 on: May 16, 2013, 05:37:38 pm »
Cool ! Will the app support variables' declaration with the type ? And what about local variables ? Will we be able to do recursive functions ?
Well, for example, if you start typing with a ", the parser automatically pastes another " and an un-named string variable will be created. You can go into the vars menu (or press a specific button) to name the string. For other variable types, you will have to create them in the variable menu. For example, sprites will need a width and height associated with them, so you will need to input that.
Local variables are going to be just variables that are stored with the file, so it isn't like real "local variables." Instead, you can pass arguments to other programs, you can define a global variable.
For recursion, you will probably want to use the stack functions which will allow you to push/pop variables.
Why not put the most needed functions in the 1-page app parser, and then put other functions into several appvars which would be used like the DLL ? Programs needing such a appvar would require it, and even though the user would use all the functions, the final size woudn't be 16 kilo bytes. Of course, updating would be more difficult...
I could possibly do that, but it is a lot more difficult to read and execute code from an appvar. As well, it is slower, since I would have to locate the appvar, find the specific code, copy it to RAM, then run it. (As opposed to 'find the code, run it').

Finally, a 2-page app isn't so big when be think about Omnicalc and so. And the containing of an editor could appeal users of programs and give them curiosity to try to do something. Will you introduce hooks like the OS to customize the editor, like adding tutorials as you did ?
Hooks are definitely a planned feature. There will not be a parser hook since you will be able to load custom command sets, but getkey hooks, font hooks, and token hooks would be a great idea. Custom fontsets will be available, as well as token sets, but this might be useful for different languages.


It's not really a good idea to my mind, because we couldn't see the difference between pictures which don't have any pixel on on the board up left.
Hmm, maybe I should display the whole thing, then? Either way, you would still be able to select it to open up a larger view.
Will you add the support of tilemaps and an editor of tilemaps ? Will you add a basic pictures compression ? What about gray-scale sprites ?
Tilemaps will be supported and my hope is to have a similar editor. There will definitely be compression routines for pictures and text, and I have been trying to figure out how the grayscale editor will work (for sprite editing), but there will still be grayscale (at least 3 and 4 level).

Please don't, it is usefull the first 5 minutes, but then we know the keys and don't need their action's description to be shown anymore, and a line of code is removed.
Okay, I will just leave that to the readme, then :)

Yes, and I've been waiting for those two years ! And hope you'll finally do it !  ;D
Me, too :P
NB : know that you're doing a 2-pages app, will you be able to add a command to parse pieces of code as someone proposed it ? But after having finally done this version 3 for sure.
I am not sure what you mean, sorry .__.

*Edit AOC* Fixed a typo. ;)

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #62 on: May 17, 2013, 11:53:05 am »
Hmm, maybe I should display the whole thing, then? Either way, you would still be able to select it to open up a larger view.
If we give a name for the variable, does the name replace the display of the picture ?

NB : know that you're doing a 2-pages app, will you be able to add a command to parse pieces of code as someone proposed it ? But after having finally done this version 3 for sure.
I am not sure what you mean, sorry .__.
Well, I was speaking about that : http://ourl.ca/14658/346271

PS : If I make any mistake, I would enjoy to be corrected so that I improve my language. :)



Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #63 on: May 17, 2013, 03:09:48 pm »
Oh, the whole code is being preparsed. Are you saying, for example, to compile some parts of code directly to assembly?

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #64 on: May 17, 2013, 03:27:30 pm »
Yes. A command that compiles a part of Grammer code dynamically, and that does so that this part be compiled in the current context. For example : if a variable has a specific value, the code using it could be parsed as if it was a constant : some operations could be calculated before the parsing, and the code would be really fast in the context. It could be usefull when there's short loops (-> fast parsing) but with lots of iterations (-> lot of time preserved). Like in Java, but asking it manually.

But don't take consideration to this really hard point, it is much less important than the other ones.



Offline Joshuasm32

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 142
  • Rating: +19/-7
    • View Profile
    • Network
Re: Grammer 3-Concepts, ideas, requests
« Reply #65 on: May 17, 2013, 04:57:41 pm »
What would be really cool is some kind of function to help you to create your own libraries.  It's probably a dumb idea, but it seemed OK...   ::)
My name is Josh and I a developer at Moonzean. I enjoy Radiohead, web development, Java, and cryptograms.
Spoiler For No Surprises, by Radiohead:
A heart that's full up like a landfill
A job that slowly kills you
Bruises that won't heal

You look so tired unhappy
Bring down the government
They don't, they don't speak for us

I'll take a quiet life
A handshake of carbon monoxide

And no alarms and no surprises
No alarms and no surprises
No alarms and no surprises
Silent, silent

This is my final fit
My final bellyache

With no alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Such a pretty house
And such a pretty garden

No alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #66 on: May 17, 2013, 05:50:26 pm »
As it currently is, just having labels and variables pre-parsed saves a lot of time and having numbers pre-parsed saves a lot more time. For example,  Grammer 2 takes nearly 70 t-states for each digit extra in a number, but Grammer 3 takes 13 t-states for every 8 bits. For comparison, 65535 takes about 350 t-states for Grammer 2 to read and convert, and only 26 t-states for Grammer 3. While it still won't be as fast as Axe, it will still be faster than Grammer 2.

The other thing that I am now trying to figure out is how to make math much faster, but I always worry about that.

I have one more random thing before I finish this post. I just put together a quick example program in Grammer 3 and the size of the code and variables together is 80 bytes. The equivalent in Grammer 2 is 86 bytes (not including the header), so there is some small size savings there. I might have an active screenshot in the next few days if I don't get distracted again. I got a book last night and read it and I got distracted by lots of math stuff >.>

EDIT:
@codebender: Well, you will be able to write and define functions in Grammer code :) However, command set extensions will need to be written in assembly.

EDIT2:
Well, I threw together a quick example of a Grammer 2 program and a Grammer 3 programand you can't see much of a difference (though it is approximately 20% faster). I am hoping that when I optimise the code for the new syntax, it will get a little more speed. Also, I have math reading left to right, now that I don't have to worry about the issues that math had in Grammer 2. This means that math should be faster and use less stack stuff than Grammer 2. I also still have to update the sprite drawing routine to use the better one in BatLib (which draws large sprites, clipped, and possibly faster).

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: Grammer 3-Concepts, ideas, requests
« Reply #67 on: May 18, 2013, 01:44:18 am »
Very good to see progress :)

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #68 on: May 18, 2013, 07:03:36 am »
Are you also thinking about making math follow the order of operations instead of evaluating left to right? Doing so shouldn't be hard, especially for you.
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #69 on: May 18, 2013, 07:50:14 am »
I am thinking really hard about how to handle math. I can definitely make it handle order of operations, but it would be a little slower.

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #70 on: May 18, 2013, 09:25:06 am »
I am thinking really hard about how to handle math. I can definitely make it handle order of operations, but it would be a little slower.
A little slower ? Why not when parsing put the operations to the usual order ? Then it would be the same speed.



Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #71 on: May 18, 2013, 10:01:31 am »
I am thinking really hard about how to handle math. I can definitely make it handle order of operations, but it would be a little slower.
A little slower ? Why not when parsing put the operations to the usual order ? Then it would be the same speed.
I was thinking about converting the math into postfix notation when parsing to bytecode.
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Grammer 3-Concepts, ideas, requests
« Reply #72 on: May 18, 2013, 09:56:29 pm »
maybe just some order of operations like axe or like current grammer2? You can still do a lot with it as long as paranthesis work :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #73 on: May 19, 2013, 08:23:38 am »
If I can figure out a way to convert a formula in order-of-operastions to a more optimised syntax (and back again), then  I would prefer to do that. I think I will have to look into RPN for ideas. For example, in Grammer 2 it is possible to mentally convert a formula to OOP, but I have to think of a way to program it. As an example:

3*4+A:/6-B
is equivalent to:
3(4+A)/(6-B)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Grammer 3-Concepts, ideas, requests
« Reply #74 on: May 20, 2013, 04:23:37 am »
If I had to choose, I'd choose either "right to left" or "left to right" since it allows more optimizations from the coder and is easier to code for you :P
Left to right seems to me the best choice since it even allows optimization from one line to the other, like in Axe ;)

Now, if you prefer adding support for the usual order of operations, that is not a problem, but please just don't come up with a new order where the addition comes before the multiplication (like 3*4+1 == 3*(4+1)) :P
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s