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
    agent sieve = inp? x => out! x => (filterp x ^^ sieve)
in out! 1 => (from 2 ^^ sieve)


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:

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).


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.

CNRS LAAS OLC Group Home Page
Last updated: Tue Apr 30 16:02:12 CEST 2002