LCS Version 5.2.0
What is LCS ?
LCS extends Standard ML with higher order behaviors based upon Robin Milner's
Calculus of Communicating Systems (CCS).
Here is an example of an lcs behavior: behavior "primes k" offers all
prime numbers smaller than k on a port labelled "out":
fun primes k =
let infix ^^
fun a ^^ b = (* piping combinator *)
(a {tmp/out} /\ b {tmp/inp}) {/tmp}
fun from n = (* integers from n to k-1 *)
if n < k then out!n => from (n+1) else stop
fun filterp p = (* filters nonmultiples of p *)
let agent sift = inp? x =>
if x mod p = 0 then sift else out! x => sift
in sift
end
agent sieve = inp? x => out! x => (filterp x ^^ sieve)
in out! 1 => (from 2 ^^ sieve)
end;
Features
LCS offers the user the facilities of an SML implementation plus those
of declaring behaviors, of creating processes from these behaviors and of
managing their execution. The sub-language of behaviors is closely inspired
from CCS (not the pi-calculus), LCS extends CCS with higher order features
including behavior passing and indexed communication ports. Behaviors are
typed in an extension of the polymorphic type system of SML, with types
resembling row types or extensible record types, e.g. the above behavior has type {out:
int}_a, meaning that integers are passed through port "out" and that other
ports are not type-constrained (_a is a "row" variable).
Omitting behaviors, LCS can be seen as a lightweight implementation
of SML (as of 90), requiring few computing resources, yet producing reasonnably
fast code. Beside behaviors, its essential differences with SML'90 are:
-
Records are omitted.
-
A simplified module system, with SML structures but without signatures
and functors.
-
Equality types are "first-class" : equality type variables may appear everywhere
a type variable is allowed. In addition, equality type inference is slightly
more permissive.
-
No more imperative types: the treatment of references and exceptions is
basically similar to that of njsml 0.93, except that weakness annotations
are handled by the compiler exclusively.
-
Overloading is available to users: overloading is controled by directives;
an identifier may be bound to several monotyped values in the same scope.
-
Some additional minor differences, including support for lazy evaluation,
builtin bignums, etc.
-
V5.2 added to V5.0 facilities to extend lcs with primitives written in C.
These are not yet documented though. Code for sample plugins and
lcs wrappers is available on request.
Another original feature of LCS are its built-in facilities for type-safe
distributed programming. These permit several LCS applications to interact
through so-called network abstractions. The interacting applications may
run on machines/OS of different kinds, and may exchange values of any type
(including functions and behaviors).
Implementation
LCS Version 5.2.0 is the latest release. It includes an interactive bytecode
compiler, runtimes, a simulator, libraries, and documentation.
In terms of speed, LCS 5.2.0 is 2 to 4 times faster than the previous
V3.1 major release. On typical ML programs (mostly functional), it is as fast or faster than other available bytecode interpreters for ML.
On concurrent programs, the variety of concurrency and communication primitives
in ML-based concurrent languages makes comparisons harder. LCS is well
suited to run programs with medium grain parallelism, many short lived
processes, and many communications.
Home Page
Last updated: Tue Apr 30 16:02:12 CEST 2002