eval, or interpreting

Alan Grover awgrover@umich.edu
Thu, 28 May 1998 09:12:22 -0500


"Nick Kallen" <phantom@earthlink.net> wrote:
>It would be nice if you were to make publicly available some of the compiler
>functions in Clean 2.0. That is, functions to parse Clean's concrete syntax,
>compile, and interpret would be very useful. For example, the spreadsheet
>program which was written in Clean a while back needs its own interpreter
>for its subset of the Clean language. It would be much nicer if one could
>simply use or extend an existing evaluating function. This doesn't
>necessarily imply that one has to make Clean code first class in the
>language--eval could be eval :: String -> a. This would also be very useful
>if one wanted to add a listener to the Clean IDE; Heck, I bet numerous
>productive features could be trivially added to the IDE with this function
>available. It might even make sophisticated debugging possible.

I'd like to express my strong support for access to some kind of run-time
eval. I'd like to use it in several projects, and think it would be a major
feature of the system. You might compare this with Lisp.

Here's the kind of things I want to do:

Create a GUI builder for Clean. This requires that code be generated for a
GUI layout (menu defs, windows, etc.), _and_ that code can be read in and
the GUI instantiated. An application could be built interactively,
attaching functions to GUI elements, as the various Visualxxx products do.

Build functions programmatically. For example, a genetic algorithm could
produce some useful function. In one of the Clean papers there is a
discussion of making functions streamable. In addition to that, the graph
would have to be treatable as a data structure that could be modified,
examined, etc. The graph could then be submitted for
optimization/compilation.

Create an application like a spreadsheet (someone else mentioned this).

Store functions/graphs as components and dynamically decide to use them
(pretty much the same as the GUI builder above). I think component oriented
programming will become even more important, and a modern language should
support it.

If the compile-to-ABC and the backend-to-machine-code were seperable,
applications and functions could be downloadable in web pages. I suspect
Clean applets/functions would be smaller and faster than Java dohickeys.
Like java, it would require a runtime at the client, but the apps would be
instantly cross platform.

---
"Alan Grover, Technical Pb" awgrover@umich.edu
+1 (743) 647-5778
Project Leader
Health Media Research Lab, Cancer Center
5D04 North Ingalls Building, Mail Stop 0471
300 North Ingalls
Ann Arbor, MI 48109-0471