Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: Munchor on April 14, 2011, 04:10:47 am

Title: Can you code in Lua?
Post by: Munchor on April 14, 2011, 04:10:47 am
In response to the recent news that the NSpire OS 3.0 can be programmed using Lua, a new subforum was created aimed at Lua Language.

I'd like to know who of you know Lua, like me :) I learnt Lua a few months ago, but haven't coded a lot of programs, it was more just learning.
Title: Re: Can you code in Lua?
Post by: Jim Bauwens on April 14, 2011, 04:16:38 am
I haven't programmed in it yet, but it looks easy to me.
I'm sure that most people will not have an problem using it.
Title: Re: Can you code in Lua?
Post by: Munchor on April 14, 2011, 04:18:06 am
I haven't programmed in it yet, but it looks easy to me.
I'm sure that most people will not have an problem using it.

It's interpreted, just like python, in fact, python, lua and ruby are quite similar.
Title: Re: Can you code in Lua?
Post by: Levak on April 14, 2011, 08:52:44 am
I know CAML, Python and many other languages, so theire is nothing new for me in lua, except a new Lego game to assemble object and recursivity. =)
Title: Re: Can you code in Lua?
Post by: Stefan Bauwens on April 14, 2011, 08:57:02 am
I voted 'No, will learn'. But its actualy 'No, maybe will learn'.
I am not busy on the nspire. Jim just bought one today(for himself) and I'm busy with myst...
But if I start going on the nspire I feel I have to learn lua before I can program 'something good'.
Title: Re: Can you code in Lua?
Post by: Adriweb on April 14, 2011, 09:00:09 am
I've programmed some World of Warcraft addons (which are done in LUA) so I'm not bad :)
But it's been quite a while and I'll dive into it again !
Title: Re: Can you code in Lua?
Post by: TIfanx1999 on April 14, 2011, 09:59:34 am
I accidentally voted no, but will learn. I meant to vote no, and will not learn. I really have no reason to learn LUA as i don't own or program for the Nspire.
Title: Re: Can you code in Lua?
Post by: Munchor on April 14, 2011, 10:54:14 am
I accidentally voted no, but will learn. I meant to vote no, and will not learn. I really have no reason to learn LUA as i don't own or program for the Nspire.

I think you can change your vote, though.
Title: Re: Can you code in Lua?
Post by: z80man on April 14, 2011, 11:22:28 am
Yes I learned it last year. it is a very easy language to get started with. But I will not be coding the Nspire with it  :P
Title: Re: Can you code in Lua?
Post by: AngelFish on April 14, 2011, 11:30:47 am
I'll never use it, but knowing myself, I'll want to try something with it so I'll learn the language, then get bored and never touch it again :P
Title: Re: Can you code in Lua?
Post by: Ashbad on April 14, 2011, 01:21:50 pm
I know Lua extremely well :)  It's actually a very powerful language for an interpreter, and I like it much more than python, because of stright out OOP, it has a much simpler table system -- it can be a pain for some applications, but for others it saves some programming time, and helps you think of the object easier :)
Title: Re: Can you code in Lua?
Post by: Munchor on April 14, 2011, 03:11:31 pm
I know Lua extremely well :)  It's actually a very powerful language for an interpreter, and I like it much more than python, because of stright out OOP, it has a much simpler table system -- it can be a pain for some applications, but for others it saves some programming time, and helps you think of the object easier :)

I don't wanna discuss this, but Python's OOP is better than Lua's.
Title: Re: Can you code in Lua?
Post by: aeTIos on April 14, 2011, 03:21:33 pm
In your opinion. Please let us discuss Lua here. (No offense)
I think OOP is way to complicated for calcs.
Title: Re: Can you code in Lua?
Post by: Ashbad on April 14, 2011, 03:25:50 pm
I know Lua extremely well :)  It's actually a very powerful language for an interpreter, and I like it much more than python, because of stright out OOP, it has a much simpler table system -- it can be a pain for some applications, but for others it saves some programming time, and helps you think of the object easier :)

I don't wanna discuss this, but Python's OOP is better than Lua's.

Lua really doesn't really even have OOP -- it just can group methods and variables and other tables into a table, which can somewhat represent an object ;)
Title: Re: Can you code in Lua?
Post by: Levak on April 14, 2011, 03:46:55 pm
Nobody has thought about the fact that the entire TI OS could be coded in Lua ?
Look:
 - TI was really fast to implement this Lua interpreter (since 05/2010)
 - Same Way of programming, Lua's objects and "toto.a, toto.b, toto.c etc .." variables, math.eval("DelVar "..varname) and expr("DelVar "&varname)
 - Same way of TNS structure, in the XML files, we've got "<gg:VAR></gg:VAR>" token for the widget variables, in the Lua's interpreted method we've got the "gc:" object

Thus, only one question : Can Lua be compiled ? or just directly interpreded by the ARM core ?
Title: Re: Can you code in Lua?
Post by: DJ Omnimaga on April 14, 2011, 06:25:50 pm
I don't know Lua, but maybe I'll check it out eventually.
Title: Re: Can you code in Lua?
Post by: Deep Toaster on April 14, 2011, 06:33:04 pm
I know what Lua is, but not the language itself. Definitely gonna learn it, if only to test on nspire_emu :D

I learnt Lua a few months ago, but haven't coded a lot of programs, it was more just learning.

Lucky for you, eh? ;D

I know Lua extremely well :)  It's actually a very powerful language for an interpreter, and I like it much more than python, because of stright out OOP, it has a much simpler table system -- it can be a pain for some applications, but for others it saves some programming time, and helps you think of the object easier :)

I don't wanna discuss this, but Python's OOP is better than Lua's.

First of all, Lua is not an OOP language, so you can't really do that comparison there. Otherwise you'd be saying something like "Axe's sprite commands are better than BASIC's." Yeah, because BASIC doesn't have sprite commands ;)

Nobody has thought about the fact that the entire TI OS could be coded in Lua ?
Look:
 - TI was really fast to implement this Lua interpreter (since 05/2010)
 - Same Way of programming, Lua's objects and "toto.a, toto.b, toto.c etc .." variables, math.eval("DelVar "..varname) and expr("DelVar "&varname)
 - Same way of TNS structure, in the XML files, we've got "<gg:VAR></gg:VAR>" token for the widget variables, in the Lua's interpreted method we've got the "gc:" object

Thus, only one question : Can Lua be compiled ? or just directly interpreded by the ARM core ?


Wow, that's an interesting thought. If TI already has a Lua compiler, they could just release that and we wouldn't need to worry about this hacking just to get some ASM working on an Nspire.
Title: Re: Can you code in Lua?
Post by: AngelFish on April 14, 2011, 07:05:30 pm
I think ASM needs to be brought to the Nspire either way, because if nothing else TI will undoubtedly have screwed up their Lua interpreter and someone in the community will need to fix it. Plus, just try writing nDoom in an interpreted language :P
Title: Re: Can you code in Lua?
Post by: Deep Toaster on April 14, 2011, 07:06:40 pm
Oh, true x.x

But if Lua can be compiled as Levak suggested, it might not be too bad.
Title: Re: Can you code in Lua?
Post by: willrandship on April 14, 2011, 07:36:57 pm
It's bytecode compiling, like java, and .pyc python files, so it's not really like asm.
Title: Re: Can you code in Lua?
Post by: Sebasu on April 15, 2011, 12:21:13 am
i asked some months ago to the technical support of TI about the posibility of an SDK for the Nspire, they answer me that the SDK was possible in models like ti-89 titanium because this calculators was using flashROM, but the nspire don´t use this, the lua posibility to programing will be usefull, but ASM programing couldn't be posible
Title: Re: Can you code in Lua?
Post by: AngelFish on April 15, 2011, 12:26:00 am
Um, the Nspire uses Flash ROM too. Also, ASM is already possible on the regular Nspire, so it should be possible on the CX as well.
Title: Re: Can you code in Lua?
Post by: Munchor on April 15, 2011, 07:15:14 am
i asked some months ago to the technical support of TI about the posibility of an SDK for the Nspire, they answer me that the SDK was possible in models like ti-89 titanium because this calculators was using flashROM, but the nspire don´t use this, the lua posibility to programing will be usefull, but ASM programing couldn't be posible

Um, the Nspire uses Flash ROM too. Also, ASM is already possible on the regular Nspire, so it should be possible on the CX as well.

I'm pretty sure they lied, the NSpire uses Flash ROM.

In the meanwhile, no SDK available here (http://education.ti.com/educationportal/sites/US/productCategory/us_sdk.html).
Title: Re: Can you code in Lua?
Post by: DJ Omnimaga on April 16, 2011, 12:47:22 am
They told to some other people they did not have any plan to open the Nspire to 3rd party development. However you must not believe everything they say via TI-CARES, because sometimes the person who answers will guess the answer. X.x
Title: Re: Can you code in Lua?
Post by: JosJuice on April 16, 2011, 08:22:42 am
i asked some months ago to the technical support of TI about the posibility of an SDK for the Nspire, they answer me that the SDK was possible in models like ti-89 titanium because this calculators was using flashROM, but the nspire don´t use this, the lua posibility to programing will be usefull, but ASM programing couldn't be posible
Wtf... TI lies so much. The Nspire clearly has Flash ROM! And Flash ROM has nothing to do with programmability anyway...
Title: Re: Can you code in Lua?
Post by: Snake X on April 16, 2011, 08:35:06 am
Sorry too busy atm in life to learn a new language.
Title: Re: Can you code in Lua?
Post by: Goplat on April 16, 2011, 02:20:11 pm
i asked some months ago to the technical support of TI about the posibility of an SDK for the Nspire, they answer me that the SDK was possible in models like ti-89 titanium because this calculators was using flashROM, but the nspire don´t use this, the lua posibility to programing will be usefull, but ASM programing couldn't be posible
Wtf... TI lies so much. The Nspire clearly has Flash ROM!
NAND Flash isn't generally called "ROM", because it can't be mapped into memory where you can execute code from it directly. It's more like a hard disk, in that you have to read the contents into RAM. (Not that that in any way prevents an SDK from being possible, of course)
Title: Re: Can you code in Lua?
Post by: Munchor on April 17, 2011, 05:34:15 am
Is anyone planning on making a NSpire Lua IDE soon? I'd like to help if anyone is interested in starting such project.
Title: Re: Can you code in Lua?
Post by: ExtendeD on April 17, 2011, 07:28:42 am
What would such an IDE do? There are already plenty of IDE compatible with Lua, that can integrate the TI-Nspire conversion tools.
Title: Re: Can you code in Lua?
Post by: Munchor on April 17, 2011, 07:35:02 am
What would such an IDE do? There are already plenty of IDE compatible with Lua, that can integrate the TI-Nspire conversion tools.

Yeah I meant a text editor with syntax highlighting with .tns>Lua althogether. But you're probably right, it's not that important.
Title: Re: Can you code in Lua?
Post by: Lionel Debroux on April 17, 2011, 07:37:09 am
Agreed with ExtendeD. Customizing several existing, good scriptable IDEs, is better than writing from scratch a Nspire-specific IDE, and that specific IDE ending up being sub-par (ala TIGCC IDE).
Title: Re: Can you code in Lua?
Post by: DJ Omnimaga on April 18, 2011, 01:21:52 am
Ticalc.org has posted a news about Lua and added new TI-Nspire Lua directories: http://www.ticalc.org/archives/news/articles/14/147/147339.html

Happy uploading!
Title: Re: Can you code in Lua?
Post by: Levak on April 18, 2011, 05:02:56 am
Personally, I've scripted my gedit to "maketns" and save wiith Ctrl+L (like "L"ua).
Title: Re: Can you code in Lua?
Post by: Adriweb on April 18, 2011, 05:31:56 am
my 3-screen setup (thats only during school break, tho, I usually don't have all these screens at the same time :P)

Title: Re: Can you code in Lua?
Post by: Levak on April 18, 2011, 06:23:18 am
/me is jalous
Title: Re: Can you code in Lua?
Post by: Munchor on April 18, 2011, 06:32:12 am
/me sees Levak has an Ubuntu!

You guys should post this pics in the Cave topic.
Title: Re: Can you code in Lua?
Post by: ingalls on April 22, 2011, 07:06:07 pm
Oops I was reading the first page, didn't realize it kept going...

Anyways, I found this about compiling Lua Scripts...

According to the posts I found here -->http://forums.qj.net/psp-development-forum/82656-compiling-lua-scripts-luac.html (http://forums.qj.net/psp-development-forum/82656-compiling-lua-scripts-luac.html)
It looks like it can. There is a link to a sourceforge project...

Cheers
Ingalls
Title: Re: Can you code in Lua?
Post by: Adriweb on April 26, 2011, 02:09:33 pm
To make Levak even more jealous ...

(http://i.imgur.com/uBniI.jpg)


these aren't all mine, I gathered them for a homework movie scene I have to film :P
Title: Re: Can you code in Lua?
Post by: jnesselr on April 26, 2011, 09:27:45 pm
I would have downrated that post, but I started drooling, and accidentally hit the wrong button.  Oh well....
Title: Re: Can you code in Lua?
Post by: Deep Toaster on April 26, 2011, 09:34:39 pm
How could you put the MacBook so close to the edge? Don't you have any sense of respect?
</offtopic>

Well, I leaned Lua :w00t: Now to get nspire_emu working so I can code.
Title: Re: Can you code in Lua?
Post by: Adriweb on April 27, 2011, 04:41:06 am
How could you put the MacBook so close to the edge? Don't you have any sense of respect?

Dont worry, it's a lot more on the table that suspending in the air (meh, I don't know how to say that in english :o, but you understand) ....

:P

And nice about learning Lua !

Good luck programming nice things now ! :D
Title: Re: Can you code in Lua?
Post by: DJ Omnimaga on April 27, 2011, 09:45:34 pm
my 3-screen setup (thats only during school break, tho, I usually don't have all these screens at the same time :P)
(http://www.omnimaga.org/index.php?action=dlattach;topic=7772.0;attach=7407;image)


If I had the same setup as you, it would look more like this:
Title: Re: Can you code in Lua?
Post by: AngelFish on April 27, 2011, 11:06:27 pm
My 15.5" laptop screen is starting to have an inferiority complex. Now I have to get it counseling. Thanks DJ and Adriweb :P
Title: Re: Can you code in Lua?
Post by: Munchor on April 28, 2011, 03:13:13 pm
Oh my! DJ ruined my life too. GIMME YOUR MAC WILL YOU PLEASE? :P

My 15'4 laptop screen is feeling bad now. I have another computer though, but it doesn't work.
Title: Re: Can you code in Lua?
Post by: Levak on April 28, 2011, 03:38:27 pm
Oh my! DJ ruined my life too. GIMME YOUR MAC WILL YOU PLEASE? :P

It is Adriweb one. Have a look to the previous posts.
Title: Re: Can you code in Lua?
Post by: Yeong on April 28, 2011, 03:40:45 pm
so...
multiple screens == better programs
:P
Title: Re: Can you code in Lua?
Post by: yrinfish on April 28, 2011, 04:31:13 pm
No it isn't, it is smaller screens == better programs
Title: Re: Can you code in Lua?
Post by: DJ Omnimaga on May 11, 2011, 06:18:41 pm
Larger resolutions or more screens usually means more time required to render graphics, but if each screen is connected to a different video card, then it isn't as much of a problem, usually.
Title: Re: Can you code in Lua?
Post by: AngelFish on May 11, 2011, 06:20:30 pm
Does Lua bytecode count as Lua :P

I can kind of almost code in Lua now, although I'm pretty bad at it.
Title: Re: Can you code in Lua?
Post by: Deep Toaster on May 19, 2011, 03:37:41 pm
And now it's all over. Brilliant.
Title: Re: Can you code in Lua?
Post by: BrownyTCat on May 19, 2011, 03:39:13 pm
And now it's all over. Brilliant.
Perfect "FFFUUUUU" moment for OS 3.0.2 users.
Title: Re: Can you code in Lua?
Post by: Deep Toaster on May 22, 2011, 11:47:39 pm
So now that they've given us the SDK... Back to learning Lua! Unless they decide to make the SDK for-pay, but I don't see how they can, now that we already have it and they've let us publish it.
Title: Re: Can you code in Lua?
Post by: Jonius7 on May 22, 2011, 11:55:29 pm
I guess i will learn it when all this OS3.0 unstableness has been settled and i upgrade my ti-nspire. Definitely yes.
Title: Re: Can you code in Lua?
Post by: BrownyTCat on May 23, 2011, 10:40:37 am
So now that they've given us the SDK... Back to learning Lua! Unless they decide to make the SDK for-pay, but I don't see how they can, now that we already have it and they've let us publish it.
A bunch of people will probably just pirate it or re-crack the Lua to TNS code.