Re: Software directions to ponder over...

Date view Thread view Subject view Author view

From: Tony Finch (dot@dotat.at)
Date: Thu Sep 28 2000 - 02:58:45 PDT


Koen Holtman <koen@hep.caltech.edu> wrote:
>On Wed, 27 Sep 2000, Tony Finch wrote:
>
>[....]
>> Since most languages in use today have a specification like
>> a dogs dinner, compilers for those languages have a fairly limited
>> understanding of the code they are compiling (and frequently any
>> possibility of useful understanding is scuppered by the
>> specification).
>
>Um.. I have to disagree here. A very bulky language specification is
>a hurdle, but not an insurmountable one, to a compiler being able to
>analyse the code it compiles for bugs, deficiencies, or optimisation
>opportunities.

I didn't say anything "bulky", I said "dogs dinner". One of the more
languages I had in mind when writing that -- Haskell -- is *not* a
small language, but it does have a mathematically tractable definition.

>Take C, for example. The single biggest problem here, for a compiler
>analysing the code for possible optimisations, is potentially
>unconstrained pointers.

Exactly, and this is why C99 includes a new keyword so that the
programmer can specify that pointers are constrained so that the
compiler can do more optimisation. I doubt that the keyword will catch
on except among people writing hard-core numerical code, because
getting your head around the rules is tricky.

>What is really needed to improve compilation and bug finding, if you don't
>want to thow away pointers, object handles, or those pesky recursive
>datastructures, is language constructs which allow the programmer to
>express `these two pointers/handles/etc that were passed into this
>function are guaranteed to point to different storage', and also `this
>object is owned by that object and the ownership relation is nowhere
>cyclic'.

That's the wrong way to go about it. You can have perfect support for
polymorphic recursive data structures without any of that complexity
and at the same time allow the compiler to know a lot more about your
code. For example, there is an implementation of ML with automatic
memory management that does not use garbage collection -- it works out
at compile time where to insert calls to malloc and free.

>I'd say Java has about as precise a definition as you can get, possibly
>also a sophisticated type system. Don't see too many people discouraged
>by that...

Compared to ML the definition isn't that precice. Compared to Haskell
the type system isn't that sophisticated.

Tony.

-- 
en oeccget g mtcaa    f.a.n.finch
v spdlkishrhtewe y    dot@dotat.at
eatp o v eiti i d.    fanf@covalent.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Sep 28 2000 - 03:03:05 PDT