Author Topic: micropython - Python for Nspire calculators  (Read 53266 times)

0 Members and 1 Guest are viewing this topic.

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: micropython - Python for Nspire calculators
« Reply #15 on: October 28, 2014, 05:05:37 pm »
I assume that native and viper will not require Micropython to run and that Bytecode-interpreter is mainly for quick testing, right?

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: micropython - Python for Nspire calculators
« Reply #16 on: October 28, 2014, 05:10:14 pm »
Quote
I assume that native and viper will not require Micropython to run and that Bytecode-interpreter is mainly for quick testing, right?
Nope, all of them are done at runtime, so you will always need micropython as it containes the needed runtime functions (print, for instance).
Compiling doesn't take long though.

There's a post by Damien on kickstarter:
https://www.kickstarter.com/projects/214379695/micro-python-python-for-microcontrollers/posts/664832

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: micropython - Python for Nspire calculators
« Reply #17 on: October 28, 2014, 05:14:21 pm »
Aaah I see now. Thanks for the info. MY main  concern about needing the main program to run something is when the software takes like 40% of the calculator memory but that is only really an issue with the regular 83+ and older Nspire models I think and sometimes the file size or dependency is necessary.

Offline Ivoah

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +3/-0
    • View Profile
    • Codinghobbit
Re: micropython - Python for Nspire calculators
« Reply #18 on: October 30, 2014, 10:36:06 am »
On my Nspire CX CAS it take about 5 seconds for python to start, it didn't happen before...
http://codinghobbit.no-ip.org
My Calcs:
TI-86 (now broken) $2
TI SR-56 - $0
TI-Nspire CX CAS - $152
TI-84+ Silver Edition - $56
TI-84+ Silver Edition - $0
TI-85 - $0
TI-73 Explorer VS - $10
ViewScreen - $3

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: micropython - Python for Nspire calculators
« Reply #19 on: October 30, 2014, 02:34:52 pm »
Do you have more files than before? I noticed that when I have a lot of files on my calculator, the documents menu takes much longer to open and starting stuff takes longer too.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: micropython - Python for Nspire calculators
« Reply #20 on: October 30, 2014, 02:48:19 pm »
awesome.
Then. the most important question for game programmers:

Does It Have All Keys Repeat?
if so, I might make some programs using this (and learn python)

Also, how hard is it to make an on-calc editor/compiler?
« Last Edit: October 30, 2014, 02:55:01 pm by aeTIos »
I'm not a nerd but I pretend:

Offline Ivoah

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +3/-0
    • View Profile
    • Codinghobbit
Re: micropython - Python for Nspire calculators
« Reply #21 on: October 30, 2014, 03:07:49 pm »
Also, how hard is it to make an on-calc editor/compiler?


Vogtinator is already working on that: http://www.omnimaga.org/ti-nspire-projects/pywrite-python-script-editor/
http://codinghobbit.no-ip.org
My Calcs:
TI-86 (now broken) $2
TI SR-56 - $0
TI-Nspire CX CAS - $152
TI-84+ Silver Edition - $56
TI-84+ Silver Edition - $0
TI-85 - $0
TI-73 Explorer VS - $10
ViewScreen - $3

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: micropython - Python for Nspire calculators
« Reply #22 on: October 30, 2014, 03:14:43 pm »
Aah good. I see that that's only a script editor though (which is already awesome). I reckon that a compiler wouldn't be too hard, either.
If everything goes on-calc, I could see this become a kind of Axe.
(We'd still need some way to create graphics, though :P)
I'm not a nerd but I pretend:

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: micropython - Python for Nspire calculators
« Reply #23 on: October 30, 2014, 03:20:40 pm »
Well, there's already some kind of "JIT" available, btw.
(See the examples)

(Edit : It's native code emission, IIRC - look at "@micropython.native")
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Ivoah

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +3/-0
    • View Profile
    • Codinghobbit
Re: micropython - Python for Nspire calculators
« Reply #24 on: October 30, 2014, 03:38:24 pm »
Do you have more files than before? I noticed that when I have a lot of files on my calculator, the documents menu takes much longer to open and starting stuff takes longer too.


I'm talking about when I launch micropython, the screen is black for about 5 seconds before opening the prompt.
http://codinghobbit.no-ip.org
My Calcs:
TI-86 (now broken) $2
TI SR-56 - $0
TI-Nspire CX CAS - $152
TI-84+ Silver Edition - $56
TI-84+ Silver Edition - $0
TI-85 - $0
TI-73 Explorer VS - $10
ViewScreen - $3

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: micropython - Python for Nspire calculators
« Reply #25 on: October 30, 2014, 03:51:34 pm »
Quote
On my Nspire CX CAS it take about 5 seconds for python to start, it didn't happen before...
Yeah, I know that happens sometimes. I'm not sure why and where this happens, but it's not really a big issue.

Quote
Aah good. I see that that's only a script editor though (which is already awesome). I reckon that a compiler wouldn't be too hard, either.
If everything goes on-calc, I could see this become a kind of Axe.
Compiling isn't possible, but that shouldn't be an issue as micropython translates fast enough.

Quote
(We'd still need some way to create graphics, though )
ConvertImg?

Quote
Do you have more files than before? I noticed that when I have a lot of files on my calculator, the documents menu takes much longer to open and starting stuff takes longer too.
It's not even fragmentation, it's just that the NAND is really f*cking slow and the filesystem as well. I would understand if it was writing being slow, as it has to be reliable, even if you pull the battery or reset during saving.

Quote
awesome.
Then. the most important question for game programmers:

Does It Have All Keys Repeat?
if so, I might make some programs using this (and learn python)
Apart from a gets like "input()" function there isn't any input handling right now. I'm not sure how to do that, probably "isKeyPressed".
« Last Edit: October 30, 2014, 03:59:49 pm by Vogtinator »

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: micropython - Python for Nspire calculators
« Reply #26 on: October 31, 2014, 12:02:21 am »
It's not even fragmentation, it's just that the NAND is really f*cking slow and the filesystem as well. I would understand if it was writing being slow, as it has to be reliable, even if you pull the battery or reset during saving.
Thankfully, at least it's nowhere as brutal as back when we were stuck with MirageOS 1.1 on Z80 calcs before 1.2 came out. When you had 150+ programs, it took 40 minutes to open the program list. O.O

Offline Ivoah

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +3/-0
    • View Profile
    • Codinghobbit
Re: micropython - Python for Nspire calculators
« Reply #27 on: October 31, 2014, 07:05:35 am »
Aah good. I see that that's only a script editor though (which is already awesome). I reckon that a compiler wouldn't be too hard, either.
If everything goes on-calc, I could see this become a kind of Axe.
(We'd still need some way to create graphics, though :P )


Python is an interpreted language, there is no compiler for it.
http://codinghobbit.no-ip.org
My Calcs:
TI-86 (now broken) $2
TI SR-56 - $0
TI-Nspire CX CAS - $152
TI-84+ Silver Edition - $56
TI-84+ Silver Edition - $0
TI-85 - $0
TI-73 Explorer VS - $10
ViewScreen - $3

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: micropython - Python for Nspire calculators
« Reply #28 on: November 01, 2014, 05:22:42 pm »
Python is an interpreted language, there is no compiler for it.

There are JIT (Just-in-Time) compilers out there for Python (Micro Python has a JIT too IIRC).  Also you can compile a python script to python bytecode to improve loading time.

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: micropython - Python for Nspire calculators
« Reply #29 on: November 01, 2014, 05:39:10 pm »
Not to mention in the case of Micropython, I think Vogtinator mentionned that there's a compiled mode or two. It really depends of the language and platform I guess.