[PD-dev] abstractions

Albert Graef Dr.Graef at t-online.de
Fri Jul 11 12:25:54 CEST 2008


Frank Barknecht wrote:
> I think, Pd could benefit a lot by providing a default scripting
> language to write operations like [range] which are tediuos to do as
> an abstraction. Altough I'm not a fan of Tcl (and would prefer Lua),
> Tcl would be a natural choice as it's available anyway.

But Tcl is awfully slow. In fact, it's one of the slowest scripting
languages there is. Lua has a very low footprint which makes it usable
even in embedded environments, and it's a lot faster than Tcl
(especially the JIT-compiled version, but AFAICT this only works on x86
right now). The only advantage that Tcl has is, as you point out, that
Pd already uses it anyway.

Since a few months I've been working on my own JIT-compiled language
"Pure", Q's successor, which is not much slower than LuaJIT, allows you
to call C functions directly, and runs on anything that LLVM
[http://llvm.org/] supports, including Linux/OSX/Windows and
x86/-64/powerpc. A port of Q's Pd external, which will make Pure
callable from Pd, is one of the next items on my TODO list.

Now I know how popular functional programming languages are with
programmers raised on a diet of C, Python and Java ;-), but the fact is
that FPLs are a nice match for Pd (which is a kind of functional
programming language itself) and typically the scripts are much more
concise and expressive than anything you can write in more traditional
languages.

> Ideally the scripts would be saved within the patch, e.g. inside message boxes.

Ideally we'd have this sort of integration for any scripting language
supported by an external, so that the scripting engine could query Pd
for the script name or text to use for a given patch and initialize
itself accordingly before any objects are created. Currently you either
have to specify the script as an object creation argument or hardwire it
into the scripting language external. Both sucks.

If Pd provided some infrastructure there (maybe [declare] could already
be used for that purpose?), scripting would become as easy as pie, and
we won't have to battle over which scripting language is best, because
there are already quite a few to choose from.

Cheers,
Albert

-- 
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:  Dr.Graef at t-online.de, ag at muwiinfa.geschichte.uni-mainz.de
WWW:    http://www.musikinformatik.uni-mainz.de/ag




More information about the Pd-dev mailing list