|Page 21 of 800||Search internet|
Logiweb has a few things in common with Java.
Like Java, Logiweb supports the 'compile once, run anywhere' concept.
The Java compiler takes a Java source as input and produces Java bytecode as output. The lgc compiler takes an lgs source as input and generates a vector and a rack as output. The lgc compiler does not generate bytecode, but racks are to Logiweb what bytecode is to Java.
In Java, the Java virtual machine can execute Java bytecode. In Logiweb, the Logiweb Abstract Machine (lgwam) takes a rack and a function name as input, extracts the named function from the rack, and uses that function as 'handler', i.e. as the function which defines state transitions and I/O of lgwam.
Like was the case for Java, the existence of the Internet was taken into account during the design. For Java, the result was a hardware platform neutral bytecode format. For Logiweb, the result was two, distinct formats: One for transmission over the Internet, and one for storing in a local cache.
In Logiweb, the format used for transmission over the Internet is the 'vector' format which constitutes a compact format suited for transmission over a network with limited bandwidth. Furthermore, vectors are identified by their 'references' which contain a RIPEMD-160 hash key. Having the reference of a Logiweb page one can safely retrieve the associated vector from an untrusted Internet repository over an untrusted connection since one can verify the authenticity of the received vector using RIPEMD.
In contrast, the rack representation of a page takes up much more space and there is no easy way to verify the authenticity of a rack. For that reason, one should use a private cache in which rack versions of Logiweb pages are kept. When using the compiler defaults, lgc keeps such a cache in $HOME/.logiweb/logiweb. Whenever a Logiweb page is in the cache, lgc uses the cached rack. Otherwise, lgc looks for a vector version, translates it to a rack, stores the rack in the cache, and proceeds from there.
|Page 21 of 800||Search logiweb.eu|