Yeah, +1 for pdlua for me!
Here's a few more reasons I'd love to see this:
pdlua objects require vastly less boiler-plate code than C externals. Especially for signals and graphics, it takes care of all the hard parts and common pitfalls for you.
As a result, creating pdlua objects is much more beginner friendly, and experienced programmers are less likely to make mistakes. Not requiring compilation makes writing coded externals as accessible as abstractions are currently.
The biggest weakness for a project like pdlua is needing to be installed manually. This discourages people from directly uploading their Lua objects on Deken. Like porres said, ELSE now ships with pdlua just so that we can ship lua objects. It would be amazing if we could assume them to just work.
As you might know, Lua is very compact, it can be compiled by adding "onelua.c" to your sources, and it has no external dependencies. For ease of maintenance, it's as good at it gets. Lua is also fast for a scripting language. Seems like the perfect fit for pure-data.
If you want a sample of the API, here's the documentation for pdlua graphics: https://agraef.github.io/pd-lua/tutorial/pd-lua-intro.html#graphics
Tim
On 02/10/2024 06:12, Alexandre wrote:
Let me share Tim's thoughts he sent me via a chat about coding externals in lua, which I think are a perfect sell. Compared to C externals, lua externals:
- Encourages open-source, since the source code is the object
- Works on every OS, architecture, pd floatsize, multi-instance, all without needing recompilation
- You can easily modify objects if you want to
- GUIs are now much easier to write with Lua than with C
- Are guaranteed to keep working even if Pd's C API changes, or Pd changes GUI framework
- Are guaranteed to work across Pd forks, as long as they correctly implement the lua API
Em ter., 1 de out. de 2024 às 15:36, Alexandre porres@gmail.com escreveu:
Em seg., 30 de set. de 2024 às 16:59, Christof Ressi <info@christofressi.com> escreveu:
Thanks to Antoine for mentioning pdlua! I will need to check it out. I have already seen people doing some very cool stuff with it. Maybe they already have the perfect solution :)
I'm also looking at pdlua, which might want to become the official way to make graphical externs AND to add scripting in a fundamental way to Pd :)
+1 for an official scripting language! :) (I love Lua, BTW.) And yes, it would make lots of sense to leverage the scripting language to implement custom UIs!
+1k Yay, great to hear that! BTW, I remembered about this ticket we opened years ago inquiring about adding lua to Pd natively! https://github.com/pure-data/pure-data/issues/687 Now that Tim is doing great work for graphics, this would be even more awesome! And I wouldn't have to worry in shipping it in ELSE for some externals that already use it :) cheers
pd-dev@lists.iem.at - the Pd developers' mailinglist https://lists.iem.at/hyperkitty/list/pd-dev@lists.iem.at/message/WOQJIW3FBB7...