Add task for running tests that runs both clutter levels accordingly.
[SquirrelJME.git] / assets / developer-notes / stephanie-gawroriski / 2016 / 08 / 12.mkd
blobf3937fe910008f8e5e2fdaf5d2ea56a1b82d9320
1 # 2016/08/12
3 ## 07:55
5 Strings do not have to be written together, they can be written as soon as
6 possible (say when there is no current output). The only issue would be that
7 strings could not be sorted for binary lookup. However in general strings are
8 going to need to be imported so that constants are equal with extra classes
9 in consideration.
11 ## 12:59
13 Well, `Writer.lock` is not `final`, that seems like a mistake. Also the CLDC
14 one is not `Flushable` although it has a `flush` method.
16 ## 14:16
18 Actually, the imports for certain things can be flagged for simplicity. For
19 example if I write to a field I can mark it as read. However, if the field
20 ends up really being `final` (meaning the class changed) then it can fail at
21 import resolution time.
23 ## 14:21
25 The same can be done for super and interfaces.
27 ## 17:42
29 The namespace writer is getting rather ugly again however.
31 ## 17:17
33 I am thinking far too much into it. One thing that _every_ class has is the
34 constant pool. The constant pool **is the import table**. Anything the class
35 uses refers to the constant pool. It might also be best to have fragmentable
36 classes. For example instead of merging all classes into a single namespace,
37 they can be individually referenced. They would still be executable in memory.
38 So essentially the namespace format would be like a ZIP file so to speak. The
39 class processor for the most part can just define a constant pool and pass it
40 to the writer, which then handles references to the entries in it as such. Then
41 for each method in a class, they refer to a constant pool so to speak. The
42 pool would be a bit smarter having the previously thought about extends and
43 implements flags. Before I just ignored the constant pool, but the information
44 is all there. Also, if I ignore a global string table, although it would cost
45 some more bytes it would in effect make it so classes are stand alone and
46 processed on their own. I would not need to keep a record of strings.
48 ## 17:32
50 It will be similar to ZIP along with using CRCs, but with a different magic
51 number and such. This way it is possible to stream classes rather than using
52 a table of sorts.