2009-12-28

separate compilation

10.7: adda/mapping separate compilation to c:
. the types are translated to separate files
that are including types header file into
any unit that mentions that type,
and creates a make file telling how to link things .

adda/portable c linkage system support:
. the portable c linkage system can require short names,
so then output should just give them a serial # as a name,
along with a comment next to each use of that serial#
which shows in the code
what the intended name is for that serial# .
. alt'ly, there can be double output,
where the c.code is ascii for the c compiler
and html for the humans
which has names instead hyperlinking to the serial#-named files .

10.23: adda/module updates are modular:
. you can ask for the lib'mgt to
update all or certain ones
like the make update does .
. think of the lib'mgt as handing out plugs to lib's;
this lib is one link that you'll need to dynamically import,
and then all the symbols are offsets .
. this makes the lib's easily relocatable .

10.8: adda/ada/compilation units:
. ada pkg's are records that both define a rec'type
and declare an obj of that type;
if the rec has only function def's (is stateless)
then it's trivially an obj .
. what if pkg delcares tasks?
how to say when to activate and who to share with?
a sub is like a task but has one entry .
. tasks can have literals which if not quoted are eval'd;
and this eval is what starts them?
. a type is sort of task,
a user logging in creates a task .
. all tasks-obj's in user's folder are accessed only by
other tasks in same folder .
. if needing a separate task,
create a task type in user folder
then create two obj's in separate subfolders .
...
. it must be declared in the sub's external list .

11.7: adda/compilation vs exec speed:
. the major source of compilation speed
should be seen as coming from separate compilations
which are essentially generic library units,
where chunks of binary are already compiled .
. if a project seems mature,
it will help program efficiency to
statically link lib'units;
this will take longer to compile and recompile
but it's there when the program is run
-- and it's run much more often than recompiled .
[12.24:
. but this is not good for the efficiency of the system
where the user is typically running multiple programs
because your program is hogging memory
for the sake of increasing its own speed .
. the only reason for static compiles is when
security is a critical issue
since dynamic linking can be a way to
covertly modify a trusted program .]

11.23: adda/translator/namespace control:
[11.24:
. when using c, there are problems with namespace control:
it doesn't have nested functions,
so then you modularize by file`scope,
exporting only symbols that other files should share .
. you may compile each file separately,
but then the linker must be given as a batch
all the compiled files that were sharing via exports/imports .
. the problem is that the namespace for exported symbols
is tiny .
so, to reduce that name space,
we need ways to bundle the inter.module connection
under one symbol per cable .
. such bundles can be called packages
]
. use pkg'ing which is just one function
whose arg'list includes a cmd selector
-- this is the same system used for oop type,
the only calls are 2 that depend on number of args:
type2(oper, arg1, arg2, out)
type1(oper, arg2, out) .

11.15: adda/type/interface`initial size:
. why are other lang's finding it necessary to provide
impl'details in their face?
. they don't need to give component types
but they do need to give allocation size
else the default is
length needed for a dope vector into a heap zone
-- that would be size of ptr to void .
. if they want a larger fixed sized,
they'll have to specify an initial size,
or by specifying a type, it implies a size .
. perhaps adda's way should not use such implication
to remind new readers that the face is
not showing any type details
but merely a min' size .
-- eg, the type`literal.component: "(min'size)
can have the value"( sizeof ) .
[11.24:
. the problem with size in bytes
is that you may not know how many bytes are needed
for the choices you want on the platform you're on .
]

No comments:

Post a Comment