[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dual-language systems increase modularity
On Sunday, November 16, 2003, at 02:16 PM, Michael Vanier wrote:
My take on this is that if you're just
using a script language to minimize the pain of having to write code
directly in C or C++, you have a problem which transcends scripting and
maybe scripting is not the best solution.
True. If you do that, you should be in the business of writing "program generating
programs". That's not scripting. That's abstract programming.
Years ago I offered my language course the chance to write code in C++, Java,
and Scheme. I provided solutions for all three for the first three weeks (by that time
the last student had switched to Scheme). To generate the solutions from one program,
I wrote Scheme macros with three implementations: one for Scheme, one for Java and
(ugh) one for C++. My programs looked like that:
(define-datatype Expr
(add Expr Expr)
(sub Expr Expr)
(var String))
and you can figure out on your own what these things unfolded into. There are many
people and many different approaches in this community. None of them would call this
scripting, but it is interesting and powerful.
-- Matthias