Ada bindings to Objective-C and Mac`Cocoa

. cocoa-gnat is google-hosted startup that is more of an ad than a project
calling for 2 levels of GNAT Ada compiler bindings
to the Objective-C run-time API
and the Mac OS X Cocoa framework:
(1) A thin, low-level Objective-C-like Cocoa binding
written in Ada that corresponds one-to-one
with the Objective-C data types and runtime functions
(2) A thick, high-level Ada-like Cocoa binding written in Ada
that uses Ada features like overloading and genericity
to raise the level of abstraction while providing the benefits of
compile- and run-time checking
--. nothing is made,
just a bug report pointing to an Ada forum
that is pointing out that the project is empty .

. when thinking about interfacing Ada to Cocoa
my first idea was to think of Ada as
just replacing the C part .
. the Objective-C part is actually implemented in C
and can be dynamically linking code by
having C call a run-time module .

. I finally thought that the most bug-proof way to bind Ada,
was the same way I had in mind for adda:
use a lang-to-lang translator that translates your language
into the language that your target platform prefers .
. well, it turns out that such an idea was already tossed out,
known as an Objective-Ada pre-processor;
and here was the response:
It'll hurt ability of manipulating source code with 3rd party utilities
It is opposed to Ada spirit.
. others also said this:

Objective-C should be dealt with
the same way as COM on Windows;
except that you're using apple`BridgeSupport XML instead of IDL.

. BridgeSupport XML files are apparently for addressing
this problem:
. binding to an OO[obj'oriented] Lib in another language
is a job without end
as all libraries are constantly extended.
While BridgeSupport sounds good - will it work with GNUStep as well?
a. Cocoa is a superset of OpenStep
b. BridgeSupport files are automatically generated from headers

. other thoughts I had:

. the whole point of a pre-processor is to change the language;
but the primary mission of Objective-C
is something that ada has already addressed:
. the idea of dynamically interchangable modules
is the essence of Objective-C,
and in Ada we can do this by re-compiling the body of a package .
. the next time we run the system, it uses that body .
. every other feature depends on a c-based run-time;
and ada interfaces to c .
. actually, another service of Objective-C
is that run-time that lets you call a variable function;
ie, instead of calling a particular function on a variable object,
everything can be variable:
call( [pointer to my obj], [pointer to name of function I want applied]) .
. Ada users would also need to follow a Reflection protocol,
where, for every class you define,
you have to declare similar information to a database
. the full power of the Objective-C 2.0 Runtime
is detailed in the Reference

this reference is useful primarily for developing bridge layers
between Objective-C and other languages,
You typically do not need to use the Objective-C runtime library directly
when programming in Objective-C

8.29: co.adda/macada/why is xcode changing its interface to new langs?:
. why is xcode changing its interface to new langs?
. this is another reason why I'm into
compilers that convert your lang into the platform lang .

LEGO Mindstorms NXT

. GNAT is the openware version of
the USA`dept of defense's programming language: Ada .

allows use of both Ada 2005
and SPARK (an annotated Ada subset)
to program the LEGO MINDSTORMS NXT
which is an education-oriented robotics platform
involving embedded systems development .
. entire embedded systems, including software, hardware
sensors interfacing, and wireless communications
can be developed and verified
using the GPL editions of GNAT and SPARK.

Originally an education-oriented project at MIT Media Lab,
LEGO MINDSTORMS has evolved into a succesful commercial product
used in many Universities and high schools .
The latest revision of the platform supports
sensors for distance, colors and sounds
and communication via the Bluetooth protocol.

. the other prog'lang for this platform
is Dave Baum's nqc (not quite c),
a native byte-code compiler toolkit for the
Lego Mindstorms, Cybermaster and LEGO Spybotics systems .
. NQC (at sourceforge) does not currently support
the new LEGO NXT programmable brick .
. If desiring a non-Ada high-level programming language
-- easy to use and very similar to NQC --
see Not eXactly C (NXC).

. Lego Mindstorms is not mac.intel ready;
similarly, the GNAT GPL Edition for LEGO MINDSTORMS NXT
works only on the pc (xp or vista)
even though there is a GNAT for programming mac OS X
that does work on mac OS X .

relies on the nxtOSEK operating system
to manage real-time and concurrent execution.
GNAT for Lego Mindstorms requires you to
erase the original Lego firmware;
which can, however, be restored if necessary.
Here’s what’s included:
* GNAT GPL edition targeting the LEGO MINDSTORMS NXT Platform
* Bindings to nxtOSEK, an open, real-time operating system
providing facilities for real-time and concurrent systems
* Bindings to access MINDSTORMS hardware (processor, sensors and motors),
including Bluetooth
* Getting Started material, examples of applications
which can be used as teaching material
coming soon:
* Availability for the LEGO MINDSTORMS robotic building system




. there are 2 levels of extension:
c-coded, and adda-coded .

. c-coded ext's are c modules that get linked to addm;
this causes addm to need recompiling too,
but addm itself is a very small module
being used only for coordinating calls to many other ext' modules .

. adda-coded ext's are bytecode or wordcode data files
that addm can use as exe'able files .

. wordcode.files come from compiling adda.txt into
high-level function calls that addm can execute only slowly;
most of the calls are to functions provided by the adda library .
. bytecode.files come from having optimized wordcode.files
by translating them to addm's native instruction set .

. addx supports lisp-like functionality,
where a program can generate code that it can later use .
. on restricted platforms that don't provide
program control of c compilers and linkers,
all lisp-like functionality is done at the adda-coded level .
. in either case, adda provides a compile.operation,
which allows optimizing for {compile time, speed, space};
but on the restricted systems,
adda can be compiled only to addm`bytecode,
while on others, adda can be compiled to c code,
which essentially means being compiled to the platform's native code .

the intel`Ada.chip was also cap'based!

. when I was learning assembly programming in the 80's,
the textbook's author spoke of this fantastic new intel chip:
the iAPX 432, having an instruction set that was so high-level
it mirrored the semantics of the Ada programming language .
. after hearing that it also included cap'based security
I did another search for more news about it .
. specifically, it features capability-based addressing,
where pointers are replaced by protected objects (called capabilities)
that can only be created through the use of privileged instructions
which may only be executed by the kernel
(or some other privileged process authorized to do so).
This effectively allows the kernel to control which processes
may access which objects in memory
without the need to use separate address spaces
thereby avoiding a lot of context switching .
and allowing an efficient implementation of capability-based security .

Object-oriented memory and capabilities

The iAPX 432 has hardware and microcode support for
oop and capability-based addressing
. all pointers are (seg, offset) pairs;
Segments are referenced by Access Descriptors (ADs),
which provide
an index into the system object table
and a set of rights (capabilities) governing accesses to that segment
The hardware and microcode rigidly enforce
the distinction between data and access segments .

Each system object has a type field which is checked by microcode,
such that a Port Object cannot be used where a Carrier Object is needed.
User program can define new object types which will get the full benefit of
the hardware type checking, through the use of Type Control Objects (TCO).

In Release 1 of the iAPX 432 architecture,
a system-defined object typically consisted of
an access segment,
and optionally (depending on the object type)
a data segment specified by an access descriptor
at a fixed offset within the access segment.
By Release 3 of the architecture, in order to improve performance,
access segments and data segments were combined into
single segments of up to 128 kb,
split into an access part and a data part of 0–64 KiB each
. This reduced the number of object table lookups dramatically,
and doubled the maximum virtual address space.

Fred J. Pollack, Kevin C. Kahn, Roy M. Wilkinsom,
"The iMAX-432 Object Filing System,"
Proceedings of the Eighth Symposium on Operating System Principles,
14-16 December 1981, pp. 137-147

Levy, Henry M.,
Capability-Based Computer Systems, Digital Press, 1984/
Intel iAPX-432 Micromainframe/software/
Native - written in Ada: iMAX-432 Operating System
-- thorough survey and description of early capability-based
and object-based hardware and software systems.
(out of print book now free to download)

scrambled for 8086 after the iAPX-432 lost it

. after the 432, the engineering team came up with
a new architecture (P7/Gemini)
that was still object-oriented, but with a RISC-like ISA
instead of the 432 "VCISC" [very large instruction set computing] .
The object-oriented features were implmented with a tag bit
(so in a sense it was a 33-bit processor)
and an on-chip microcode ROM .
They had 56 bit segments and 32 bit offsets.
. The goal was to have the software reliability features of the 432
but better performance than the 68000 .
. As they increased the speed,
the extra "object Oriented" microcode got in the way .
. the [legendary] 8086 was the 16-bit stopgap measure
that was hastily designed when the 8800 project (which became the 432)
was years behind schedule.

Elliott I. Organick, A Programmer's View of The Intel 432 System, 1983.

G. Cox et al.
Interprocess Communication and Processor Dispatching on The Intel 432,
ACM TOCS, Vol. 1, No. 1, Feb 1983, pp 45-66.


context switching

. addm is a vm (virtual machine) that supports mult-tasking;
and to be economical about context-switching,
it could have 2 forms:

. first, there is just a pointer to the process`context.record;
and, to see what the process wants,
it just starts doing commands through that pointer;
(7.7: that means it saved time not copying the context into registers,
but now every mem'access requires an additional int`addition
from the use of going through a pointer) .

. then if it looks like there's serious work to do in that process,
it converts to immediate mode of context switching,
where it copies the context.record to addm`registers
and then proceeds, until the next context switch .

. also there can be multiple sets of addm`registers, say 4 or more,
so, for atleast 4 processes,
the context switching can stay resident,
and for a list of low-priority tasks,
the contexts need never be immediate .


journaling wave-oriented

. upon hearing about a terminal app with tabs
(so you can have several sessions
in one window like a web browser)
I was reminded of google`wave managing communications .
. this inspired me to have adde
going beyond file-oriented journaling,
to journaling the interactions between
all processors and projects .
[7.6: by "processor" I mean the human or autonomous user
of a tool that can edit a project;
journalling is another term for unlimited undo
or revision control]
--. google's wave is named after EM waves,
the electromagnetic vehicle by which
all objects in physics telecommunicate (ie,
transmit energy without particles bumping into each other) .

naming schema of function inout like packages

. it might promote more familiarity by pre-naming parameters
as being components of pkg"x,
so then you can instantly recognize in the code
that p is a parameter by seeing it prefixed by x:
x`p .
. likewise, y could be reserved for naming
the value that is being returned .
. x is widely understood as the dependent variable
y is what comes after x, hence the result .

a single ipc mechanism

. can all msg passing be impl'd with protected types
so that there can be just one ipc mechanism?
. it appears that the entry queue could be considered to be
something based on a protected type;
but it likely wouldn't be helpful for simplifying the lang
only to ask users to twist ideas about task calls
into impl'details about how to make calls .

orca -- the python replacement

. python was developed on Amoeba but that platform now features orca?

. orca has modula-2`syntax;
and is for parallel programming on distributed systems,
based on the shared data-object model,
a simple and portable form of object-based
distributed shared memory. [threads are sharing ada`protected-types]
Processes communicate through shared data,
even if the processors on which they run
do not have physical shared memory,
using a novel broadcast protocol .

. Message passing is less suitable if several processes need to
communicate indirectly, by sharing globals .
[ they are talking about the same thing ada was
when it added protected types as an ipc mechanism
after it was noticed that the rendezvous
couldn't do the entire ipc job by itself efficiently ] .

. studying the implementation of
parallel applications on distributed systems,
we started out by implementing several
coarse-grained parallel applications on top of the Amoeba system,
using an existing sequential language extended with
message passing for interprocess communication

We felt that, for parallel applications,
both the use of message passing and a sequential base language
are complicated for applications programmers to use.
Since then,
we have developed a new language for distributed programming .
[and, like python] Orca is intended for
applications programming rather than systems programming .
. the Orca constructs are designed to have
semantics close to conventional languages,
thus making it easy for programmers to learn Orca.
An important goal in the design of Orca was to keep the language simple .

Most distributed languages simply
add primitives for parallelism and communication
to a sequential base language, but ignore problems due to
poor integration with sequential constructs .
. A typical example is passing a pointer in a message,
which is usually not detected and may cause great havoc .

gnu`way vs Tcl 1994

Richard Stallman (rms@gnu.ai.mit.edu) Sep 94:

Why you should not use Tcl
As interest builds in extensible application programs and tools,
and some programmers are tempted to use Tcl,
we should not forget the lessons learned from the first widely used
extensible text editor --Emacs:
a language for extensions should not be a mere "extension language".
It should be a real programming language,
designed for writing and maintaining substantial programs
. Because people will want to do that!
[and his vision for the tcl replacement,
was a full-featured interactive system like lisp,
but which included an an algebraic syntax
(what I would call mathy-english friendly language) ]

and comments to his remark:

important in a modern programming language,
with a comparison of some of the options:

. for interactive programs -- especially distributed applications
which are now the rule more than the exception
-- thread support in the language/runtime greatly simplifies development

Modules or packages:
some mechanism to help maintain the namespace is a must.

. the all-powerful construct from which anything can be derived
. Makes foreign-function interfaces a mess, though.
[7.6: you just need a transaction-based system:
if a continuation is requested during a call to a foreign function,
then the continuation would be rolled back to before that call . ]

Good FFI: Foreign Function Interface
. A way to bind C functions. "Good" in the sense that
lots of folks have used it to build useful applications.

You can't rely on a style of checking return codes (the way c does it)
for building large, reliable programs.
[7.6: the high-security language Spark, based on Ada,
consider Ada`exceptions to be a burden to security ]

RPC Support: [remote procedure call]
Support for making calls across address spaces easily.

... :
Rather than define specific features for the core language,
it should focus on inter-operability
. For example, the core language should use something like the OMG's
version of 'IDL' to define interface specifications
. Automated tools could then generate stubs and interface code
. This simplies the process of 'importing' functionality into the interpreter.

tcl`creator (John Ousterhout (ouster@tcl.eng.sun.com) 26 Sep 1994)
points out that Stallman's choice of Lisp
is ironic since people have already voted that out .
[. I'd qualify that by pointing out that Lisp, like tcl,
has a glaring lack:
it has a syntax only for its symbolic expr'trees
-- it has no mathy-english language to cover those etrees!
. I believe Stallman agreed with this, and was refering to it when he said
that gnu's other lang, besides lisp, should be an "(algebraic) one . ]

[. one great reason for mentioning lisp during talk about replacing tcl,
is that a glue language should be using etrees, not strings, for messaging .
. assuming tcl looks easy like Basic,
a great language should be putting a real skin like tcl
on a real language like lisp .
. the reason it uses strings is to "(make it really easy to drop down into C)
-- C has a convention of passing strings to main;
however, C also allows access to binary files,
and these could be used for messaging . ]

Wayne Throop (throopw%sheol.uucp@dg-rtp.dg.com) 27 Sep 1994:
I think that expressing things primitively in text
leads to simpler and more fluent notational innovation
than does expressing things in s-expressions.

[the 2-lang system:
. there is significant agreement that there should be a 2-lang solution,
where one is used for scripting, and another for mature or low-level code .
. the primary assumption here though,
is that the best low-level code is c,
and obviously c is not a good scripting lang .
. lisp has a single-lang solution:
your scripting lang is compiled or translated into c .
. some caveats here include:
the scripting lang is easy because it doesn't include details
but you need those details to code efficiently .
. most of the diff's between scripts and c,
are like the diff's between c and assembler:
asm had a very simple lang primarily so the compiler could
fit into very tight amounts of memory .
. c was created to fit into just double that tight space,
so while it could afford a nice syntax,
it was still lacking a lot of bug-catching support .
. bottom line is that c solved the fundamental problem:
the portable algorithm language .
... well almost:
people are still having to create add-on lib's for some
very fundamental features: the gui events, dynamic linking, and multi-threading .]

ipc streams


. the best system design is to simply identify the dimension of design,
and let people experiment .
. a priority dimension, however, is security vs freedom:
. users need a prefabricated configuration that is secure,
and another one that is fast .
. the secure way is to automate security;
ie, for users to get some freedom,
they have to specifically request kernel programming mode;
in that case,
there could still be some degree of safety with a report mode,
that would indicate your system is experimental,
and to use its data with caution
(similar to a warning given when new version of software is beta) .

. processes communicate via a sequence of expr'tree.pointers
(ie, symbolic expressions as in lisp,
rather than strings as in TCL) .
. one way to implement this communication
is like the Singularity shared mem'model:
instead of copying data between process spaces,
the processes implicitely share memory;
but, modularity is enforced symbolically,
by having the system ensure that every chunk in shared memory
is owned by no more than one process at any given time .

. that mem'model assumes that 2 or more processes want to
share in the modifying of some chunk .
. there are also some caveats to multiple readers
having access to a chunk: the writes must be atomic
so that readers don't have access to blurred transition states .

. another way to implement ipc (interprocess comm')
is the way that ajax or git is used on the web:
each process has it's own copy of a database that is virtually shared
by a journaling system:
you are making changes locally via a list of commands,
and then broadcasting that list to all sharers,
so that they can run those commands on their own local copies .

. the secure way to handle ipc pointers
is to have the system be the go-between:
when a process creates a pointer,
it is relative to chunk it is in .
. if a pointer is meant for other processes,
as when one sends another some mail containing an address,
that address is an url -- the only way it can be used is by
calling up the ipc system and asking it to
run a command on a given url .
. the system can then check for permitted capabilities,
as well as address validity .


Internationalization (I18N) and localization (L10N)
both refer to the process of adapting a program to work in
linguistic and cultural environments other than the one
for which it was originally written
The distinction between them is subtle but important:
Internationalization is the adaptation of products
for potential use virtually everywhere,
while localization is the addition of special features
for use in a specific locale.

. the agent-oriented nature of adda makes it a snap at internationalization;
because, where other platforms are letting the programmer
interact directly with the user,
addx enforces go-betweens for everything:
all access to hardware is mediated by addm,
and all access to the user`interface
[7.5: is actually manipulating only the interface of
the user's presentation agent, which then translates
between the program's demands,
and the user's desired protocol . ]

. the next step is a kit to help foreign lang' developers
map their char strings to etrees .
. how this can be done may become more clear when
I redo mapping my english to etree .

. I recall hearing that the python.ce implementation
had problems on that platform because there was
something environmental that was provided by every desktop platform
that was not provided by win'ce;
I had sneered that a portable language should be creating all its own std's;
ie, it has a set of wrappers for things commonly provided by the platform,
but when a platform falls short, the wrappers are there,
and the implementors can fill them themselves .

. while etree does specify a universal binary lang,
this is translated by the user's presentation agent,
so even if it embedded things like encoding time as ascii char's,
it's still an equal translation for both,
as it's likely that many in every culture like seeing things in gui, not ascii .


. the comment could be delimited by a fully-spaced period,
and then those who wanted to write multiple sentences
would still be able to end a comment with just a period (rather than "(.--) ) .

messaging model

. kazakov(www.dmitry-kazakov.de) writes:
the messaging in Gtk+ is The worst possible combination:
asynchronous in its interface
while synchronous in implementation.
. Ada's OO messaging is all synchronous;
concurrency is outside Ada's OO model.
. an asynch interface means you expect the transaction to take no time,
like calls to an ada`protected.var's subprograms,
vs a call to an ada`task's entry,
which puts you on a que .
does he mean by a synchronous impl'
that the caller process gets suspended until the message is processed
even though the semantics do not require suspension? . ]

stack-based vs queue-based langs

. Jasvir Nagra (www.cs.auckland.ac.nz/~jas) writes:

Features of some programming languages make some algorithms
more elegantly expressly than others
. E has two calling conventions
- one that is stack-like and one that is queue-
which makes both styles of visitors pleasantly expressible
(slightly modified to emphasize the similarity) .
. I realize its not really much more to allocate a queue
but its a pretty pattern and makes it particularly easy to mix DFS and BFS:

def depth(tree, visit):
""(. stack-based languages might favor depth-first
because it is easy to take advantage of the call stack
instead of having to allocate a new data structure to store a queue
for child in tree`children:
depth(child, visit)

def breadth(tree, visit):
""( in a queue-based language more people would use a breadth-first visitor.
for child in tree`children:
breadth<-(child, visit)

listener capability

. in the listener model, any time an obj' modifies itself,
this update is supposed to be published to any registered listeners .
. listener capability is like a file attribute:
along with the predicates of what the owner is permitted:
readable, writable, or exe'able
there is also:
publishable .

[7.5: . the system should be helping type-mgt to impl' this;
just as it does for policing parameter and access modes:
"{ constant, in, out, inout} . ]
. when an object has the attribute"publishable,
then the system can find
any place where writing operations have been applied,
and replace that writing call
with the same call followed by a publish .

. registered listeners are then given an email with a link to the obj;
[7.5: ie, listening is modeled as a asynchronous communication
between concurrent processes;
any time a listener requests to know about changes to an object,
it is identifying that object by an url,
and any mailed reports of updates will be using that same url .
there is another model: intra-process listening,
as when the model-view-controler pattern is used,
and the view.obj needs to be kept in sync with the model.obj .
. in this case, the subscriber doesn't simply want receipt of changes,
rather, it wants the compiler to bundle any writing call
with additional calls that use the author's value
in a function of the subscribers choosing;
so, when the model-view-controler pattern is used,
the code: Listener`listenTo(Author)
would be translated to:
compiler`(for each write-call to Author:
append Listener`= image Author`value


. it's asking the class"mem to actually implement the writes as
what its own class really does
. during an object operation it is describing
how to translate its operation on a value
into the way the class"mem should actually write the value change to the memory .
. so then the type-mgt itself doesn't need to support listening,
it's a service of class"mem:
given an obj', it will keep track of that obj for you,
as every time it gets a call to make a write,
it checks if that chunk has a listener bit set,
and if so, then it refers to that chunk's obj's entry in the publishings directory,
which tells who's listening to the obj .

. a complication to this theory of this system
is that
it is type-mgt that is assigning memory to an object;
and, this can also mean dynamically changing memory,
either as the size changes,
or as a way of efficiently dealing with assignments
without having to copy the value,
it just gives it the new block,
and recycles its current block to some other use .

. in short,
type-mgt virtually has to assist in supporting listeners,
since only type-mgt and not mem-mgt is aware of dynamic obj-mem associations,
yet its clients are asking mem to target obj's rather than mem chunks .

. so all the classes that adda comes with will support listening,
and user defined classes can optionally support it .

. another theory is that
adda be smart eno to morph the source,
so that if listening is needed then
dynamic code injection is providing this capability .

. in sum,
the main req's are that things should be kept simple for new class designers,
and still provide the listener service .

hll-to-hll projects

--. the search to help me build an adda -> c translator:
. can we find an {ada, pascal} to c translator?
. also, a conversion either way might be helpful (eg, c->pascal):
. and how about lisp to c?
reminds that I may find python to c written in python
. actually, ...

. the primary goal for adda's tool is to find some way of
translating things that are said my way
into things that are understood with common tools .
. c is the hll (high-level lang) that is recognized everywhere;
so, the easiest compiler translates adda to c .
. c is notorious for not being well defined
or otherwise not being easy to translate into another lang;
so, one goal adda does not have
is trying to reuse c code by translating into adda;
rather, adda simply has to find the safe, understandable parts of c,
and map adda`lang to those parts .

. rather than try to hand-translate similar projects,
and adapt them to the needs of adda's toolset,
I may be better off just boning up on hand-crafted compilers
(Patrick Terry` programming language translation)
and using the ideas from that (conveyed in straightforward Pascal code)
to create code specifically for adda`tools .

. some of the things I did for etree parsing
and the string pkg (pascal code)
may be easily convertable to c;
although the etree lang is not exactly what adda should be
(it used precidence rather than smart type inferencing) .

to llvm or not

6.6: summary
. let clang translate hll to llvm,
and let adda take the much smaller step of
transforming adda`hll to clang`hll -- obj'c (which includes plain c) .

5.1: web.addm/what's new with llvm?
The llvm-py is a Python package, consisting of 6 modules,
that wrap over enough LLVM APIs to allow the implementation of
your own compiler/VM backend in pure Python .

. you can extend the llvm
just as you can reach any libraries you want from c .
. this is how Apple`c gives access to concurrency .

5.1: addm/python concurrency is alive despite gil:
something like pypy,
but the emphasis is llvm
not python coded in itself:
. they intend to remove the GIL
and fix the state of multithreading in Python
. We believe this is possible through
the implementation of a more sophisticated
GC system, something like IBM's Recycler
(Bacon et al, 2001).
. here is their comment on
an llvm binding for python:
llvm-py has such wrapper types,
but using Python-defined types
in the core interpreter
is very difficult,
so we'll write our own
. These won't be full wrappers
(leave that to llvm-py)
. Just what's convenient and useful for debugging.
The switch to LLVM
itself isn't solving the
concurrency problem
. That's being solved separately,
by getting rid of the Global Interpreter Lock.

I like the GIL; it makes my life a lot easier
not having to think about
tricky synchronization issues.
I use threads mainly to deal with
blocking I/O,
not to take advantage of multicore processors
(for that, I would use the multiprocessing module
to spawn separate processes).
I can recommend libJIT for its simplicity
and performance (LLVM is overkill):
. just a couple of things
LLVM did not easily support for us:
in .NET and Microsoft CIL
(Common Intermediate Language ECMA-335):
* the whole spectrum of ECMA 335 for
CLR types and operations
* async exception handling
* precise stack marking
* multiple custom call conventions
* fast Just-In-Time compilation
All these features are supported in libJIT.
Also libJIT has been already used
and well tested in real life
in DotGNU Portable.NET Just-In-Time compiler, ILDJIT,
and, moreover, in HornetsEye
where libJIT is integrated with Ruby
to accelerate video and image digital signal processing.
See also
other information about why LLVM is overkill,
from people who have done a lot of research on
JIT compilation:
(Rhys Weatherley (libJIT) vs Chris Lattner (LLVM))
Try to Google for libJIT.
Look for very detailed technical information here:
libJIT is both much easier and much faster than LLVM.

control string replacement

. notice tcl/tk and c are often passing strings to indicate code;
eg, f'open(name, "(r+, access=lock))
. these control strings are really lists of symbols not characters
so, instead of passing a char.string,
it should be a symbol atom "(r+),
or symbol list "(, ,,,) .


. control strings entail a sublanguage, whereby
the server is parsing the string according to rules
shared between client and server .
. control strings may be given either as literals at compile.time,
or as char.string operations stored in char.string variables .
. a literal has 2 levels: a char.string is parsed into an etree
""( a char.string ) -- here is a string of char's starting with a space;
"( an etree ) -- here is an etree with 2 symbols .

. the use of char.string to convey parameters is not consistent with
the goal of having one universal language .
. it does not reuse available language parsers and debuggers;
and is therefore not as modular as possible .

. a server's definition of a control string
is similar to declaring parameter names:
it's declaring symbols that have a meaning specific to
the parameter record being applied during a call to the server .

. just as there is a way to declare formal param's,
the language needs a way to declare the allowed sublanguage
that will be assigned to the control.string parameter .
. the control.string's type is like a union:
it describes the varieties of etree that it's permitted to have .
. when etree is assigned to it, the compiler is called to check compatability;
. when char.string is assigned, it's parsed into etree and checked .
. that means when a control.string is being constructed dynamically,
the system designer doesn't have to consider how one is
constructing etrees rather than strings;
parsing is done generically, encoded to the widest possible dictionary
until it's been assigned to an environ such as a namespace or a control.string .

char.string literal enclosures

. this string literals syntax:
is expecting the string to have balanced paren's,
and if this can't be expected,
then any other enclosure should be usable: {}, [] .
. if no expectations can be placed on the string,
then it can be written [6.4: indented and]
with the enclosures on separate lines:

open client-server contracting

. the human user of a program is one example of
a client using a server .
. when server and client can both control a parameter
then both can be notified when the other has changed things;
a server can refuse to work with client`changes;
but, servers can't secretly make changes .