[PD] proof-of-concept [hsext] for writing pd externals in Haskell

Mathieu Bouchard matju at artengine.ca
Sun Jan 7 08:10:36 CET 2007

On Sat, 6 Jan 2007, Charles Henry wrote:

> Maybe I'm missing the point here, but isn't Haskell a compiled (not
> interpreted) language?

It's either. Whether a language is compiled or interpreted, is dependent 
on compilers and interpreters. There even exists a C interpreter. For 
Haskell, I think I recall that I tried HUGS in 1998 or so, and that it was 
an interpreter. Whatever it is, the distinction between compiler and 
interpreter has been blurred a lot over the year: e.g. the Python 
"interpreter" compiles code and saves it to disk, and also interprets the 
"compiled" code.

> can write an external in some funky language, so long as we can 
> reference the functions from m_pd.h correctly in that language. I tried 
> to put a Fortran function into an external, once compiled. All I had to 
> do was "grep" for the symbols exactly as they appeared in the binary, 
> and get the variables of the function declaration right. Is this 
> similar?

If FORTRAN supports function pointers and all the other C features that 
you need, then you could rewrite m_pd.h as FORTRAN code so that you may 
use the same API; if not, then you would have to either write a 
translation layer in C which would give you a FORTRAN-friendly API, or if 
that's not really feasible then you may have to write a code generator 
that will automatically produce C code which you will link to your FORTRAN 
code to make it Pd-ready.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada

More information about the Pd-list mailing list