Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: aeTIos on March 29, 2014, 05:06:47 am

Title: LuaZM-like interpreter for nspire?
Post by: aeTIos on March 29, 2014, 05:06:47 am
So this might sound silly, because the nspire has native Lua support. Still, it's programming flow isn't optimal for programming games, mainly due to the lack of key repeat. So I'm asking if someone could port LuaZM to the nspire? (I think LuaZM is written in c, so that should be fairly easy)

TIA and kudos to anyone who pulls this off!

You will also get cherries.
Title: Re: LuaZM-like interpreter for nspire?
Post by: The_King on March 29, 2014, 09:39:20 pm

You will also get cherries.

Can i have some without coding :P

Anyway that would be a good idea

now only if my nspire's touchpad hadnt gone haywire...
Title: Re: LuaZM-like interpreter for nspire?
Post by: Juju on March 30, 2014, 12:06:35 am
Something that would be cool is a way to integrate new libraries in the already existing Lua engine. Maybe with Ndless?
Title: Re: LuaZM-like interpreter for nspire?
Post by: aeTIos on March 31, 2014, 04:08:53 pm
I'd also be OK with that. Thing is, I hate event based programming. It makes things complicated for me.
Inb4 adriweb walks in and starts praising event based programming :p
Title: Re: LuaZM-like interpreter for nspire?
Post by: Adriweb on March 31, 2014, 04:24:57 pm
dammit now I have to reply.

You know, event-based programming, in Nspire-Lua, is great.
It is good for designing of software's and applications. It has four main advantages and/or uses: flexibility, suitability for graphical interfaces, ease of development, and simplicity of programming. Event driven programming is one among the few largely flexible programming language types. It allows the programmer to visually design the form to their needs and program the objects on the form with a huge range of events that can do different things when run.
I believe it's a very nice choice from TI to have put their API that way, because, for example, haveing a big while loop for the keypresses wouldn't be very good for big scripts, especially since we only have one big script file.


(because source has to be linked : http://www.ask.com/question/what-is-event-driven-programming-good-for )



anyway, for those wanting to port LuaZM, go ahead, it can only be fun
Title: Re: LuaZM-like interpreter for nspire?
Post by: aeTIos on March 31, 2014, 04:40:28 pm
I don't see how a big bunch of keypress checks hurts a program? Most of the time you shouldn't have your keychecks in a while loop unless you consider the big loop to be it.
Title: Re: LuaZM-like interpreter for nspire?
Post by: TIfanx1999 on March 31, 2014, 04:55:55 pm
Since we already do have a functioning Lua supported by TI, I'm not sure this will happen. I'd also guess that files for one version of Lua wouldn't work with the other, and that could get a little confusing. Just observations.
Title: Re: LuaZM-like interpreter for nspire?
Post by: aeTIos on March 31, 2014, 05:03:52 pm
So, go for the ndless lua extensions. The thing that's on top of my list is key repeat. I'd murder for that, really. (well, not really, but you get the point)
Title: Re: LuaZM-like interpreter for nspire?
Post by: Adriweb on March 31, 2014, 05:40:58 pm
I don't see how a big bunch of keypress checks hurts a program? Most of the time you shouldn't have your keychecks in a while loop unless you consider the big loop to be it.
It kind of makes everything global, though.
Title: Re: LuaZM-like interpreter for nspire?
Post by: DJ Omnimaga on April 03, 2014, 02:54:59 pm
Personally this wouldn't be that useful except for people who wants to code in Lua but wants the speed of C or close, since TI's Lua, in some cases, can still be pretty slow. However, it would make it easier to play PRIZM Lua programs since all you would have to do is load the LuaZM file on  the calc. It would probably require some modifying, though, since the PRIZM resolution width is larger than the Nspire CX.

Also the Nspire version of Lua has the disadvantage of only allowing 1 keypress at a time.
Title: Re: LuaZM-like interpreter for nspire?
Post by: Aspiring on April 03, 2014, 04:52:35 pm
Perhaps it would be possible to add in luaJIT to make blazing fast lua. http://luajit.org/index.html (http://luajit.org/index.html)