Date: Tue, 29 Aug 1995 15:13:17 +0200 From: rainer@physik3.gwdg.de (Rainer Blome) To: jecel@lsi.usp.br Cc: self-interest@self.sunlabs.com In-Reply-To: 9508282154.AA02536@obj.Eng.Sun.COM (Mario.Wolczko@eng.sun.com) Subject: Re: types of people
jecel wrote:
[...] how different kinds of people make (and use) different kinds of systems [...] there are very few women in OS and language design [...] the "types of people" are independent of sex [...]
the available "types of people" (aka communities) are indeed independent of sex (imo), but the distribution of people over the types isn't. still, one shouldn't in general cater for a specific distribution but instead make sth useful for a wide range of types.
a way to achieve that is to unify concepts used in different communities, then maybe sell them all the same stuff with just different labels. in other words, i think it's possible to make a language feel `just right' for a far wider range of users than the current languages do.
for example, self has some of scheme in it but could use a lot more still:
- unified blocks and methods (procedures aka closures) - more convenient representation of code as data - a macro facility
- closures that may be used out of their lexical context - continuations
- transformation of tail recursion into iteration - lazy allocation (scheme does not have this by default, but should)
the first three issues are actually visible at the language level. they simplify library design and will probably make the system lighter or more effective. the last two are implementation issues, invisible at the language level. they complicate (do they?) interpreter/compiler construction but will make the system more efficient.
out-of-context closures and continuations are implementation issues that are visible at the programming level. using heap allocation is a simple way to implement closures but that's slow. having lazy alloc would help a lot there (first, alloc on the stack, evacuate to the heap when necessary), but isn't trivial to implement fast. still, because it pays off in so many ways (including providing elegant and fast ways to implement the other three implementation issues), it seems the way to go.
rainer
for example, self has some of scheme in it but could use a lot more still:
- unified blocks and methods (procedures aka closures)
- more convenient representation of code as data
- a macro facility
I think macros are a really, truly, bad idea. As the Scheme literature shows, it's extremely difficult to implement them in a way that doesn't break the language's scoping rules; and they also absolutely require climbing one level up the reflective hierarchy of static representations, i.e., they require a "data-like" representation of the syntactic elements of the language.
In my opinion, the way to go is Beta's generalization of procedural abstraction to cover the entire range of syntactic constructs, not just expressions. This approach is more limited than general macros, but it can get rid of nearly all of the scoping rule problems and doesn't require a data-like representation of unparsed but tokenized source code.
closures that may be used out of their lexical context
continuations
transformation of tail recursion into iteration
lazy allocation (scheme does not have this by default, but should)
the first three issues are actually visible at the language level. they simplify library design and will probably make the system lighter or more effective. the last two are implementation issues, invisible at the language level. they complicate (do they?) interpreter/compiler construction but will make the system more efficient.
out-of-context closures and continuations are implementation issues that are visible at the programming level. using heap allocation is a simple way to implement closures but that's slow. having lazy alloc would help a lot there (first, alloc on the stack, evacuate to the heap when necessary), but isn't trivial to implement fast. still, because it pays off in so many ways (including providing elegant and fast ways to implement the other three implementation issues), it seems the way to go.
The Self group considered non-LIFO closures at some length and decided against them. The Smalltalk systems I helped build went the other way, but it is extremely awkward to implement in a way that doesn't slow down the 99% stack-allocatable case at all, and we didn't try to do it. (In particular, I don't know a way of doing this without checks on every store and return that also doesn't involve code modification or duplication.)
L. Peter Deutsch
for example, self has some of scheme in it but could use a lot more still:
- unified blocks and methods (procedures aka closures)
- more convenient representation of code as data
- a macro facility
I think macros are a really, truly, bad idea. As the Scheme literature shows, it's extremely difficult to implement them in a way that doesn't break the language's scoping rules; and they also absolutely require climbing one level up the reflective hierarchy of static representations, i.e., they require a "data-like" representation of the syntactic elements of the language.
Why is it bad to require a "data-like" representation of the syntactic elements of the language? This works quite well in lisp, no?
Dave
Why is it bad to require a "data-like" representation of the syntactic elements of the language? This works quite well in lisp, no?
It works so well in Lisp because Lisp is so simple. Classical Lisp syntax has two non-terminals (atoms and numbers) and one terminal (list cells), and the mapping between data and program structure is so direct that one doesn't even think about it.
For macros in a language like Self that has real syntax, one has to take a position as to how the macro arguments should be parsed. Should they be parsed as expressions? If so, macros just become an efficiency hack, because they can't do anything that ordinary messages can't do. If not, then presumably something in the macro definition has to specify this ... in which case we're back to the much more serious problem of deciding how macro definitions are scoped and when they should be expanded, a problem which I think is quite sufficient to sink the whole concept for Self.
L. Peter Deutsch
self-interest@lists.selflanguage.org