thread to talk about and exchange knowledge on Lua and how to use it to program for norns and er-301
Another helpful thread from O|D forum:
So (is this “new thing”) is this written with lua??
No one knows, but my guess is its innards are largely C and there are some built-ins written in Lua against the same API that users will have access to. Lua is popular as a scripting-language add-on for C-based projects that value performance.
I’ve had some experience with Lua in regards to pure data but I guess as soon as Tehn releases the source we’re off to the races
Can we have an ELI5 description of Lua? Had a quick look at that O|D thread, and the Lua site, but I’m none the wiser beyond scripting DSP.
Lua is particularly popular because the interpreter is very small can be embedded inside C programs. One place you see it a lot is the games industry: the games engines are all C#/C++, but they often expose Lua as a scripting language for level designers to just drop things in ad-hoc, and so that scripting changes can be made very quickly - because it’s interpreted, you don’t need to run compilation for every alteration, just reload the scripts. Sorry, that paragraph was a bit complex.
Lua is a general purpose language. It’s not designed for DSP per-se. But just like the games example, if the DSP-type hooks are exposed, you could control DSP with it. (In the games example - the engine developers can add things that can be controlled by the Lua, and return data to it). So here, Teletype, if you know it, is a good example: Teletype itself is written in C. To add new functions to it, developers write some C. But once they’ve written that, anybody can access that functionality through the TT language as an end-user.
So: Norns itself is probably not written in Lua. It’s probably a lot of C, and it’s all sat atop Linux. But: my bet would be it then lets end-users write scripts/apps/whatever the term will be in Lua, if you’d like. (This basically solves one of the issues with Aleph - despite all the work to make things more straightforward, you still had to write a bunch of C to write apps).
I hope that’s a starting point, more an ELI12, @philmaguire, but maybe a start.
That makes a load of sense. Developing for Aleph always looked a bit intimidating to me.
Ive been collecting a few other bits and pieces ill post up
@infovore is spot on. We have used a subset of Lua for our design scripting on the last 2 games we shipped. (Shadow of Mordor, Shadow of War) We implemented it because the embedded compiler was small with not a lot of overhead, and the language itself was very easy to for people to get their heads around (if they had done any scripting previously).
We have had a few hiccups in the last 9 years though (many may be on our implementation, and not a direct critique of the language). The first is that Lua is not type safe. This has lead to a number of weird bugs that were hard to track down. Which is directly tied to our second issue; we never implemented a run time Lua debugger. Which meant that debugging Lua scripts while the engine/game is running became particularly brutal.
All that being said I’m super happy this little guy is going to be running Lua, since it means I dont have to learn yet another scripting syntax.
A fun and easy way to get to know Lua is to trying making simple animations and interactive programs with LÖVE.
Hey @stripes, there are some good links in this thread for learning Lua.
I’m pretty surprised this UCSB project hasn’t been mentioned, some someones must really like Lua over there
shree@shree-linux2:~$ svn co https://svn.mat.ucsb.edu/svn/luaAV/trunk
svn: E170013: Unable to connect to a repository at URL ‘https://svn.mat.ucsb.edu/svn/luaAV/trunk’
svn: E670002: Name or service not known
I have really zero experience with coding, but just started watching this:
And his approach seems pretty comprehensible, doesn’t it? Just for the very basics? He just released a episode 2 as well, so maybe it’ll be a more frequent thing. Anyways, thought this could be helpful for other beginners.
aspiring norns/grid owner here. wanted to share a couple open source projects for those interested in brushing up on lua who are on macos:
lua powered ui scripting for working with macos apis.
for any video editors, lua powered plugins for interacting with apple’s FCPX. already pretty useful but supports user created plugins. built on hammerspoon. use it frequently at work.
i am a hobbiest programmer and have been trying to wrap my head around moving my busted up applescript/python scripts over to lua since discovering these. watching the space with interest and hope i can pull the trigger soon.
found some fun stuff on youtube