Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: parisse on June 15, 2014, 02:53:31 am

Title: lua native extension failure on 3.6
Post by: parisse on June 15, 2014, 02:53:31 am
The native lua extension example from ndless/_samples fails to load on OS 3.6. Any idea why and how to fix it? Thanks!
Title: Re: lua native extension failure on 3.6
Post by: aeTIos on June 15, 2014, 02:54:31 am
I fear this might be something that TI 'fixed'.
Title: Re: lua native extension failure on 3.6
Post by: Streetwalrus on June 15, 2014, 07:28:21 am
I fear this might be something that TI 'fixed'.
That.

Also Parisse ? Any relation with Bernard Parisse the author of Xcas ?
Title: Re: lua native extension failure on 3.6
Post by: Vogtinator on June 15, 2014, 08:06:46 am
No, native Lua extensions are an ndless thing.
I'll try it, when I've got some time again.
Title: Re: lua native extension failure on 3.6
Post by: Hayleia on June 15, 2014, 08:17:49 am
I fear this might be something that TI 'fixed'.
That.

Also Parisse ? Any relation with Bernard Parisse the author of Xcas ?
Yeah, it's him. He is also on TI Planet and the extension he is trying to get to work is a CAS again :P
Title: Re: lua native extension failure on 3.6
Post by: Streetwalrus on June 15, 2014, 08:33:20 am
Ah lol, this guy is a serial CASer. :P
Title: Re: lua native extension failure on 3.6
Post by: Hayleia on June 15, 2014, 08:36:46 am
(http://sd.keepcalm-o-matic.co.uk/i/grumpy-cat-is-not-amused.png)
Anyway :P
Yeah, he said his goal was to promote the usage of the CAS, hence why all those CAS :)
Title: Re: lua native extension failure on 3.6
Post by: Adriweb on June 15, 2014, 08:40:44 am
I reported the bug to more people capable of understanding where the issue is, so, hopefully it will get more attention soon (or at least maybe from people who have more time).

Edit : I suppose the bug is somewhere in there... https://github.com/OlivierA/Ndless/blob/e50fe929fa47f7af5ae324ffee28e68e1b8aa0b6/arm/luaext.c
Title: Re: lua native extension failure on 3.6
Post by: aeTIos on June 15, 2014, 10:15:06 am
inb4 bug gets fixed, nspire gets hybrid ndless-lua CAS
Title: Re: lua native extension failure on 3.6
Post by: Adriweb on June 15, 2014, 11:42:41 am
It's already working on 3.1, but since the Lua API on 3.1 is really crappy for D2Editor, well....
On 3.6, as soon as the lua extension works, it'll be quite awesome...
Title: Re: lua native extension failure on 3.6
Post by: Vogtinator on June 15, 2014, 12:22:26 pm
Hmm, lua extensions do definitely work, as clearly visible in the luaext.c file.
It's used for ndless 3.6 uninstallation, and that seems to work.
Title: Re: lua native extension failure on 3.6
Post by: Adriweb on June 15, 2014, 01:01:14 pm
Well, yes but no : the uninstall part is linked to a function that's defined within the .c itself, so... it's not the same.
But at least, yeah, the "register" part works.

The problem is that this line is executed, with external lua exts : "   luaL_error(L, "module " LUA_QS " not found", name);"

And, to get there, only two ways :

"if (strlen(name) >= 30) goto require_not_found;"
which isn't the case.

or :
"if (!file_each(get_documents_dir(), require_file_each_cb, modulepath))" returns true...

Why would that be ?
Title: Re: lua native extension failure on 3.6
Post by: parisse on June 15, 2014, 02:40:42 pm
Also Parisse ? Any relation with Bernard Parisse the author of Xcas ?
Yes, it's me. The giac CAS kernel is already ported to the TI nspire, but it lacks a UI. I believe the easiest is to write the UI in lua, and Adriweb already wrote a lua script using the lua module that demonstrate it works, unfortunately only on OS 3.1, not 3.6. I hope it's easy to fix, otherwise I'll have to write a C(++) UI, probably based on nSDL, so that the code base can be shared with the web interface of giac (using emscripten to convert SDL to javascript). SDL could also enable embedded 2-d graphics in a CAS calculation screen.
Title: Re: lua native extension failure on 3.6
Post by: Jim Bauwens on June 15, 2014, 02:47:43 pm
My assumptions:

On OS 3.1, things were a bit different for the package-lua-loading stuff. It wasn't included by default in the Lua that got shipped. But as of 3.2, it was (because for the physics, color and some several other libraries). The issue will be that the method of patching the library support into Lua will not work as it did in 3.1. Now, a fix might not be too hard, but the question is will TI's libraries still work? I think they have some kind of custom package loading system in place, so the new patch will have to take this into account.
Title: Re: lua native extension failure on 3.6
Post by: Adriweb on June 15, 2014, 03:05:12 pm
Also Parisse ? Any relation with Bernard Parisse the author of Xcas ?
Yes, it's me. The giac CAS kernel is already ported to the TI nspire, but it lacks a UI. I believe the easiest is to write the UI in lua, and Adriweb already wrote a lua script using the lua module that demonstrate it works, unfortunately only on OS 3.1, not 3.6. I hope it's easy to fix, otherwise I'll have to write a C(++) UI, probably based on nSDL, so that the code base can be shared with the web interface of giac (using emscripten to convert SDL to javascript). SDL could also enable embedded 2-d graphics in a CAS calculation screen.
Also, there's "deep(er)" OS integration that Excale when he's less busy :)
The Lua side is interesting because we can customize it more the way we want, but still integrated within the OS.
Title: Re: lua native extension failure on 3.6
Post by: Streetwalrus on June 15, 2014, 03:19:48 pm
Having a new, less buggy CAS for the Nspire is going to be great. TI will hate though. :P
Title: Re: lua native extension failure on 3.6
Post by: Jim Bauwens on June 15, 2014, 03:22:38 pm
Having a new, less buggy CAS for the Nspire is going to be great. TI will hate though. :P

Each CAS engine has it positive sides, each their negative sides. I'm not going to go into discussion of 'what is the best CAS engine' because I believe I do not know enough about how both function in order to give arguments. But I do give respect to both parties because they have done a very good job. TI's CAS engine too, it is not as buggy as people might say. Yes, it does have bugs, but every software has that. It is a very respectable CAS engine.
Title: Re: lua native extension failure on 3.6
Post by: Streetwalrus on June 15, 2014, 03:27:33 pm
I'm far from bashing it. I've already used it and it works just fine but people seem to be complaining a lot about bugs.
Title: Re: lua native extension failure on 3.6
Post by: Adriweb on June 15, 2014, 03:32:37 pm
And... nevermind, I found the issue : in 3.6, we have to use "nrequire" instead of "require", so Extended did the job well to workaround the problem explained by Jim :)
Title: Re: lua native extension failure on 3.6
Post by: Adriweb on June 15, 2014, 04:44:50 pm
Merge with my post if you want, but ...

(http://i.imgur.com/rzIYgW9.png)

:)
Title: Re: lua native extension failure on 3.6
Post by: Streetwalrus on June 15, 2014, 05:32:15 pm
Yay. :D
Title: Re: lua native extension failure on 3.6
Post by: parisse on June 16, 2014, 07:09:35 am
Thanks to Adriweb and critor, the 0.1 version of Khicas (Khi like the greek letter, looks like the X of Xcas, pronounce it like kick-ass) for TI Nspire all models OS 3.6 is now available here:
http://www-fourier.ujf-grenoble.fr/~parisse/calc/khicas.zip (http://www-fourier.ujf-grenoble.fr/%7Eparisse/calc/khicas.zip)
I'm now going to learn a little lua, I believe there is room to improve menus, online help, etc.

[Edit]: warning, running khicas during an exam where CAS calculators are banned is of course forbidden.
Title: Re: lua native extension failure on 3.6
Post by: aeTIos on June 16, 2014, 08:36:15 am
My OCD tells me to tell you that iirc the letter is Chi (at least I learned it that way :P). Cool to hear that you've released Xcas for nspire 3.6 :D Now I might have to upgrade my system after all.
Title: Re: lua native extension failure on 3.6
Post by: Adriweb on June 16, 2014, 08:57:10 am
It can be spelled both ways (but especially Khi in French :P).

Anyway... χcas
Title: Re: lua native extension failure on 3.6
Post by: Streetwalrus on June 16, 2014, 09:15:28 am
I'm French and I say Ki. :P
Oh, and this convinced me to upgrade to 3.6.
Title: Re: lua native extension failure on 3.6
Post by: bb010g on June 16, 2014, 09:16:57 am
Oh, and this convinced me to upgrade to 3.6.
Plot twist: They're working for TI.
Title: Re: lua native extension failure on 3.6
Post by: aeTIos on June 16, 2014, 09:53:57 am
Oh, and this convinced me to upgrade to 3.6.
Plot twist: They're working for TI.
If that were true they'd say they had ported ndless to 3.9. But still, nice joke :P
Title: Re: lua native extension failure on 3.6
Post by: quadratic77 on June 16, 2014, 02:28:29 pm
My calculator (Nspire CX CAS 3.6) crashes and hard-reboots after I run Khicas. Any ideas?
Title: Re: lua native extension failure on 3.6
Post by: Adriweb on June 16, 2014, 03:52:32 pm
Try having a "clean" RAM (reset button) before launching (I've had such crashes before, too)
Title: Re: lua native extension failure on 3.6
Post by: quadratic77 on June 16, 2014, 06:22:54 pm
Thank you, it works. This is great! :D