[1533] in java-interest

home help back first fref pref prev next nref lref last post

Re: Systems Programming Oriented Java

daemon@ATHENA.MIT.EDU (Walter Smith)
Thu Sep 7 01:51:47 1995

Date: Wed, 6 Sep 1995 19:21:20 -0800
To: java-interest@java.sun.com
From: wrs@newton.apple.com (Walter Smith)

There are a few hundred more important things than this to be done in the
short term, I think, but it's an intriguing idea, so why not brainstorm a
bit...

>I propose the creation of a new dialect of Java, called [SPOJ], intended
>for systems programming.
...
>The key question is this: In what language should one write a garbage
>collector?  One answer is C.  Another is SPOJ.

Rather than a new dialect, one could add a _few_ optional "unsafe"
constructs, such as untraced pointers and unsafe casting, to Java.  Then
find some boundary to enforce "unsafeness" with -- the new stuff would only
be usable behind this boundary.  So the third answer is "Java with the
unsafe flag turned on".

Modula-3 does this by restricting unsafe things to unsafe modules.  Any
module that imports an unsafe module is itself unsafe.  At some point, of
course, you have to provide a safe interface for safe modules to import.
This idea is used sucessfully in DEC's Modula-3 implementation to write
almost the entire runtime (which has similar features to the Java runtime)
in Modula-3.

I haven't given any thought to what the right boundary in Java might be,
but at first look it sounds like this could be a more pleasant way to do
things (the M3 guys certainly like it).

There are some obvious problems mapping this into Java.  For example,
low-level code usually ends up being procedural, since the hardware is in
some sense procedural (the instruction is "jump to subroutine", not "send
message", on most processors).  In Java, there are no procedures.

>2. *Java bytecode* ought to be the portability medium, not C.

Hmmm.  Perhaps the bytecodes are already low-level enough to be the output
of "unsafe" Java.  (Of course, you'd just use a subset, and it would never
go through the verifier.)  If there were a simple converter from Java
bytecodes to native code for a variety of platforms, which you have to do
anyway to get the just-in-time stuff going, you'd be set...

- W

P.S. If Java (the language, not the Internet stuff) interests you, but you
know nothing about Modula-3, it's time you heard about it!  Go look at
http://www.research.digital.com/SRC/modula-3/html/home.html.

---------------------------------------------------------------------------
Walter Smith                    wrs@apple.com               +1 408 974 5892
Newton Software          PGP key at ftp://ftp.apple.com/pub/wrs/PGP-key.asc
Apple Computer, Inc.     E1 20 C3 0A DE 27 89 06  0B 35 08 65 0C FB A7 41


-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post