Author Topic: Lua workflow  (Read 6549 times)

0 Members and 1 Guest are viewing this topic.

Offline indo

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Lua workflow
« on: January 01, 2013, 02:40:14 am »
Tooling for Lua programming sucks.  The ScITE IDE has the best support of any IDE, but it is windows only.  IntelliJ requires setting up Lua locally and setting up a remote Lua debugging environment. The worst part of programming for the calculator is that TI makes large projects a major PITA as everything has to be in one large text file.

I think that solution is to create a web-like development workflow.  The calculator is a lot like a web-server, the local system is a mostly ;) identical staging-server, and the conversion process is a lot like LESS compilers and HTML compression.

I want to start putting all of these pieces together, but I am an intermediate-novice ;) and I want to try working collaboratively on a project.  Would anyone be interested in coordinating with me?

I think the first step is to implement a macro to replace 'require' imports with the actual text and then convert the file to a TNS document using Lua.  The next would be to add support for the NSpire APIs.  Andri put up a dummy library and the PCspire provides one that requires Love2D.

I was thinking of targeting Eclipse as it has a commercially backed Lua implementation and a powerful plug-in system.  It would also appear that we could tuck in Love2D and provide a remote run-time environment using nspire_emu.  However, I am a total newb to Eclipse plug-in development and Metalua, so I would (at the very least) need a lot of guidance to get this part working.

I would kill for Moonscript support, but as it uses LPeg and Eclipse Lua uses Metalua...

Anyway, thoughts?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Lua workflow
« Reply #1 on: January 01, 2013, 03:05:56 am »
Quote
The ScITE IDE has the best support of any IDE, but it is windows only.
Not sure what you're referring to, as I use SciTE under Linux on a daily basis.

Quote
The worst part of programming for the calculator is that TI makes large projects a major PITA as everything has to be in one large text file.
Said large text file can easily be assembled from multiple scattered text files, though ;)

Adriweb, Jim Bauwens and Levak will be able to help you more than I can. I see you've already heard about PCspire, so you have probably heard about Inspired-Lua as well.
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: Lua workflow
« Reply #2 on: January 01, 2013, 08:27:31 am »
Hi,

Indeed the built-in Lua SDK is quite poor and very much unusable for big projects.

I am myself using Intellij with the Nspire Lua Plugin I made for it (latest version here : http://tiplanet.org/forum/archives_voir.php?id=8182 ) which makes coding just plain easy.
It has to be used with the "Lua" plugin available on intellij natively (plugin downloader).

After that, I use some bash script to concatenate all my .lua files and finally Luna to generate the .tns from that.
Then I open it on TINCS and/or the calc itself. It doesn't take me a long time since it can be all automated with a keybinding or something.
I know Jim Bauwens has something like that too.

Also, Jim has in mind some online Nspire SDK too, so indeed he's the person to talk to :D
He'll see this topic for sure so he'll reply :D
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Lua workflow
« Reply #3 on: January 01, 2013, 08:36:31 am »
Jim Bauwens has made a program so you can easily split up your project in multiple files. You can use --require <yourfile>.lua or something like that and his program will put it all together for you :) (or adriweb too perhaps that's what your referring to, i probably forget to credit people :p)

I thought your plugin was for Netbeans adriweb?

[edit] the online scripting tool is there already: http://compasstech.com.au/TNS_Authoring/Scripting/luajs/editor.html Awesome job jim! :D
Quote from: Texas Instruments
"With thanks (and any necessary apologies) to Jim Bauwens and his Lua Editor"
« Last Edit: January 01, 2013, 08:51:16 am by ElementCoder »

Some people need a high five in the face... with a chair.
~EC

Offline indo

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: Lua workflow
« Reply #4 on: January 01, 2013, 03:05:58 pm »
Quote
The ScITE IDE has the best support of any IDE, but it is windows only.
Not sure what you're referring to, as I use SciTE under Linux on a daily basis.

*googles* Heaven, I even found an OS X version using MacPorts. Is this NSpire Lua support or they Ndless only?

Quote
The worst part of programming for the calculator is that TI makes large projects a major PITA as everything has to be in one large text file.
Said large text file can easily be assembled from multiple scattered text files, though ;)

Which is bad! :) Time spent scrolling is a large part of a programmers job!

I am myself using Intellij with the Nspire Lua Plugin I made for it (latest version here : http://tiplanet.org/forum/archives_voir.php?id=8182 ) which makes coding just plain easy.
It has to be used with the "Lua" plugin available on intellij natively (plugin downloader).
Thanks for your plugin, it is very useful! I can not get the debugger to work, so I use it when I need to refactor. The Lua plug-in for Eclipse should allow it soon as well.

After that, I use some bash script to concatenate all my .lua files and finally Luna to generate the .tns from that.
Then I open it on TINCS and/or the calc itself. It doesn't take me a long time since it can be all automated with a keybinding or something.
I know Jim Bauwens has something like that too.

This is not cross-platform compatible and needs manual adjustment. I am suggesting a standard workflow and maybe inline it with the IDE(s). 

Also, Jim has in mind some online Nspire SDK too, so indeed he's the person to talk to :D
He'll see this topic for sure so he'll reply :D

I do not mean an SDK, but a web-like workflow.   Program in normal Lua and test using virtual NSpire (such as PC-Spire) and use scripts to "compile" the code and move it onto a real NSpire. This way we optimize the desktop environment for testing and iterative optimization of code (like a dev machine with local Apache / MySQL) and minimize manual labor needed to "upload" everything onto a real NSpire (like a remote server).

The larger goal is to remove all of set-up and gotchas required of a new developer.  The less time we spend customizing our tooling, the better!

(Thank you all for your responses!!  Sorry for my english, I am rushed today.  Happy new year!)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lua workflow
« Reply #5 on: January 05, 2013, 12:20:41 pm »
Lua doesn't require Ndless, but it requires OS 3.0.1 or higher and doesn't feature every Lua command from the computer Lua. Some commands also get removed or added as new OS versions come out, so older programs sometimes stop working.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Lua workflow
« Reply #6 on: January 06, 2013, 09:20:31 pm »
If you're talking about Nspire Lua, check out oclua. IMHO nothing beats programming directly on the platform your program is directed for, though there are some annoyances with oclua that's stopped my workflow before.