[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Mar 3 17:33:31 1995 
Subject:Re: Is there a name for..... 
From:Richard Matthias 
Volume-ID:950304.01 

Don't you just love the Usenet? I feared there wasn't a simple answer to my
question. Now I get to have a public argument with members of the faculty!

Adrian Howard (adrianh@cogs.susx.ac.uk) wrote:
: Both Poplog Pop-11 (and most MLs that I am aware of) compile to native machi
: code --- they are *not* interpreted. This seems to be a common misconception.
: There are also versions of C and Pascal that are interpreted! Unix shell
: scripts and Perl (usually used for "systems" programming) are interpreted.

Yes, I am aware of the difference between interpreted and compiled languages.
I am aware that Poplog pop11 is compiled, but how much code does the compiler
generate for say an = operator? Does it insert all the code do the key
checking of the operands to make sure they are numeric, do the necessary type
conversions etc. or does it just call a common library for these functions? I
fear it does the latter. If the compiler just generates multiple calls to a
massive library of code that must be present to run the program, then it might
as well be interpreted! Or you might as well interpret the syspop. Well, maybe
thats a bit harsh, but you get the idea.

: Runtime environments? Unfortunately these are also rather difficult to define.
: Let's just look at the issue you raised --- heap management. What is the
: difference between Pop-11 using a garbage collector and C using malloc et al?
: Not a lot really [1]. Both are necessary for any useful program in either
: language. Both are used at runtime.

Malloc doesn't manage the heap though. All it does is allocate memory. It
can't grabage collect because it doesn't know who holds pointers to the
pieces of memory it would have to move. Poplog on the other have can garbage
collect because the run-time environment keeps track of all the identifiers
and their associated values/pointers. This is what I mean by run-time
environment.

You can get heap management facilities in C++ by using a complex set of
storage objects. Borland supplies such an "ObjectClass" library with its
compilers and it works quite well. The only problem is, that if you are lazy
and use it instead of taking the time to make you code allocate/deallocate
memory in the right order so it doesn't leave holes in the core, then your
program will run as fast as the pop system does on tsunb[1].

The only reason I referred to C as a systems language was that the course on
which it is taught is called "systems programing". Interpreted languages like
perl may be used for maintaining the system, but the other meaning of systems
language is one used to write the operating system. If you take the example
from the paragraph above, C++ does resolve into machine language more cleanly
than pop11, but you still wouldn't write an operating system with it, well not
the kernel anyway.


Richard Matthias

[1] Sussex undergraduate joke.