Limbo (programming language)

Limbo is a high-level language that is used in the Inferno operating system to application programming. The design of the language were known developer of the Unix world, such as Rob Pike and Dennis Ritchie, who already developed the successful C programming involved.

Modules

Limbo is translated into bytecode, regardless of the processor type, can be run on any machine. Limbo programs are modules that load other modules in Limbo Limbo and whose functionality can use. Modules are loaded by the operating system Inferno when needed and removed later.

Data types

Limbo is a strongly typed language, which is similar at first glance, the C programming language. The creators of Limbo say that it offers the possibilities of Java and C , however, is much easier to learn and master. It supports a few, well-defined data types, such as unsigned 8 -bit characters and 32 bit signed integer. It supports parallel processing. In addition, communication channels exist as data types.

Limbo and the operating system Inferno

Inferno uses file names for almost everything: process information, network connections, pipes, etc. File names are references to the protocol Styx accessible files, resources and equipment. It does not matter whether they are accessible only locally or over the network. Limbo uses this file name for the communication with the outside world. In this case, a module Limbo generate a data structure that communicates through Styx. The methods and functions of a module to be implemented by this in Styx. However, this does not need to know a programmer. He needs to know only the abstract methods of a module, without knowing exactly how they are implemented at the lower Styx protocol.

Reference counting and garbage collection

Pointers are replaced by references that dynamically allocate the referenced structures and deallocate. To this end, both the reference counter, and automatic garbage collection (garbage collection ) are used. The reference count is guaranteed that after giving up the last reference, the data structure is also released. This is important if the structure contains other resources such as open files that are closed at the latest upon release.

If one uses only the automatic garbage collection, so the release can be delayed, possibly also not be carried out before the program ends. The time of release is not predictable. Reference count on the other hand give cyclic data structures such as ring lists, trees with backreferences, etc. are not free reliable. It can structures remain which will never be released because they reference each other, but which also can not be accessed.

Limbo uses a simple method, cyclic data structures normally excluded: If in the definition of a reference to a data structure appears before the actual structure is known, the structure may only total, but no parts are derefenziert it. To ensure that no cyclic data structures can be created. Reference count then ensure that the structure of the last occurrence of the reference and thus to a precisely predictable time is released.

The keyword cyclic lifts the restriction and allows the definition of data types. For releases of these structures, an automatic garbage collection will be used.

Examples

Hello world program

Implement Command;   include " sys.m ";      sys: system;   include " draw.m ";   include " sh.m ";   init ( nil: ref Draw -> Context, nil: list of string ) {      sys = load Sys Sys -> PATH;      sys -> print (" Hello world \ n " ); } Web Links

  • Vita Nuova page on Limbo ( English )
  • Programming language
513191
de