Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => Casio PRIZM => Topic started by: KermMartian on August 17, 2012, 06:04:17 pm

Title: [Prizm] Introducing LuaZM
Post by: KermMartian on August 17, 2012, 06:04:17 pm
The Casio Prizm is a powerful calculator, great for both math (http://www.cemetech.net/programs/index.php?mode=file&id=727) and playing games (http://prizm.cemetech.net/index.php?title=Prizm_User_Portal). It is particularly great for programming, and for months thoroughly bested the TI-Nspire calculator (http://www.cemetech.net/news.php?id=443) 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 (http://www.lua.org/) 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 (http://www.cemetech.net/forum/viewtopic.php?t=8020) 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 (http://www.cemetech.net/forum/viewtopic.php?t=8093). Bonus features: Planned transparent support for Nspire and Lua FX programs.

(http://www.cemetech.net/img/projects/luazm/firstsuccess.jpg)
Title: Re: [Prizm] Introducing LuaZM
Post by: jwalker 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.
Title: Re: [Prizm] Introducing LuaZM
Post by: flyingfisch 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...
Title: Re: [Prizm] Introducing LuaZM
Post by: DJ Omnimaga 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!
Title: Re: [Prizm] Introducing LuaZM
Post by: jwalker 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...
Title: Re: [Prizm] Introducing LuaZM
Post by: flyingfisch 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.

Title: Re: [Prizm] Introducing LuaZM
Post by: Jim Bauwens 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 ;)
Title: Re: [Prizm] Introducing LuaZM
Post by: flyingfisch 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...
Title: Re: [Prizm] Introducing LuaZM
Post by: jwalker on August 18, 2012, 09:40:32 pm
I think that classes use setmetatable...
I could be wrong though
Title: Re: [Prizm] Introducing LuaZM
Post by: TIfanx1999 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.
Title: Re: [Prizm] Introducing LuaZM
Post by: flyingfisch 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.
Title: Re: [Prizm] Introducing LuaZM
Post by: shmibs 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.
Title: Re: [Prizm] Introducing LuaZM
Post by: jwalker 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.
Title: Re: [Prizm] Introducing LuaZM
Post by: flyingfisch 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.
Title: Re: [Prizm] Introducing LuaZM
Post by: Jim Bauwens 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 :)
Title: Re: [Prizm] Introducing LuaZM
Post by: flyingfisch on August 19, 2012, 07:37:28 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 :)

Yeah, and I think LuaFX is going to have it eventually too...
Title: Re: [Prizm] Introducing LuaZM
Post by: KermMartian on August 20, 2012, 04:25:46 pm
LuaZM already has fully-functioning metatables. :) Progress continues at a rapid pace.
Title: Re: [Prizm] Introducing LuaZM
Post by: Adriweb on August 20, 2012, 04:35:32 pm
Nice !
Title: Re: [Prizm] Introducing LuaZM
Post by: jwalker on August 20, 2012, 05:59:06 pm
Wow, its progressing fast...
Title: Re: [Prizm] Introducing LuaZM
Post by: DJ Omnimaga on August 21, 2012, 01:57:56 pm
Glad to hear Kerm. Can't wait to see some demos in action. :)