[Gardeners] * in Lisp
Matthew Astley
clgard$mca at t8o.org
Thu Feb 2 15:27:54 CST 2006
I'm interested in the modes of attachment between languages, and how
to help folks find their way around.
Pipes or sockets. (LTk; Ajax, Dojo and JSON)
Embed one in another. (tcl and guile were designed for it; Python
can do it; Perl has been linked into Exim and Apache; inline
assembler in C source is another flavour)
With the magic of eval you can turn this inside out. (/usr/bin/cpr)
Target another language's runtime. (Parenscript = Javascript in
sexprs; Kawa & JScheme = Scheme for the JVM; Jython)
Steal source from another language. (awk2perl, sed2perl,
http://www.cliki.net/Zeta-C ...?)
I'm most interested in
How to do <foo> in Lisp, where <foo> is defined in other language.
e.g. How do I write a heredoc in Lisp?
It has been variously suggested (on cliki) that I don't need to, could
do it easily, or might find it rather tricky. I haven't tried yet,
but would appreciate advice on where (not) to start.
This is a comparison of language idioms. Discussion can lay bare one
language's kludge that gets around a shortcoming another language
doesn't have. Hacking can import those other things that are actually
really neat.
Of course there will be some overlap - maybe I like the kludges enough
to implement them elsewhere.
(this is not a top post)
On Wed, Feb 01, 2006 at 10:32:38AM -0500, Stuart Sierra wrote:
> So far that's Python, Perl, TCL, Prolog, and R.
I was pondering TeX too, but that's not my project.
> Makes me wonder: would it be possible to define a generic interface
> to external scripting languages?
STDIN and STDOUT are easy to get going for question/answer sessions,
provided the victim language has something resembling a REPL.
Perl's Inline modules allow subroutines to be written in many
languages, I guess there's a generic interface in there. There's also
SWIG which seems to have hooks into pretty much everything.
> That could make CL the ultimate "glue" language, able to use almost
> any combination of libraries from different languages.
Perl used to be the ultimate glue language, and tcl before that? But
languages seem to be coming together now.
I think people just use whatever language(s) look suitable for the
task. Start from <here>, pick a destination and fill in the space
with some code. Some routes are scary, others are well travelled.
More examples,
- VBA embedded in Excel, linking out to a DLL, if you must
- [I'm obliged to plug] Python plus TeX, http://www.pytex.org/
...it's a big topic. Which bits should we garden?
Matthew #8-)
More information about the Gardeners
mailing list