Press "Enter" to skip to content

Introduction

.. ors eliminate much of the motivation for programming that way. They are also useful for building control structures at run-time, for example, registering call-backs with a windowing system. Like other Sather methods, method closures follow static typing and behave with contravariant conformance. 1.5.7 Immutable and Reference Objects Sather distinguishes between reference objects and immutable objects.

Imutable objects never change once they are created. When one wishes to modify an immutable object, one is compelled to create a whole new object that reflects the modification. Experienced C programmers immediately understand the difference when told about the internal representation the ICSI compiler uses: immutable types are implemented with stack or register allocated C ‘struct’s while reference types are pointers to the heap. Because of that difference, reference objects can be referred to from more than one variable (aliased), but immutable objects never appear to be. Many of the built-in types (integers, characters, floating point) are immutable classes. There are a handful of other differences between reference and immutable types; for example, reference objects must be explicitly allocated, but immutable objects ‘just are’. Immutable types can have several performance advantages over reference types.

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

Immutable types have no heap management overhead, they don’t reserve space to store a type tag, and the absence of aliasing makes more compiler optimizations possible. For a small class like ‘CPX’ (complex number), all these factors combine to give a significant win over a reference class implementation. Balanced against these positive factors in using an immutable object is the overhead that some C compilers introduce in passing the entire object on the stack. This problem is worse in immutable classes with many attributes. Unfortunately the efficiency of an immutable class is directly tied to how smart the C compiler is; at this time ‘gcc’ is not very bright in this respect, although other compilers are.

Immutable classes aren’t strictly necessary; reference classes with immutable semantics work too. For example, the reference class ‘INTI’ implements immutable infinite precision integers and can be used like the built-in immutable class ‘INT’. The standard string class ‘STR’ is also a reference type but behaves with immutable semantics. Explicitly declaring immutable classes allows the compiler to enforce immutable semantics and provides a hint for good code generation. Common immutable classes are defined in the standard libraries; defining a new immutable class is unusual. 1.5.8 IEEE Floating-Point Sather attempts to conform to the IEEE 754-1985 specification for its floating point types. Unfortunately, many platforms make it difficult to do so.

For example, underflow is often improperly implemented to flush to zero rather than use IEEE’s gradual underflow. This happens because gradual underflow is a special case and can be quite slow if implemented using traps. When benchmarks include simulations which cause many underflows, marketing pressures make flush-to-zero the default. There are many other problems. Microsoft’s C and C++ compilers defeat the purpose of the invalid flag by using it exclusively to detect floating-point stack overflows, so programmers cannot use it. There is no portable C interface to IEEE exception flags and their behavior with respect to ‘setjmp’ is suspect. Threads packages often fail to address proper handling of IEEE exceptions and rounding modes. Correct IEEE support from various platforms was the single worst porting problem of the Sather 1.0 compiler.

In 1.1, we give up and make full IEEE compliance optional. Sather implementations are expected to conform to the spirit, if not the letter, of IEEE 754, although proper exceptions, extended types, underflow handling, and correct handling of positive and negative zero are specifically not required. The Sather treatment of NaNs is particularly tricky; IEEE wants NaN to be neither equal nor unequal to anything else, including other NaNs. Because Sather defines ‘x /= y’ as ‘x.is eq(y).not’ (page 116), to get the IEEE notion of unequal is necessary to write ‘x=x and y=y and x/=y’. Other comparison operators present similar difficulties.

1.5.9 pSather Parallel Sather (pSather) is a parallel extension of the language, developed and in use at ICSI. It extends serial Sather with threads, synchronization, and data distribution. pSather differs from concurrent object-oriented languages that try to unify the notions of objects and processes by following the actors model [1]. There can be a grave performance impact for the implicit synchronization this model imposes on threads even when they do not conflict. While allowing for actors, pSather treats object-orientation and parallelism as orthogonal concepts, explicitly exposing the synchronization with new language constructs. pSather follows the Sather philosophy of shielding programmers from common sources of bugs.

One of the great difficulties of parallel programming is avoiding bugs introduced by incorrect synchronization. Such bugs cause completely erroneous values to be silently propagated, threads to be starved out of computational time, or programs to deadlock. They can be especially troublesome because they may only manifest themselves under timing conditions that rarely occur (race conditions) and may be sensitive enough that they don’t appear when a program is instrumented for debugging (heisenbugs). pSather makes it easier to write deadlock and starvation free code by providing structured facilities for synchronization. A lock statement automatically performs unlocking when its body exits, even if this occurs under exceptional conditions.

It automatically avoids deadlocks when multiple locks are used together. It also guarantees reasonable properties of fairness when several threads are contending for the same lock. Data placement pSather allows the programmer to direct data placement. Machines do not need to have large latencies to make data placement important. Because processor speeds are outpacing memory speeds, attention to locality can have a profound effect on the performance of even ordinary serial programs. Some existing languages can make life difficult for the performance-minded programmer because they do not allow much leeway in expressing placement.

For example, extensions allowing the programmer to describe array layout as block-cyclic is helpful for matrix-oriented code but of no use for general data structures. Because high performance appears to require explicit human-directed placement, pSather implements a shared memory abstraction using the most efficient facilities of the target platform available, while allowing the programmer to provide placement directives for control and data (without requiring them). This decouples the performance-related placement from code correctness, making it easy to develop and maintain code enjoying the language benefits available to serial code. Parallel programs can be developed on simulators running on serial machines. A powerful object-oriented approach is to write both serial and parallel machine versions of the fundamental classes in such a way that a user’s code remains unchanged when moving between them. 1.6 History Sather is still growing rapidly. The initial Sather compiler (for ‘Version 0’ of the language) was written in Sather (bootstrapped by hand-translating to C) over the summer of 1990. ICSI made the language publicly available (version 0.1) June of 1991 [4].

The project has been snowballing since then, with language updates to 0.2 and 0.5, each compiler bootstrapped from the previous. These versions of the language are most indebted to Stephen Omohundro, Chu-Cheow Lim, and Heinz Schmidt. pSather co-evolved with primary contributions by Jerome Feldman, Chu-Cheow Lim, Franco Mazzanti and Stephan Murer. The first pSather compiler [3] was implemented by Chu-cheow Lim on the Sequent Symmetry, workstations and the CM-5. Sather 1.0 was a major language change, introducing bound routines, iterators, proper separation of typing and code inclusion, contravariant typing, strongly typed parameterization, exceptions, stronger optional runtime checks and a new library design [6].

The 1.0 compiler was a completely fresh effort by Stephen Omohundro, David Stoutamire and Robert Greisemer. It was written in 0.5 with the 1.0 features introduced as they became functional. The 1.0 compiler was first released in the summer of 1994, and Stephen left the project shortly afterwards. The pSather 1.0 design was largely due to Jerome Feldman, Stephan Murer and David Stoutamire. This document describes Sather 1.1, released the summer of 1996.

The compiler was originally designed and implemented by S. Omohundro, D. Stoutamire and (later) Robert Griesemer. Boris Vaysman is the current Sather czar and feature implementor. Claudio Fleiner implemented most of the common optimizations , a lot of debugging support, the pSather runtime and back-end support for pSather. Michael Philippsen implmented the front/middle support for pSather. Holger Klawitter implemented type checking of parametrized classes.

Arno Jacobsen worked on bound iterators. Illya Varnasky implemented inlining support and Trevor Paring implemented an early version of common subexpression elimination. A group at the University of Karlsruhe under the direction of Gerhard Goos created a compiler for Sather 0.1. The language their compiler supports, Sather-K, diverged from the ICSI specification when Sather 1.0 was released. Karlsruhe has created a large class library called Karla using Sather-K. More information about Sather-K can be found at: http://i44www.info.uni-karlsruhe.de/~frick/SatherK 1.6.1 The Name Sather was developed at the International Computer Science Institute, a research institute affiliated with the computer science department of the University of California at Berkeley.

The Sather language gets its name from the Sather Tower (popularly known as the Campanile), the best-known landmark on campus. A symbol of the city and the university, it is the Berkeley equivalent of the Golden Gate bridge across the bay. Erected in 1914, the tower is modeled after St. Mark’s Campanile in Venice, Italy. It is smaller and a bit younger than the Eiffel tower.

The way most people say the name of the language rhymes with ‘bather’. The name ‘Sather’ is a pun of sorts – Sather was originally envisioned as a smaller, efficient, cleaned-up alternative to the language Eiffel. However, since its conception the two languages have evolved to be quite distinct. 1.6.2 Sather’s Antecedents Sather has adopted ideas from a number of other languages. Its primary debt is to Eiffel, designed by Bertrand Meyer, but it has also been influenced by C, C++, Cecil, CLOS, CLU, Common Lisp, Dylan, ML, Modula-3, Oberon, Objective C, Pascal, SAIL, School, Self, and Smalltalk.

Steve Omohundro was the original driving force behind Sather, keeping the language specification from being pillaged by the unwashed hordes and serving as point man for the Sather community until he left in 1994. Chu-Cheow Lim bootstrapped the original compiler and was largely responsible for the original 0.x compiler and the first implementation of pSather. David Stoutamire took over as language tsar and compiler writer after Stephen left. That position was, in turn, taken over by Boris Vaysman in late 1995. Sather has been very much a group effort; many, many people have been involved in the language design discussions including: Subutai Ahmad, Krste Asanovic, Jonathan Bachrach, David Bailey, Joachim Beer, Jeff Bilmes, Chris Bitmead, Peter Blicher, John Boyland, Matthew Brand, Henry Cejtin, Alex Cozzi, Richard Durbin, Jerry Feldman, Carl Feynman, Claudio Fleiner, Ben Gomes, Gerhard Goos, Robert Griesemer, Hermann Hertig, John Hauser, Ari Huttunen, Roberto Ierusalimschy, Arno Jacobsen, Matt Kennel, Holger Klawitter, Phil Kohn, Franz Kurfess, Franco Mazzanti, Stephan Murer, Michael Philippsen, Thomas Rauber, Steve Renals, Noemi de La Rocque Rodriguez, Hans Rohnert, Heinz Schmidt, Carlo Sequin, Andreas Stolcke, Clemens Szyperski, Martin Trapp, Boris Vaysman, and Bob Weiner. Countless others have assisted with practical matters such as porting the compiler and libraries. 1.6.3 References [1] G.

Agha, ”Actors: A Model of Concurrent Computation in Distributed Systems”, The MIT Press, Cambridge, Massachusetts, 1986. [2] S. Burson, ”The Nightmare of C++”, Advanced Systems November 1994, pp. 57-62. Excerpted from The UNIX-Hater’s Handbook, IDG Books, San Mateo, CA, 1994. [3] C.

Lim. A Parallel Object-Oriented System for Realizing Reusable and Efficient Data Abstractions, PhD thesis, University of California at Berkeley, October 1993. Available at the Sather WWW page. [4] C. Lim, A.

Stolcke. ”Sather language design and performance evaluation.” TR-91-034, International Computer Science Institute, May 1991. Also available at the Sather WWW page. [5] S. Murer, S.

Omohundro, D. Stoutamire, C. Szyperski, ”Iteration abstraction in Sather”, Transactions on Programming Languages and Systems, Vol. 18, No. 1, Jan 1996 p. 1-15. Available at the Sather WWW page.

[6] S. Omohundro. ”The Sather programming language.” Dr. Dobb’s Journal, 18 (11) pp. 42-48, October 1993. Available at the Sather WWW page.

[7] C. Szyperski, S. Omohundro, S. Murer. Engineering a programming language: The type and class system of Sather, In Jurg Gutknecht, ed., Programming Languages and System Architectures, p. 208-227. Springer Verlag, Lecture Notes in Computer Science 782, November 1993.

Available at the Sather WWW page.

x

Hi!
I'm Charlotte

Would you like to get a custom essay? How about receiving a customized one?

Check it out