Omnimaga
Omnimaga => News => Topic started by: Adriweb on February 16, 2012, 06:21:01 pm
-
The latest Ndless update provides a wonderful we've been excited about for some time now : Third-Party Lua Extensions !
You can see the news article on TI-Planet.org there (http://tiplanet.org/forum/viewtopic.php?f=43&t=8807), or right here directly translated in English :
Hi all, Today is a great day (like many others these days...)
You know already that, on the Nspire, it was possible to program in:
- Basic : the more integrated with the OS, with great math interactions. However, it is slow and has few graphics possibilities etc..
- Lua : Since OS 3, TI added this interpreted language that fits the Nspire very well and provides great improvements over the Basic, thanks to strong performances in both graphic and power etc.. Lua is known to be easy to use and flexible in terms of language itself.
- C / Asm : Thanks to jailbreak Ndless. This is the most powerful because it directly controls the calculator's processor (ARM9). However, it is quite difficult to master especially for beginners.
Now Extended (Ndless author) offers to combine the power of C with the simplicity of Lua, with the "xLua" (for "eXtendedLua ", but it is I who named like that, Extended did not specify a name. ... )
I am announcing today the appearance of native extensions on Lua!
Mix native routines with your Lua scripts (using Lua modules)!
Isn't that awesome ?
To take advantage of this new feature, download the latest version of Ndless (see end of this post), and once installed, transfer samples/luaextdemo.tns to a folder named ' /ndless/luaext 'on your TI-Nspire, and run runluaextdemo.tns to have a simple example (prints "hello world" on the console). Note by the way the return of "print ()" (sound output is back !) that TI was removed in version 3.1 ...
Writing extensions is fairly simple and is based on the C API standard Lua. You can judge for yourself in the sources available in the download ( src/samples/luaextdemo ).
Official Manual: http://www.lua.org/manual/5.1/manual.html#3 (http://www.lua.org/manual/5.1/manual.html#3)
For now, only a few API functions are available, but this is improving day by day!
We can therefore take advantage graphical routines faster! (Especially for images ...)
Your extensions ideas are welcome !
Download the latest version ( r547 ) of Ndless 3.1: http://tiplanet.org/forum/archives_voir.php?id=3891 (http://tiplanet.org/forum/archives_voir.php?id=3891)
Please note that this "xLua" feature is this in development and can be buggy, so use it at your own risks :)
-
I thought your news would be about nCrysis or nStarcraft??? O.O
j/k awesome. :) So basically we can now use C/ASM in our Lua programs? It might be nice because some people tend to have troubles programming some stuff in C or ASM, so while parts of their games (usually ones that requires speed) are written in native language or C, they can write the rest in Lua, right? It reminds me how on the TI-83+ we got xLIB and Doors CS BASIC libs, how in Axe we got axioms and how on 68K calcs we got Vertel/Flib. :)
Btw you should really put download links to this in the downloads section here, even if it redirects to TI-Planet. It would still be easy to keep up to date, but also give the program more visibility. :)
-
This is a pretty interesting improvement, but I'm not sure if I'll use it. :P
Does this mean you can actually get a clock on the Nspire? That would actually be pretty useful.
Great job to ExtendeD once again!
-
Hey that's pretty awesome, keep up the good job :D
-
wow, cool
-
Just plainly epic, I can't describe how happy I am!
(Because now you can do anything with Lua, anything)
-
Yeah, that's another major, and very interesting, development. TI chose to deprive programmers and users from such power, but the closed platform is being slowly opened, bit by bit :)
Sadly, it remains as likely as ever (unless TI strongly surprises us by performing a radical U-turn, reversing their stance of the past six-seven years) that the next OS release, in a few weeks (?), blocks completely the third iteration of Ndless, instead of taking advantage of the possibilities of native code...
-
Btw you should really put download links to this in the downloads section here, even if it redirects to TI-Planet. It would still be easy to keep up to date, but also give the program more visibility. :)
We cannot redirect directly to the TI-Planet file download script, only to the TI-Planet file description page on which you can click the download button.
Indeed, we had to add a protection key for the TI-Planet downloads, as some site was trying to directly link our download script as if it was their own files ( = without mentionning us ).
Like the watermarks on our images, again, were are very sad having to do that.
-
Can we use Lua in our C code (mostly C, a little Lua)? I would like to be able to use the pretty font Lua has in my C programs.
-
Embedding an instance of the Lua interpreter in a C program would be possible. But TI's specific Lua GUI API requires being fully integrated with the document editor, what you want to do wouldn't be possible.
-
I have an idea for having an extension in the same tns file as the lua script.
TNS files still work if you cat data to the end of it, so you could do something like this:
[Lua file Data - Ndless Data - a few bytes that contain the offset of the Ndless data to the end of the file]
Maybe you could link this to the name 'self', so require 'self'
What do you think?
-
Interesting idea :)