Correct spelling.
[SquirrelJME.git] / assets / developer-notes / stephanie-gawroriski / 2016 / 06 / 25.mkd
blobae084bdb4f5476e850137ac718d920f9e4ccd558
1 # 2016/06/25
3 ## 09:04
5 I would need temporary filesystem usage for output blobs and other resources.
7 ## 10:54
9 To reduce the binary size I can have a single shared global index that contains
10 constants and other references as such.
12 ## 11:14
14 With combined blob tables however, all classes would have to use this given
15 table. However, when it comes to using individual classes everything that
16 exists in the table structure might not even be needed.
18 ## 11:35
20 I would suppose that a blob of blobs containing class blobs and resources
21 should be used. This archive would just be a part of the executable. It would
22 essentially be a giant table of resource data and natively compiled classes
23 in sorted order. The bootstrapping system would setup a base JVM which can
24 run `JVM`, then `JVM` would setup a task for the launcher and the user uses
25 that for interaction. The archive would just be a flat binary for the most part
26 consisting of classes or resources in separated tables. I can then use a
27 modified UTF-8 comparison of sorts against a `String`.
29 ## 13:24
31 So now that I have basic output, I must work on the SSJIT which takes an input
32 class and outputs a native blob. There will need to be some kind of
33 architecture generation class that the SSJIT can use. Since this can vary on
34 the system, I would suppose that the manifest should contain the class which
35 is the JIT to be used.
37 ## 17:17
39 Actually, what I need is that interface that acts as a factory for a given
40 architecture. The `CodeProducerFactory` will be associated with an OS where it
41 extends a base factory for the architecture. Then this way, I can have
42 sub-variants of architectures (for example `powerpc32+g4` for a PowerMac G4).
44 ## 18:56
46 I kind of dislike inner classes.
48 ## 19:01
50 One thing I can do for producers is allow there to be a potential branch when
51 it comes to a producer. For example I will have the base PowerPC producer
52 and then an operating system specific producer. This wrapper class will in the
53 event its methods are not overridden, will instead the code generator of a
54 variant instead to handle actions. The only consideration however is that it
55 is possible for a code generator to call a method which is not implemented at
56 all in the base class. So I could add this functionality to the base generator
57 so it can perform an alternative generation path. I would likely need an
58 interface and a class that has the same methods as the producer. Enabling this
59 action will allow operating system producers to modify the behavior slightly
60 for a given architecture. This can complicate and slow things down a bit since
61 it would have to check if a given method has been replaced. One alternative
62 however is to have a number of interfaces. Each interface would define
63 something. In the base producer, basically what will be done is that it will
64 implement every interface. Then instead classes can be placed which implement
65 one of the given interfaces. If one object implements the interface then that
66 is called, if it does not it goes to the next. If nothing implements it then
67 the operation fails or falls back to a default.
69 ## 19:06
71 So basically the ProducerFactory will just have an internal generator for the
72 most part which can create a class which implements the interfaces as much as
73 it can. Then this means that each method would have to be given the producer
74 as the first argument so it knows how to call other methods for example. This
75 would be quite flexible but it should allow slightly modified behavior which
76 may be required. Since modifying the base producer for a given architecture
77 can be complex and may interfere with any operating system, this would be
78 a viable choice.