Participez au concours commun et partez à la conquête des étoiles !
Forums Casio - Projets de programmation

Index du Forum | Projets de programmation | C.Basic Projets
Sentaro21
Hors ligne
Membre
Niveau: Aucun
Points: 96
Défis: 0
Message
Posté le 30/04/2017 11:08

C.Basic Projets :

Hello, everyone.

I am Sentaro21, and I am developing C.Basic, a Basic interpreter that allows high-speed execution of Basic programs while maintaining compatibility with genuine Casio Basic.

Here is an English site, by Krtyski, about the C.Basic project (I helped him with the translation, but it's still unfinished) :
http://egadget2.web.fc2.com/CBasic/Interpreter/CBasic_interpreter.html

The articles and various programs from this site served as a reference to evaluate the compatibility level of C.Basic. Results were not good every time I tested them, but compatibility increased over time.

These programs have been ported experimentally. Many thanks to their authors.

Block Tower (C.Basic version)
http://pm.matrix.jp/CB/CB_BlockTower.zip

Sudoku (C.Basic version)
http://pm.matrix.jp/CB/CB_Sudoku.zip

Maze Generator (C.Basic version)
http://pm.matrix.jp/CB/CB_Mazegene.zip

Graph 3D (C.Basic version)
http://pm.matrix.jp/CB/CB_Graph3D.zip

Tokitori (C.Basic version 3/6/2017)
http://pm.matrix.jp/CB/CB_Tokitori.zip

Here are examples of programs that reach near-C performance :

BallGame (C.Basic version)
http://pm.matrix.jp/CB/CB_BallGame.zip

Asprin (C.Basic version)
http://pm.matrix.jp/CB/CB_Aspirin.zip


The C.Basic project is still yet to be completed, thus I would like to get your feedback.

This is the latest beta version of C.Basic 1.62beta for Graph 35+USB/75/85/95 (SD) : http://pm.matrix.jp/CB/CBASIC162beta.zip (updated 13/8/2017)

Currently C.Basic exists thanks to this site.
Thank you very much.



Lephenixnoir
En ligne
Administrateur
Niveau: Confirmé
Points: 10195
Défis: 130
Message
Dernier message de la page précédente :Posté le 02/07/2017 13:12 |
I don't know of the obscure details of Basic's exotic opcodes and syntax, but I am fairly sure that a properly-implemented typical LR(1) parser for the following kind of grammar could work very well on most (if not all) kinds of expressions.

<expr>    -> <value>
<expr>    -> ( <expr> )
<expr>    -> <unary> <expr>
<expr>    -> <expr> <binary> <expr>

<unary>   -> (-) | Not | etc.
<binary>  -> + | - | × | ÷ | And | Or | etc.
<value>   -> <integer> | <literal-string> | /[A-Zθr]/ | etc.
/* and so on */

Think about how opcodes are operators, and most often right-to-left unary operators followed by the operand. Is there anything this method would miss?

Edit : It seems that @Zezombye has implemented quite the naive parser. No wonder you'd find it difficult.
----------------------------------
Watch me, as I build my empire with my own hands.



Pages: Précédente | 1, 2

Sentaro21
Hors ligne
Membre
Niveau: Aucun
Points: 96
Défis: 0
Message
Citer : Posté le 02/07/2017 16:59 | #
Zezombye a écrit :
If I understand correctly you are doing binary operations instead of decimal operations? This is very dangerous, because it means that 0.1+0.2 != 0.3 (see http://0.30000000000000004.com/). This could lead to bugs from big programs.

Yes, C.Basic use the library of SDK/C, as for all the operation parts,
and so, the risk is the same as SDK/C.

Zezombye a écrit :
All the code you need is here: http://git.planet-casio.com/Zezombye/B2C/blob/master/B2C/src/B2CFunctions.c
The rest of B2C is just compiling basic to C, it's the parser.
I suggest you put your code on our gitlab : git.planet-casio.com that way I could have a look at it and suggest optimisations.

Thanks!

I failed at gitlab registration.
An email does not come from gitlab.
Please wait a little while more.

Zezombye a écrit :
Indeed it is, and there are a lot of weird opcodes (see http://www.planet-casio.com/Fr/programmes/programme1984-last-clonelab-ne0tux-a3.html which pushes basic to its limits).

This program has not yet worked normally in C.Basic.
It wants to work with rewriting program for current C.Basic.

Zezombye a écrit :
From what I've seen you also want to do a compiler? I think it should be some kind of both (pre-compiling basic programs), doing both an interpreter and a compiler would cost too much time.
Optimisations could be like storing the lines of conditions/loops and gotos/lbls, that way when the interpreter encounters "goto 10" it knows where the lbl 10 is and jumps to it immediately. I think that's why the for loops are so slow.

Because the interpreter system is main,I think that the compiler in C:Basic becomes restrictive.
The optimization of the Goto command implements in C.Basic,
but,Goto is special operation in Casio Basic.(rebuilding of the loop structure stack..)
it is not compatible now.


Lephenixnoir a écrit :
I don't know of the obscure details of Basic's exotic opcodes and syntax,

There is new discovery whenever I watch a program uploaded in CasioPlanet.

How to use DrawStat,
like this "c1","anStart" etc, not normal variable,
How to use Ans and List 1[0] etc.
Dark storm
En ligne
Administrateur
Niveau: Aucun
Points: 9815
Défis: 170
Message
Citer : Posté le 02/07/2017 17:04 | #
I confirm your GitLab account manually, so you can connect with the username and password you chose at registration
----------------------------------
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Páranÿe quetë Quendya. Ma méralyë ná ninya meldo ?
Lephenixnoir
En ligne
Administrateur
Niveau: Confirmé
Points: 10195
Défis: 130
Message
Citer : Posté le 02/07/2017 17:16 | #
Sentaro21 a écrit :
There is new discovery whenever I watch a program uploaded in CasioPlanet.

These are of course new functionalities, but not exotic nor even a disturbance for a parser. I was focusing on syntax specifics, eg. an operator placed after its operand.

Now that I think about it, I may have misunderstood you :

About the parser.I think that an expression evaluation is the most difficult.

If you meant evaluating an expression once you have the tree structure of the operation, then it's not really about parsing. But since you're using the native numerical data types, that shouldn't be too much of a burden. So what did you mean exactly?
----------------------------------
Watch me, as I build my empire with my own hands.
Sentaro21
Hors ligne
Membre
Niveau: Aucun
Points: 96
Défis: 0
Message
Citer : Posté le 03/07/2017 04:15 | #
Lephenixnoir a écrit :
These are of course new functionalities, but not exotic nor even a disturbance for a parser. I was focusing on syntax specifics, eg. an operator placed after its operand.
Now that I think about it, I may have misunderstood you :

I'm sorry, there may be my misunderstanding.

If you meant evaluating an expression once you have the tree structure of the operation, then it's not really about parsing. But since you're using the native numerical data types, that shouldn't be too much of a burden. So what did you mean exactly?

I agree with you about the parser.
Because I was weak in a recursive thought, I felt evaluating an expression was most difficult at first.
However it is understood now.

Ajouté le 03/07/2017 à 04:36 :
Dark storm a écrit :
I confirm your GitLab account manually, so you can connect with the username and password you chose at registration

Thank you for your kindness.
I'm sorry, I cannot yet login and the email does not arrive, too
Lephenixnoir
En ligne
Administrateur
Niveau: Confirmé
Points: 10195
Défis: 130
Message
Citer : Posté le 03/07/2017 09:58 | #
Make sure you log in using your username, sentaro21. If you type in the right password, you'll be able to log in right away and won't need any email.
----------------------------------
Watch me, as I build my empire with my own hands.
Sentaro21
Hors ligne
Membre
Niveau: Aucun
Points: 96
Défis: 0
Message
Citer : Posté le 03/07/2017 14:12 | #
Lephenixnoir a écrit :
Make sure you log in using your username, sentaro21. If you type in the right password, you'll be able to log in right away and won't need any email.

Though I did not know whether a password was wrong, I was not able to log in today either.
I registered again and an email came,and able to log in now.
I am sorry to have caused trouble.
Thanks very much!

Ajouté le 13/08/2017 à 10:26 :
Hi Lephenixnoir
The top page of C.Basic(by Krtyski) was updated.
Krtyski of my friend can not login to Planet-Casio for some kind of causes.
I express his gratitude to you.
------------------------------------------
Dear Lephenixnoir

I do appreciate for your help on my translation. I have been extremely busy, so it took long time to come back to C.Basic project. I'm currently changing almost all sentences based on your advise.
------------------------------------------

Thank you always for everything.
Lephenixnoir
En ligne
Administrateur
Niveau: Confirmé
Points: 10195
Défis: 130
Message
Citer : Posté le 13/08/2017 22:45 | #
I'm glad to be of some help!

Translating isn't very hard for me, so if there's anything I can help with, feel free to ask. This project deserves great visibility!
----------------------------------
Watch me, as I build my empire with my own hands.

Pages: Précédente | 1, 2

Index du Forum | Projets de programmation | C.Basic Projets
Publicité et partenaires
Casio Education
Casio éducation

TI-Planet
Casiopeia
Casiopeia
CasioFan, la communauté ClassPad
CasioFan
CodeWalrus
CodeWalrus

Planète Casio v42 © créé par Neuronix et Muelsaco 2004 - 2017 | Il y a 52 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements
Rugby Manager | Jeu de basket | Jeu de handball | Jeu de tennis | Nova Raider | Réparation téléphone | Soccer Rush | Tasty Tale

Planète Casio est un site communautaire indépendant, géré bénévolement et n'est donc pas affilié à Casio | Toute reproduction de Planète Casio, même partielle, est interdite
Les fichiers, programmes et autres publications présents sur Planète Casio restent la propriété de leurs auteurs respectifs et peuvent être soumis à des licences ou des copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd