Author Topic: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)  (Read 59158 times)

0 Members and 1 Guest are viewing this topic.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #90 on: August 11, 2013, 06:53:43 pm »
Wouldn't have it made sense to split the nspire support into an entirely different lib?
It doesn't share ANY code (except unneeded, like FileContent, which is for file group support and VirtualPacket) and it is very unlikely
to be used by an application which supports both the nspire and the other TI calcs.
And it seems I accidentially circumvented the
Quote
assumptions that there's a single / in a valid calculator-side path
by not using a slash in front of the path :P
I know it's slowly getting off-topic, but it doesn't fit anywhere else and the previous posts are important for context.
If anyone wants to move it :D

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #91 on: August 12, 2013, 02:06:46 am »
Quote
Wouldn't have it made sense to split the nspire support into an entirely different lib?
In 2007, Romain LiƩvin definitely thought about making a new, fresh library, instead of adding support for the Nspire to libti*.
On the one hand, it would have made some sense, given that support for the Nspire doesn't use a number of facilities of the framework that the TI-Z80 and TI-68k supports use.
On the other hand, it's a calculator with mostly the same operations as the others, there is definitely some code sharing, it has the same direct USB cable as the 84+(C)(SE) and 89T, so it could be made to fit within the rest of the framework, and have TILP not depend on two different, though very similar, libraries.

Quote
It doesn't share ANY code (except unneeded, like FileContent, which is for file group support and VirtualPacket)
While some of them are definitely unnecessary for the Nspire, don't be too quick to remove all layers of data structures and abstractions. Cable send/receive (libticables) <- raw packet (splitting/reassembling what goes over the wire, nsp_rpkt) <- virtual packet and session handling (nsp_vpkt) <- commands (nsp_cmd) <- calc functions (calc_nsp) <- high-level operations combining multiple functions (e.g. tilp_calcs.c) does make perfect sense, even in the context of a single calculator and protocol series.
Although it looked complicated to me as well in the beginning, and it isn't perfect (but who is ?), the fact that the making of the libti* framework has received some thought. For the narrower purposes of interacting with the Nspire, it's over-designed... but it's much better to somewhat over-design things, than to under-design them and have to significantly refactor them later :)
"Start from small stuff and try to scale up" was exactly the approach used by Microsoft in the MS-DOS, then "early" Windows area (all the way up to ME), instead of "descend from big stuff and scale down to smaller computers" like the *nix series does... The end result was not quite the same from a reliability point of view.
Quote
and it is very unlikely to be used by an application which supports both the nspire and the other TI calcs.
TILP is actually the main use case, the one the libs have always been primarily designed for ;)


In 2007, what Romain did was probably the best course of action at the time. People were only warming up to Qt 4 (from 2005), the first version which had a FLOSS code base for Windows, and porting from Glib/GTK+ to Qt 4+ would have been much more work than the libti*/TILP I -> II API rework. At least, he was able to complete the API rework in the time he could allocate to it, instead of having some unfinished transition, and we all have been able to build some stuff on top of the improved rewrite since then :)
Nowadays, in 2013, restarting from scratch to build a C++11/STL, framework-neutral code base, on top of which Qt applications can be built without a Glib dependency, is a good idea, and has been for a while...

I'm convinced that the making the skeleton of a brand-new C++ framework tailored to the Nspire (but by all means, keeping the good design bits of the old ones, and reusing lots of code because at the lower level, the dependency on Glib is mainly g_malloc/g_free, g_list and g_tree !) wouldn't even be highly time-consuming...
A week of full-time work would go some way towards the creation of such a framework. Witness BrandonW's single-purpose C# hack for receiving an OS from a Nspire, inspired from the code in libticalcs and libticables.
But who can spend a week or two of work, full-time, on such a task ? Not me (not alone), sorry - I have a full-time job, I need it for paying the bills, paid holidays are not to be spent working full-time, and it's the same thing for everybody else...
[EDIT1, less than 1h later: sure, if people paid for several hundreds of euros, then I could spend a week full-time on creating the skeleton of a fresh code base, and certainly filling in some bits. But facts show that this is simply not going to happen - ask ExtendeD, who received almost zero over the years for Ndless... ExtendeD didn't even get a CX until Jim Bauwens sent him one of his calculators... I'm just about as responsible about the lack of donations as anybody, though unlike most, I did work on Ndless and related programs, such as nspire_emu.]

[EDIT2, around 5 p.m. CEST:
At least, you have motivated me for working on the libti*/tilp code base, which I hadn't done for a little while ;)
I've just completed an examination of the commits which occurred in upstream TILP between 1.16 (the base for strip_tilp_nspire) and 1.17. A majority of them contains hunks relevant to strip_tilp_nspire...]

[EDIT3, around 7 p.m. CEST: I've started upgrading the strip_tilp_nspire code base from TILP II 1.16 to TILP II 1.17. I've ported nearly 40% of the relevant commits, among which is the Glade/gettext -> GTK+Builder/intltool conversion, whose porting was relatively painless after all :)
Most of the translations are missing (the strings from libti* were never imported in the first place...), but the code base otherwise continuously works for the purposes of interacting with a Nspire CX CAS.]

[EDIT4, around 8 p.m. CEST: pushed 3 commits squashing the relevant bits of 23 upstream commits to http://github.com/debrouxl/strip_tilp_nspire . That's a bit less than 50% of the upstream libti*/tilp commits (with Nspire-related bits or documentation bits) between 1.16 and 1.17.]
« Last Edit: August 12, 2013, 02:09:14 pm by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #92 on: August 12, 2013, 07:00:22 pm »
Quote
At least, you have motivated me for working on the libti*/tilp code base, which I hadn't done for a little while
Yay, I did it! But I don't want to be only complaining, I'll presumably look at C++, as it's easier for me to understand the code by rewriting/copying and finding out why it doesn't work anymore ;) But I don't want to promise anything, I'll have some work to do, so it might take a while.

For the app store/pacspire: I definitely think we need some way to install something on not jailbroken calcs.
The newer ones come shipped with boot2 > 3.1, which makes installing ndless without soldering skills and an rs232 converter impossible (yet).

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #93 on: August 13, 2013, 04:22:08 am »
Quote
But I don't want to be only complaining, I'll presumably look at C++, as it's easier for me to understand the code by rewriting/copying and finding out why it doesn't work anymore ;) But I don't want to promise anything, I'll have some work to do, so it might take a while.
During the next few days, I'll try to finish bringing the strip_tilp_nspire code base towards the code in TILP II 1.17 + associated libraries, as well as making strip_tilp_nspire somewhat less of a one-off hack.
For now, everything is fused into a single "tilpm" ("tilp merged") executable, which is no good - there should be a shared library ("libtinspire" ?) again, and a front-end ("tinlp" = "TI-Nspire Linking Program" ?).
I've chopped out the unused Intel hex handling code, but that's less than 400 lines (~1+%).

Quote
I definitely think we need some way to install something on not jailbroken calcs.
Functionality would be severely limited...
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #94 on: August 13, 2013, 07:15:14 am »
Quote
I definitely think we need some way to install something on not jailbroken calcs.
Functionality would be severely limited...

Well, for non-jailbroken calcs, "installing" would mean to just transfer one or more files into a specific directory, most of the time it'd be /documents (and sometimes /mylib), and.. that's all, since there is no more handling on the calc side.
Looks pretty simple ? (Both with libti* and navnet)
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: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #95 on: August 13, 2013, 07:16:41 am »
Quote
I definitely think we need some way to install something on not jailbroken calcs.
Functionality would be severely limited...

Well, for non-jailbroken calcs, "installing" would mean to just transfer one or more files into a specific directory, most of the time it'd be /documents (and sometimes /mylib), and.. that's all, since there is no more handling on the calc side.
Looks pretty simple ? (Both with libti* and navnet)
And probably a database file for installed programs (updates, uninstall, etc).

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #96 on: August 13, 2013, 07:22:07 am »
Quote
I definitely think we need some way to install something on not jailbroken calcs.
Functionality would be severely limited...

Well, for non-jailbroken calcs, "installing" would mean to just transfer one or more files into a specific directory, most of the time it'd be /documents (and sometimes /mylib), and.. that's all, since there is no more handling on the calc side.
Looks pretty simple ? (Both with libti* and navnet)
And probably a database file for installed programs (updates, uninstall, etc).
Oh yes, forgot that.
A simple .txt.tns should be enough I guess ?
Although for uninstalling ,the only difference with jailbroken calcs would be that the user will have to tell the computer software that he's deleted [this] file.

(On another subject, I've almost finished a 1st version of an API for TI-Planet archives. It's for now outputting in json, but tell me what you want and I'll add that (the things are in a php array, so, it's just a matter or choosing the format)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #97 on: August 13, 2013, 07:39:25 am »
Unsync between the database and the listed could be avoided by not using a database. A well-defined file naming would do I suppose, computer side software can easily discover what's on the calculator with directory listing.
Ndless.me with the finest TI-Nspire programs

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #98 on: August 13, 2013, 07:41:20 am »
But then the software needs to now where the files in a package are and how they're called.
This for every package could be slow, depends on how many packages exist.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #99 on: August 13, 2013, 07:43:00 am »
Well, do we have an idea of how long it takes for navnet/libti to list the whole /documents folder (recursively....) ?
For a small amount of files, medium, and big ?

If it's fast enough, the idea would be good (but the user can't rename files)
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: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #100 on: August 13, 2013, 07:44:20 am »
Even with a database the user couldn't rename files, so that's no issue.
But what's with file versions?

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #101 on: August 13, 2013, 07:52:37 am »
Yeah right... >.<

So, a proper filenaming convention like :

UserDefinedOrDefaultName{1,40}_vMajor[.Minor[.Build]]{1,8}_ArchiveID{1,5}.pcs.tns

So, for example :  FormulaPro_v1.4.1_6034.pcs.tns

(Although idk about the usefulness of a .pcs extension for the final .tns file. Well, maybe to speed up the process of knowing it's been installed through the app store, in case, it's very useful ^^)

?
« Last Edit: August 13, 2013, 07:55:52 am by adriweb »
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: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #102 on: August 13, 2013, 07:56:53 am »
And libs? I don't want a library called Chemistry_EN10_5.2.11_4471.pcs.tns!
For apps or game it would still be annoying.
A database file would be so much easier, just ignoring files which don't exist anymore?
« Last Edit: August 13, 2013, 07:57:42 am by Vogtinator »

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #103 on: August 13, 2013, 08:01:51 am »
I'll have to say I guess it can become quite annoying in the long term to have all those largely-named files yeah :/

However, same question as a bit before (I'm calling Levak here :D), can we hook up the renaming process, to update the database accordingly, then ?
(edit : for the files that are not in MyLib, since their names has not to change
Edit2 : and yes, thanks to levak which raised the valid point of saying that without a database, in fact, you can't track them with the naming conventions the lib files since they're hardcoded names))
« Last Edit: August 13, 2013, 11:08:11 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #104 on: August 13, 2013, 08:05:22 am »
You can't rename lib files, since they are used with hard-coded names in the program codes.
Also it is a bad-design to rely on user-side.
« Last Edit: August 13, 2013, 08:05:41 am by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua