Article View: comp.lang.functional
Article #11Re: Reflective extensions (was Re: Why functional languages?)
From: Thomas M. Breuel
Date: Wed, 28 Oct 1992 04:15
Date: Wed, 28 Oct 1992 04:15
36 lines
2511 bytes
2511 bytes
In article <RICHARD.92Oct27125430@ml.harlqn.co.uk> richard@harlqn.co.uk (Richard Brooksby) writes: We're talking about different things, I think. You are advocating LISP _syntax_ because it means that language extensions don't have to modify the parser _algorithm_ because all such extensions conform to a simple format. I'm talking about using LISP _data_structures_ to represent the abstract syntax for the purposes of writing functions _in_ML_ which manipulate that syntax in the manner of LISP macros. In which case, I agree with your point. A simple and regular meta-syntax such as that of LISP S-expressions makes writing what amounts to an extensible parser trivial. This is a Good Thing. Yes, exactly. I'm not sure how regular a meta-syntax of Standard ML would be for the purposes of such extensions. Any ideas? Well, there are some tricky issues related to pattern matching and currying. I have some ideas, but it will require a little experimentation to see how well they work. Are you advocating the exposure of the underlying data structure to the programmer? If so, all my objections still apply. Simply for adding new syntax to the language (e.g., new looping constructs or constructs like "delay"), I think most people would prefer not to have to deal with the underlying data structures. Something analogous to EXTEND-SYNTAX might be sufficient. Additionally, some standard for representing the AST and for representing the typed lambda calculus intermediate might be useful to encourage experimentation with program transformations and optimization that cannot be expressed in terms of macros alone. Thomas.
Technical Details
Message-ID:
<TMB.92Oct27231541@arolla.idiap.ch>Path:
arc1-ca.pugleaf.net!sparky!uunet!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmbReferences:
<1992Sep26.212935.26809@eng.umd.edu> <1992Sep28.120225.9524@odin.diku.dk> <TMB.92Sep28144424@arolla.idiap.ch> <RICHARD.92Oct16184638@freud.harlqn.co.uk> <TMB.92Oct17172954@arolla.idiap.ch> <RICHARD.92Oct21123440@ml.harlqn.co.uk> <TMB.92Oct21172225@arShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmb From: tmb@arolla.idiap.ch (Thomas M. Breuel) Newsgroups: comp.lang.functional Subject: Re: Reflective extensions (was Re: Why functional languages?) Message-ID: <TMB.92Oct27231541@arolla.idiap.ch> Date: 28 Oct 92 04:15:41 GMT References: <1992Sep26.212935.26809@eng.umd.edu> <1992Sep28.120225.9524@odin.diku.dk> <TMB.92Sep28144424@arolla.idiap.ch> <RICHARD.92Oct16184638@freud.harlqn.co.uk> <TMB.92Oct17172954@arolla.idiap.ch> <RICHARD.92Oct21123440@ml.harlqn.co.uk> <TMB.92Oct21172225@ar Sender: news@ai.mit.edu Reply-To: tmb@idiap.ch Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle Perceptive) Lines: 36 In-reply-to: richard@harlqn.co.uk's message of 27 Oct 92 12:54:30 GMT