Author Topic: lua native extension failure on 3.6  (Read 15099 times)

0 Members and 1 Guest are viewing this topic.

Offline parisse

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
lua native extension failure on 3.6
« 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!

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: lua native extension failure on 3.6
« Reply #1 on: June 15, 2014, 02:54:31 am »
I fear this might be something that TI 'fixed'.
I'm not a nerd but I pretend:

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: lua native extension failure on 3.6
« Reply #2 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 ?

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: lua native extension failure on 3.6
« Reply #3 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.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: lua native extension failure on 3.6
« Reply #4 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
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: lua native extension failure on 3.6
« Reply #5 on: June 15, 2014, 08:33:20 am »
Ah lol, this guy is a serial CASer. :P

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: lua native extension failure on 3.6
« Reply #6 on: June 15, 2014, 08:36:46 am »

Anyway :P
Yeah, he said his goal was to promote the usage of the CAS, hence why all those CAS :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: lua native extension failure on 3.6
« Reply #7 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
« Last Edit: June 15, 2014, 08:45:48 am by Adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: lua native extension failure on 3.6
« Reply #8 on: June 15, 2014, 10:15:06 am »
inb4 bug gets fixed, nspire gets hybrid ndless-lua CAS
I'm not a nerd but I pretend:

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: lua native extension failure on 3.6
« Reply #9 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...
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: lua native extension failure on 3.6
« Reply #10 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.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: lua native extension failure on 3.6
« Reply #11 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 ?
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline parisse

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
Re: lua native extension failure on 3.6
« Reply #12 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.

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: lua native extension failure on 3.6
« Reply #13 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.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: lua native extension failure on 3.6
« Reply #14 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.
« Last Edit: June 16, 2014, 03:53:17 pm by Adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation