Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Aug 1998 06:06:17 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        reilly@zeta.org.au (Andrew Reilly)
Cc:        tlambert@primenet.com, tom@uniserve.com, current@FreeBSD.ORG
Subject:   Re: Heads up on LFS
Message-ID:  <199808060606.XAA22855@usr09.primenet.com>
In-Reply-To: <19980806112955.A4299@reilly.home> from "Andrew Reilly" at Aug 6, 98 11:29:55 am

next in thread | previous in thread | raw e-mail | index | archive | help
> > It's written in
> > Modula 3 (of all things) and incorporates nullfs and lfs from FreeBSD,
> > as well as CAM.
> 
> I don't think that "of all things" is particularly fair: their
> reasoning for the entire viability of the project is that they rely
> on the strict typing and garbage collection of Modula-3 to prevent
> user-written kernel extensions from breaking other kernel bits.

To each his own; the need for a garbage collector for things that
the language should know were out of scope and therefore not need
to garbage collect is an agrument against such languages, in my book.


> You couldn't really do it in C or even C++.  The same logic is used
> by the Sun JavaOS folks (Java being Modula-3 in C clothes, that's
> hardly surprising.)  The argument is interesting, but a bit too
> restrictive to be useful in a general purpose sense, I think.

The same argument about no explicit object destruction is a good
anti-JAVA argument, as well.

As far as C++: I've implemented a large portion of the java and
javax classes in C++, including the Exception and Throwable
classes, as part of a project unrelated to JAVA (I just figured
that I might as well not reinvent a model Sun spent millions of
dollars inventing, and the model was based on these classes).  So
you can indeed write JAVA in C++; you just need to do the right
thing as regards deletion when something goes out of scope.  The
Vector, Enumerator, and Iterator classes are particularly tricky...


> Now if you were prepared to rely on hardware memory /protection/
> without using the hardware memory /mapping/, you could probably
> do the same thing in C or C++ (or assembly language).  I believe
> that this has been tried in some of the Acorn ARM based OS's
> (RiscOS and the Newton OS.)

It's possible in C++, if you are willing to explicitly destruct
objects when you know they are going out of scope but the compiler
doesn't, especially if you are using them as pointers instead of
references.

JAVA has a nasty tendency to leak like a sieve until the GC hits a
steady state.  As does Modula 3.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808060606.XAA22855>