5 This is my start of SquirrelJME which is similar to SquirrnixME except it is
6 under the AGPLv3+ and has pretty much the same intended goals.
10 For specific systems I am going to need to use `near`, `far`, and such. For
11 example the Zilog Z80 compiler uses `near`, `far`, and `rom`. `rom` addresses
12 the built in memory since normally the hardware does not have a unified address
13 space for accessing read-only data and in memory data.
17 Going to need style guidelines so things are cross platform and such.
21 It might be more interesting to have this code and such be in pure Java,
22 except that a front end is used of sorts to generate code for the target
23 system. But then this would be Squirrnix all over again. This would however
24 be far lighter and I could probably get away with simplification. Otherwise in
25 general it would help with learning to write a basic compiler (from Java byte
26 code to machine code). As for cross platform support (such as Linux, Palm OS,
27 Amiga, etc.) I can have it be self hosting so to speak, so that the compiler
28 generates all the code for the given targets. So basically this will be a
29 mini sized Java ME environment writting in itself. One thing I will have to do
30 however is make sure all my code can run on its own environment. However, in
31 these cases I would not have to worry about C language details at all. It would
32 also probably be much simpler too. I could build essentially a basic mini IDE
33 of sorts to run and test code, which would be interesting too. Due to the way
34 the Java ME virtual machine laid out, there is no invokedynamic and the code
35 will essentially require at minimum a Java 5 implementation. However thinking
36 more into it, I could reuse the internal compiler and have it used as a JIT so
37 code can be dynamically compiled and ran. If a JIT is not requested then
38 instead only an interpreter would be available. Then I can have stuff such as
39 exceptions and whatnot without worrying too much about things. I do however
40 have to have an SDK to compile against to be sure of compliance. However in
41 general I can run the code on the host virtual machine provided I am careful
42 of the APIs I choose (Java ME has a few extra methods that Java SE does not
47 Another advantage of being in pure Java would be that I would not need a C
48 compiler at all for various systems. However, if a system cannot run any Java
49 virtual machine at all, then a cross compiler with itself would be built. I
50 suppose this would be kind of similar to Free Pascal except all targets could
51 be supported and included. One thing I do not have to worry about is standard
52 system libraries, I can use what I need instead of bringing in massive APIs
53 and such. Then whatever I learn from this (because it will be much lighter and
54 such) I can bring to Squirrnix and continue that compilation system. So
55 effectively Squirrnix will be partly based on this environment. I suppose for
56 starts I should start small doing this.
60 Actually, what I will need is ZIP file handling and decompression support.
61 Otherwise without this, I cannot read JARs. However since I do not need
62 compatibility with the standard library, I do not need to go crazy over
63 compatibility for it. I suppose that virtualized access to memory is done by
64 a `SeekableByteStream` for example. This way if a JAR is in a `FileChannel` or
65 is in the ROM it can be used regardless of its location.