XPicoC - C interpreter ported to TI-Lua!
Voir le premier message non lu • 10 messages
• Page 1 sur 1
XPicoC - C interpreter ported to TI-Lua!
Hello folks,
Today we would like to announce a new project, XPicoC, which turns your TI-Nspire CX into a powerful programming machine in pure C programming language WITHOUT NDLESS!
XPicoC is programmed completely in the Lua scripting language and does not depend on any native code, so it can be run on all TI-Nspire OSes from OS 3.2 to the newest OS 5.1, and only slight changes are needed to make it compatible with OS 3.0 and OS 3.1.
We have implemented all the essential features of ISO C, including pointer arithmetic.
Please read the Project GitHub Page for more details about this project.
Project GitHub Page: https://github.com/ExAcler/XPicoC
Usage:
Play with it by directly typing in C statements.
To execute from a C source file:
Create a Notes application and type in or paste your C source code into the application.
Press Ctrl+A followed by Ctrl+C.
Switch back to XPicoC and press Ctrl+V (Or press Menu and select Run > Run code from clipboard)
Screenshots:
Simple Hello World:
Pointer arithmetic:
Quicksort:
Current version of XPicoC is still being tested and may be error prone. A preview version of XPicoC is available to download now:
archives_voir.php?id=2624026
If you are interested you can clone the project and deploy it yourself to get the latest updates.
Today we would like to announce a new project, XPicoC, which turns your TI-Nspire CX into a powerful programming machine in pure C programming language WITHOUT NDLESS!
XPicoC is programmed completely in the Lua scripting language and does not depend on any native code, so it can be run on all TI-Nspire OSes from OS 3.2 to the newest OS 5.1, and only slight changes are needed to make it compatible with OS 3.0 and OS 3.1.
We have implemented all the essential features of ISO C, including pointer arithmetic.
Please read the Project GitHub Page for more details about this project.
Project GitHub Page: https://github.com/ExAcler/XPicoC
Usage:
Play with it by directly typing in C statements.
To execute from a C source file:
Create a Notes application and type in or paste your C source code into the application.
Press Ctrl+A followed by Ctrl+C.
Switch back to XPicoC and press Ctrl+V (Or press Menu and select Run > Run code from clipboard)
Screenshots:
Simple Hello World:
Pointer arithmetic:
Quicksort:
Current version of XPicoC is still being tested and may be error prone. A preview version of XPicoC is available to download now:
archives_voir.php?id=2624026
If you are interested you can clone the project and deploy it yourself to get the latest updates.
Dernière édition par miyuki_takara le 10 Juin 2020, 15:23, édité 3 fois.
-
miyuki_takara
Niveau 2: MI2 (Membre Initié)- Messages: 4
- Inscription: 09 Juin 2020, 15:19
- Localisation: Toronto, Canada
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: ExAcler
Re: XPicoC - C interpreter ported to TI-Lua!
Looks cool! Have you made benchmarks against native execution? Also which (if any) platforms APIs do you intend to implement?
-
jean-baptiste boricPremium
Niveau 10: GR (Guide de Référence)- Messages: 374
- Inscription: 21 Déc 2015, 22:22
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: boricj
Re: XPicoC - C interpreter ported to TI-Lua!
It is way slower than native C execution. This is due to double interpretation: Lua itself interpreted by Native C, and XPicoC is again interpreted by Lua. A sample C code containing only for loops may take 100 times more time than native C to execute. My intention was to make an at least "usable" C interpreter that fully conforms to Texas Instrument's "legality" policy on TI-Nspire programming. Execution efficiency is not the first thing I should consider at this stage.
-
miyuki_takara
Niveau 2: MI2 (Membre Initié)- Messages: 4
- Inscription: 09 Juin 2020, 15:19
- Localisation: Toronto, Canada
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: ExAcler
Re: XPicoC - C interpreter ported to TI-Lua!
I am planning to implement gc-related functions in the near future and add a "Graphics Console" page in addition to the current "Command Prompt" page.
Implementing other platform-dependent function should be a breeze.
Implementing other platform-dependent function should be a breeze.
-
miyuki_takara
Niveau 2: MI2 (Membre Initié)- Messages: 4
- Inscription: 09 Juin 2020, 15:19
- Localisation: Toronto, Canada
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: ExAcler
Re: XPicoC - C interpreter ported to TI-Lua!
Are you planning to support execution of code read from a file ?
-
BisamAdmin
Niveau 15: CC (Chevalier des Calculatrices)- Messages: 5666
- Inscription: 11 Mar 2008, 00:00
- Localisation: Lyon
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: XPicoC - C interpreter ported to TI-Lua!
TI-Lua does not support reading from a file inside the TI-Nspire filesystem; but it is possible to simulate it inside a TI-Nspire document. If we receive sufficient positive feedback on this project, we may consider implementing a code editor like Jen's Script Editor that is capable of storing C source files, and you will be able to run from these files.
stdio functions are still under development; you will be able to read the contents from a "file" that is indeed stored in a platform variable.
stdio functions are still under development; you will be able to read the contents from a "file" that is indeed stored in a platform variable.
-
miyuki_takara
Niveau 2: MI2 (Membre Initié)- Messages: 4
- Inscription: 09 Juin 2020, 15:19
- Localisation: Toronto, Canada
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: ExAcler
Re: XPicoC - C interpreter ported to TI-Lua!
Sounds great !
-
BisamAdmin
Niveau 15: CC (Chevalier des Calculatrices)- Messages: 5666
- Inscription: 11 Mar 2008, 00:00
- Localisation: Lyon
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: XPicoC - C interpreter ported to TI-Lua!
Nspire Lua can "read from files", but those files have to be .tns inside MyLib.
What I did in FormulaPro a long time ago in order to dynamically load external databases relied on that. A LibPub basic function exposed in a tns file in MyLib, that Lua can call (then execute).
See here: https://github.com/adriweb/EEPro-for-Ns ... tabase.lua
What I did in FormulaPro a long time ago in order to dynamically load external databases relied on that. A LibPub basic function exposed in a tns file in MyLib, that Lua can call (then execute).
See here: https://github.com/adriweb/EEPro-for-Ns ... tabase.lua
MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)-
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Messages: 14623
- Images: 1218
- Inscription: 01 Juin 2007, 00:00
- Localisation: France
- Genre:
- Calculatrice(s):→ MyCalcs profile
- Twitter/X: adriweb
- GitHub: adriweb
-
ZocipalProgrammeur
Niveau 9: IC (Compteur Infatigable)- Messages: 113
- Inscription: 12 Sep 2019, 20:15
- Localisation: Hauts-de-France
- Genre:
- Calculatrice(s):→ MyCalcs profile
- Classe: 1ère Maths Physique NSI
Re: XPicoC - C interpreter ported to TI-Lua!
good job thank you
-
BackStage
Niveau 4: MC (Membre Confirmé)- Messages: 24
- Inscription: 03 Avr 2018, 01:54
- Genre:
- Calculatrice(s):→ MyCalcs profile
10 messages
• Page 1 sur 1
Qui est en ligne
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 8 invités