π
<-
Chat plein-écran
[^]

XPicoC - C interpreter ported to TI-Lua!

Pour TI-Nspire OS 3.0 ou ultérieur.

XPicoC - C interpreter ported to TI-Lua!

Message non lude miyuki_takara » 09 Juin 2020, 15:52

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! :D

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:

Image

Pointer arithmetic:

Image

Quicksort:

Image

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.
Avatar de l’utilisateur
miyuki_takara
Niveau 2: MI2 (Membre Initié)
Niveau 2: MI2 (Membre Initié)
Prochain niv.: 66.7%
 
Messages: 4
Inscription: 09 Juin 2020, 15:19
Localisation: Toronto, Canada
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: ExAcler

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude jean-baptiste boric » 09 Juin 2020, 17:11

Looks cool! Have you made benchmarks against native execution? Also which (if any) platforms APIs do you intend to implement?
Avatar de l’utilisateur
jean-baptiste boricPremium
Niveau 10: GR (Guide de Référence)
Niveau 10: GR (Guide de Référence)
Prochain niv.: 4.5%
 
Messages: 374
Inscription: 21 Déc 2015, 22:22
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile
GitHub: boricj

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude miyuki_takara » 09 Juin 2020, 17:21

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.
Avatar de l’utilisateur
miyuki_takara
Niveau 2: MI2 (Membre Initié)
Niveau 2: MI2 (Membre Initié)
Prochain niv.: 66.7%
 
Messages: 4
Inscription: 09 Juin 2020, 15:19
Localisation: Toronto, Canada
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: ExAcler

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude miyuki_takara » 09 Juin 2020, 17:26

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.
Avatar de l’utilisateur
miyuki_takara
Niveau 2: MI2 (Membre Initié)
Niveau 2: MI2 (Membre Initié)
Prochain niv.: 66.7%
 
Messages: 4
Inscription: 09 Juin 2020, 15:19
Localisation: Toronto, Canada
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: ExAcler

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude Bisam » 10 Juin 2020, 13:43

Are you planning to support execution of code read from a file ?
Avatar de l’utilisateur
BisamAdmin
Niveau 15: CC (Chevalier des Calculatrices)
Niveau 15: CC (Chevalier des Calculatrices)
Prochain niv.: 69.5%
 
Messages: 5665
Inscription: 11 Mar 2008, 00:00
Localisation: Lyon
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude miyuki_takara » 10 Juin 2020, 14:39

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.
Avatar de l’utilisateur
miyuki_takara
Niveau 2: MI2 (Membre Initié)
Niveau 2: MI2 (Membre Initié)
Prochain niv.: 66.7%
 
Messages: 4
Inscription: 09 Juin 2020, 15:19
Localisation: Toronto, Canada
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: ExAcler

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude Bisam » 10 Juin 2020, 16:39

Sounds great !
Avatar de l’utilisateur
BisamAdmin
Niveau 15: CC (Chevalier des Calculatrices)
Niveau 15: CC (Chevalier des Calculatrices)
Prochain niv.: 69.5%
 
Messages: 5665
Inscription: 11 Mar 2008, 00:00
Localisation: Lyon
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude Adriweb » 10 Juin 2020, 17:22

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
Image

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...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80.1%
 
Messages: 14605
Images: 1216
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude Zocipal » 18 Aoû 2020, 15:21

Great project, really interesting !
Image
Avatar de l’utilisateur
ZocipalProgrammeur
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 60.7%
 
Messages: 113
Inscription: 12 Sep 2019, 20:15
Localisation: Hauts-de-France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: 1ère Maths Physique NSI

Re: XPicoC - C interpreter ported to TI-Lua!

Message non lude BackStage » 20 Aoû 2020, 02:55

good job thank you :)
Avatar de l’utilisateur
BackStage
Niveau 4: MC (Membre Confirmé)
Niveau 4: MC (Membre Confirmé)
Prochain niv.: 80%
 
Messages: 24
Inscription: 03 Avr 2018, 01:54
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile


Retourner vers Nspire-Lua

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 16 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
2035 utilisateurs:
>2016 invités
>15 membres
>4 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)