1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
BOCK is not a standards-compliant Java compiler. In particular:
- Most of the error checking specified in the "Java Language
Specification" is not implemented.
- Thread objects cannot be created.
- Synchronisation is a no-op (this makes little difference in a
single-threaded program).
- No access control; everything is treated as if it were declared
"public".
- No finalisation.
Correcting any of the above would be a lot of work, and is unlikely to
be done. BOCK is only a prototype, after all, and these things should
all work correctly in "Jackal", the -real- Java compiler I'm going to
write when I'm finished with BOCK.
- No labeled statements, and thus no break- or continue-with-label.
- Array instantiation expressions may only be used to instantiate one
array dimension at a time.
- Compile-time constant expressions are not recognised as such.
- FIXED: No floating point constants.
- FIXED: No square brackets after variable or method declarators (you
must put them next to the type name, where they logically belong).
- FIXED: No Unicode "\uXXXX" escapes. No null characters (like "\0")
in string constants.
- FIXED: Switch statements do not work.
- FIXED: Arrays may not be initialised using array constants.
- PARTLY FIXED: The C output is relatively inefficient because all
local variables and temporaries are declared 'volatile' to ensure
they don't get clobbered by longjmp(). (The partial fix involved
taking the address of every temporary and local variable to ensure
GCC does not registerise them. This should improve performance,
but not as far as might be possible.)
- FIXED: Executing a return statement contained within a try statement
is very likely to result in undefined behaviour, including crashes,
later in the program's execution.
These are, to me, fairly minor annoyances, and are there because it was
easier to code it that way. I may well correct them if I find it'll
help BOCK compile Jackal, but don't hold your breath.
There are also lots of other things not working right at the moment. In
particular:
- FIXED: No interfaces.
- FIXED: Method and constructor calls are differentiated only on the
number of their arguments; no account is taken of their types.
- FIXED: String constants are not instantiated properly; they are all
equal to 'null' at the moment.
- FIXED: Explicit constructor calls at the start of constructor bodies
always end up calling zero-argument constructors.
- My version of the standard java.* library is very, very incomplete.
- Some other things are unimplemented. The compiler generally emits
an error message in these cases.
This is because BOCK isn't anywhere near finished yet. Where I remembered
to do so, these unfinished sections are marked with /* FIXME */ comments
in the source code. If you want to implement something, let me know
before you start so that I can warn you if someone else is doing the
same thing.
|