Author Topic: [Prizm] Introducing LuaZM  (Read 8602 times)

0 Members and 1 Guest are viewing this topic.

Offline KermMartian

  • Editor
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 500
  • Rating: +233/-20
    • View Profile
    • Cemetech
[Prizm] Introducing LuaZM
« on: August 17, 2012, 06:04:17 pm »
The Casio Prizm is a powerful calculator, great for both math and playing games. It is particularly great for programming, and for months thoroughly bested the TI-Nspire calculator in offering ASM, BASIC, and C programming. In an attempt to reduce criticism of their apparently anti-student stance, Texas Instruments improved the TI-Nspire to run Lua programs. Lua is a "fast, lightweight, embeddable scripting language," an interpreted procedural language. The language has allowed budding Nspire programmers to quickly write games and programs without needing to use a computer.

I am happy to announce that I am now bringing Lua to the Casio Prizm graphing calculator, in the form of a full-featured Lua interpreter. After days of porting, rewriting parts of libc (including the longjmp/setjmp system), and learning some SH4 assembly, I am proud to present the first screenshot of the interpreter successfully running on a Prizm. Special kudos to Juju for the PrizmIO library, a port of an Nspire I/O library for C programmers. As you can see from the screenshots, this is just the raw interpreter; although it understands Lua syntax and can parse/lex the language, load libraries, and recognize incorrect code, it is almost entirely lacking in functioning libraries. From here, I will be porting over each of the standard libraries, starting with numbers, strings, and I/O. Please feel free to share thoughts and suggestions here or in the original Cemetech thread. Bonus features: Planned transparent support for Nspire and Lua FX programs.


Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: [Prizm] Introducing LuaZM
« Reply #1 on: August 17, 2012, 06:49:07 pm »
Nice, I will definately be watching this project closely.
This will definately help bring WZGULIB to prizm, at least make it easier.
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: [Prizm] Introducing LuaZM
« Reply #2 on: August 17, 2012, 10:32:38 pm »
Nice, I will definately be watching this project closely.
This will definately help bring WZGULIB to prizm, at least make it easier.

Hmm, i wonder how hard it would be to port WZGUILIB to LuaFX...



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55838
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: [Prizm] Introducing LuaZM
« Reply #3 on: August 17, 2012, 11:01:22 pm »
I heard about this project from Juju IRL a few times so far and I was anxiously waiting for the announcement. I'm glad Lua is finally arriving on the PRIZM. Hopefully this should increase the userbase considerably.

When Lua arrived on Omnimaga, about 30 new games (a lot of which were pretty fun to play) came out on the TI-Nspire during the year after. With Ndless out since 2010, C and ASM support has never come close to that amount.
Lua is a "fast,
Actually a little correction, it isn't all that fast on TI calcs. ;) On other platforms it is, but TI didn't do the very best job at optimizing it yet, although due to the platform speed, it allows a lot more stuff than TI-83 Plus BASIC, plus it has far more functions (notably the new physics engine) than TI-BASIC on any calculator. In any case, a Casio Lua interpreter gotta be the most welcome software :)

Good luck!
« Last Edit: August 17, 2012, 11:01:34 pm by DJ_O »
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF



Official Website |T-Shirt store | Reverbnation | Facebook | Youtube | Twitter | Spotify

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: [Prizm] Introducing LuaZM
« Reply #4 on: August 18, 2012, 01:42:36 am »
Nice, I will definately be watching this project closely.
This will definately help bring WZGULIB to prizm, at least make it easier.

Hmm, i wonder how hard it would be to port WZGUILIB to LuaFX...

My estimation... simple. But then again I created it so I know all of the underworkings. Basicly, It would be easiest to 1) implement classes (a must) 2)rewrite the drawing code to work on the specific platform(gc:drawRect() needs to become whatever draws a rectangle) 3) figure out how to make the interpreter use events/callbacks for all of the on. events. and 4) if no mouse, either create one or dont worry about it, I added functionality so you dont nessiceraly have to use a mouse anymore (can also use the enter key to do 'clicks')

I would also be willing to help port it.

EDIT: now that I thought about it... Im going to write a section into the new documentation that I will release with the new version that will talk about the above and how WZ works...
« Last Edit: August 18, 2012, 01:46:18 am by jwalker »
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: [Prizm] Introducing LuaZM
« Reply #5 on: August 18, 2012, 01:47:47 pm »
...
EDIT: now that I thought about it... Im going to write a section into the new documentation that I will release with the new version that will talk about the above and how WZ works...

That would help...

Also, you're right, classes still have to be implemented in LuaFX.

Rewriting drawing code is not hard at all.... Just rewrite it.

I don't know how I would do event handling.

I would not worry about a cursor, personally.




Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: [Prizm] Introducing LuaZM
« Reply #6 on: August 18, 2012, 05:19:27 pm »
Nice project !
If you need any help with implementing the TI-Nspire API just ask me, I've ported it to various platforms before :)

@jwalker, if you implement the Nspire API in Lua FX/ZM there is no need to change your code ;)

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: [Prizm] Introducing LuaZM
« Reply #7 on: August 18, 2012, 06:45:38 pm »
Nice project !
If you need any help with implementing the TI-Nspire API just ask me, I've ported it to various platforms before :)

@jwalker, if you implement the Nspire API in Lua FX/ZM there is no need to change your code ;)

But LuaFX does not have support for setmetatable() or classes...



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: [Prizm] Introducing LuaZM
« Reply #8 on: August 18, 2012, 09:40:32 pm »
I think that classes use setmetatable...
I could be wrong though
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: [Prizm] Introducing LuaZM
« Reply #9 on: August 19, 2012, 09:28:52 am »
This is really nice Kerm. :) It's nice that Prizm coders will have more language options available to choose from.

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: [Prizm] Introducing LuaZM
« Reply #10 on: August 19, 2012, 02:24:57 pm »
I think that classes use setmetatable...
I could be wrong though
Yes, I know, that's why I mentioned it. We can't port classes until it is integrated.



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: [Prizm] Introducing LuaZM
« Reply #11 on: August 19, 2012, 02:45:39 pm »
WOOOO
this will Definitely bring more people to the prizm, and i bet we'll be seeing much more C activity because of it as well.

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: [Prizm] Introducing LuaZM
« Reply #12 on: August 19, 2012, 03:57:03 pm »
I think that classes use setmetatable...
I could be wrong though
Yes, I know, that's why I mentioned it. We can't port classes until it is integrated.

I wonder how they got away with out having to use metatables, as they are used quit a bit.
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: [Prizm] Introducing LuaZM
« Reply #13 on: August 19, 2012, 04:04:45 pm »
I think that classes use setmetatable...
I could be wrong though
Yes, I know, that's why I mentioned it. We can't port classes until it is integrated.

I wonder how they got away with out having to use metatables, as they are used quit a bit.

Veb said he didn't think it was necessary.



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: [Prizm] Introducing LuaZM
« Reply #14 on: August 19, 2012, 05:49:08 pm »
Oh, didn't know it didn't have setmetatable ...
Metatables are a very important thing in Lua ... and without it it's much much less powerful.

Anyway, pretty sure LuaZM will have it :)