Join us on Discord!
You can help CodeWalrus stay online by donating here.

[nspire] nSquirrel : Squirrel programming language on Ti-Nspire

Started by Duke "Tape" Eiyeron, March 30, 2016, 08:31:51 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Duke "Tape" Eiyeron

The first version is, indeed, complete. The interpreter works as expected on the example scripts and I could program something interactive with it. Next versions could embed more libraries and functions but that's only something for later. (My first thought came to lodepng which allows loading PNGs and have a cool open source licence. I'm already using it in WRPG)
  • Calculators owned: A lot.

Snektron

  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Duke "Tape" Eiyeron

An example with lots of comments will come a little later, with a bugfix about some things that I overlooked (like a wrong argument usage on drawSpritePart and wrong key names setting).
  • Calculators owned: A lot.

Ivoah

Wow, this looks great! What is the performance like compared to micropython, duktape, and Nspire Lua?
  • Calculators owned: TI-86 (now broken), TI SR-56, TI-Nspire CX CAS, TI-84+ SE, TI-84+ SE, TI-85, TI-73 Explorer VS, ViewScreen, TI-84+ CSE, TI-83+ SE

Adriweb

Yeah it'd be nice to compare the same algorithms on those different languages/implementations
We had already done that here with simple things with timings&graphs: https://tiplanet.org/forum/viewtopic.php?f=43&t=16900 and the codes are very easy to port and try.
  • Calculators owned: TI-Nspire CX CAS, TI-Nspire CX, TI-Nspire CAS (x3), TI-Nspire (x2), TI-Nspire CM-C CAS, TI-Nspire CAS+, TI-80, TI-82 Stats.fr, TI-82 Plus, TI-83 Plus, TI-83 Plus.fr USB, TI-84+, TI-84+ Pocket SE, TI-84+ C Silver Edition, TI-84 Plus CE, TI-89 Titanium, TI-86, TI-Voyage 200, TI-Collège Plus, TI-Collège Plus Solaire, 3 HP, some Casios
Co-founder & co-administrator of TI-Planet and Inspired-Lua

Duke "Tape" Eiyeron

#35
Well, it'll be probably slower than lua. From what I read, lua is probably better because the memory, GC based, uses cache better than a refcounting system. But the GC can hit more or less when it wants and I don't know if you can opt for refcounting on lua on nspire.

There is a lot of discussion and people (not really interested in benchmark because today we have highs performance CPU everywhere except in calculators) tends to say that in benchmarks, Squirrel is slower than Lua. The former also have a little bit more of features than the latter (citation needed) but heh, it's still another solution you get.

I wish I could have tried luajit on Nspires. Alas, the way Ndless is built made me give up as references to the built-in VM overrid each time the JIT's library/code...

So yeah, the main changes are in the memory stuff.

Found this. Where I'm not too found of benchmarks (because you can easily fool a noob by screwing up a script on a language and stuff), I'd like to point at Tcl's position...

My last point is the difference of community size between Lua's and Squirrel's. The latter has a good performance against Lua where the community is radically smaller (lua is almost everywhere...)

Edit : oh, also, is Lua@Nspire event-based? I remember seeing that you couldn'take tight loops for games (like just an update-render). In my demos I'm just making a while loop and draw the frame after updating it. How does Lua on Nspire work in that way?
  • Calculators owned: A lot.

aetios

ceci n'est pas une signature

Ivoah

Quote from: aeTIos on April 08, 2016, 01:06:08 PM
I should try this, gotta dust off my nspire :P
I thought you Nspire's USB port was broken
  • Calculators owned: TI-86 (now broken), TI SR-56, TI-Nspire CX CAS, TI-84+ SE, TI-84+ SE, TI-85, TI-73 Explorer VS, ViewScreen, TI-84+ CSE, TI-83+ SE

Duke "Tape" Eiyeron

Quote from: aeTIos on April 08, 2016, 01:06:08 PM
I should try this, gotta dust off my nspire :P

Wait until the 1.0.1. Just need to fool-proof my detailled example script and I'll release it.
  • Calculators owned: A lot.

Duke "Tape" Eiyeron

#39
Just poking that the 1.0.1 with the correct keys naming convention and a sokoban as game example is released : https://github.com/Eiyeron/squirrel/releases/tag/nsquirrel_1.0.1
  • Calculators owned: A lot.

Dream of Omnimaga

That game looks cool. :D Also we really need a page on the forums that explains all language options available on each calculator. But I would probably need the help of @Adriweb or @critor for TI-Nspire languages, because I forgot which ones are available besides Squirrel, C, C++, Javascript, Micropython, ASM, Lua and TI-Basic.

Did you make those graphics, by the way?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Duke "Tape" Eiyeron

  • Calculators owned: A lot.

Dream of Omnimaga

  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Duke "Tape" Eiyeron

Another example is being programmed.
  • Calculators owned: A lot.

Dream of Omnimaga

That looks cool. :) Shouldn't it be a bit bigger, though? (unless you plan to scale it up to 160x120)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal