Discussion

This chapter has been a whirlwind tour of the Limbo language. While you now know enough to write useful Limbo programs, there are interesting features of the language yet to be described. Most important are modules, processes, and channels, facilities that are central to the graceful construction of large Inferno applications. Because of their importance, they are presented separately, in Chapters 4, 6 and 7.

Limbo has its roots in C, C++, Newsqueak, and Alef (the last two are other languages designed by the authors of Inferno), with a smattering of ideas from other languages. Those of you familiar with C will have noticed that the expression and statement syntaxes are almost identical, though the declaration syntax is more reminiscent of Pascal. The goals of Limbo were to be:

small
The language shouldn't require a big compiler or a big runtime system.
portable
Compiled code should run on many machine architectures with little fuss.
fast
It should be possible to get performance close to that of, say, compiled C.
dynamic
Portions of code and data should be loadable and unloadable at runtime, to allow for minimizing memory usage, and for programming flexibility.
safe
Compile-time type checking and run-time checking should be used to prevent errant programs from running.
multithreaded
It should be easy to write programs containing several threads of control, communicating among themselves and/or sharing data.
garbage collected
Programmers should be relieved of the burden of explicitly deallocating memory. Immediate collection can be depended on unless the programmer explicitly relaxes that requirement.

These goals were motivated by the original target of Inferno&emdash;set-top boxes&emdash;and by a sense of what has worked and what has not worked in other programming languages, and also what tradeoffs made sense in the computing world of the 90's. Smallness was especially important, and as a result, you'll be disappointed if you expect to find all of your favorite programming language features in Limbo.

Still, Limbo is a comfortable language to program in. Programs tend to be short and readable. Seemingly small design decisions in Limbo have large effects on programming comfort. For instance, the := shorthand avoids the need for many type keywords, and the inclusion of formatted print routines that take a variable number of arguments is a godsend, well worth the special treatment needed in the compiler to ensure type safety in print statements.

A different language that addresses many of Limbo's design goals, but in a very different style, is Java. Limbo's main difference from Java, other than matters of syntax, is rooted in its partnership with a complete operating system&emdash;Inferno. In the chapters that follow, we will see how Inferno and Limbo complement each other to make network programming easier.

previous next

© Rob Pike and Howard Trickey 1997. All rights reserved.