Paradigm | object-oriented, functional |
---|---|
Designed by | Steve Omohundro |
Developer | University of California, Berkeley, University of Waikato, GNU project |
First appeared | 1990 |
Stable release | 1.2.3 [1] / 7 July 2007 |
Typing discipline | static, strong |
Website | www |
Major implementations | |
ICSI Sather, GNU Sather | |
Influenced by | |
Eiffel, CLU, Common Lisp, Scheme | |
Influenced | |
Cool |
Sather is an object-oriented programming language. It originated circa 1990 at the International Computer Science Institute (ICSI) at the University of California, Berkeley, developed by an international team led by Steve Omohundro. It supports garbage collection and generics by subtypes.
Originally, it was based on Eiffel, but it has diverged, and now includes several functional programming features.
The name is inspired by Eiffel; the Sather Tower is a recognizable landmark at Berkeley, named after Jane Krom Sather, the widow of Peder Sather, who donated large sums to the foundation of the university.
Sather also takes inspiration from other programming languages and paradigms: iterators, design by contract, abstract classes, multiple inheritance, anonymous functions, operator overloading, contravariant type system.
The original Berkeley implementation (last stable version 1.1 was released in 1995, no longer maintained [2] ) has been adopted by the Free Software Foundation therefore becoming GNU Sather. Last stable GNU version (1.2.3) was released in July 2007 [3] and the software is currently not maintained. There were several other variants: Sather-K from the University of Karlsruhe; [4] [5] Sather-W from the University of Waikato [6] (implementation of Sather version 1.3); Peter Naulls' port of ICSI Sather 1.1 to RISC OS; [7] and pSather, [8] [9] a parallel version of ICSI Sather addressing non-uniform memory access multiprocessor architectures but presenting a shared memory model to the programmer.
The former ICSI Sather compiler (now GNU Sather) is implemented as a compiler to C, i.e., the compiler does not output object or machine code, but takes Sather source code and generates C source code as an intermediate language. Optimizing is left to the C compiler.
The GNU Sather compiler, written in Sather itself, is dual licensed under the GNU GPL & LGPL.
classHELLO_WORLDismainis#OUT+"Hello World\n";end;end;
A few remarks:
main
is the entry point for execution. It may belong to any class, but if this is different from MAIN
, it must be specified as a compiler option.#
is the constructor symbol: It calls the create
method of the class whose name follows the operator. In this example, it's used for instantiating the OUT
class, which is the class for the standard output.+
operator has been overloaded by the class to append the string passed as argument to the stream.+
are syntactic sugar for conventionally named method calls: a + b
stands for a.plus(b)
. The usual arithmetic precedence conventions are used to resolve the calling order of methods in complex formulae.This program prints numbers from 1 to 10.
classMAINismainisloopi:=1.upto!(10);#OUT+i+"\n";end;end;end;
The loop
... end
construct is the preferred means of defining loops, although while
and repeat
-until
are also available. Within the construct, one or more iterators may be used. Iterator names always end with an exclamation mark. (This convention is enforced by the compiler.) upto!
is a method of the INT
class accepting one once
argument, meaning its value won't change as the iterator yields. upto!
could be implemented in the INT
class with code similar to the following one.
upto!(oncem:INT):SAMEisi:INT:=self;-- initialise i to the value of self, -- that is the integer of which this method is calledloopifi>mthenquit;-- leave the loop when i goes beyond mend;yieldi;-- else use i as return value and stay in the loopi:=i+1;-- and incrementend;end;
Type information for variables is denoted by the postfix syntax variable:CLASS
. The type can often be inferred and thus the typing information is optional, as in anInteger::=1
. SAME
is a pseudo-class referring to the current class.
Eiffel is an object-oriented programming language designed by Bertrand Meyer and Eiffel Software. Meyer conceived the language in 1985 with the goal of increasing the reliability of commercial software development; the first version becoming available in 1986. In 2005, Eiffel became an ISO-standardized language.
Mary is a programming language designed and implemented by RUNIT at Trondheim, Norway in the 1970s. It borrowed many features from ALGOL 68 but was designed for systems programming.
In programming languages, a closure, also lexical closure or function closure, is a technique for implementing lexically scoped name binding in a language with first-class functions. Operationally, a closure is a record storing a function together with an environment. The environment is a mapping associating each free variable of the function with the value or reference to which the name was bound when the closure was created. Unlike a plain function, a closure allows the function to access those captured variables through the closure's copies of their values or references, even when the function is invoked outside their scope.
Generic programming is a style of computer programming in which algorithms are written in terms of data types to-be-specified-later that are then instantiated when needed for specific types provided as parameters. This approach, pioneered by the ML programming language in 1973, permits writing common functions or types that differ only in the set of types on which they operate when used, thus reducing duplicate code.
D, also known as dlang, is a multi-paradigm system programming language created by Walter Bright at Digital Mars and released in 2001. Andrei Alexandrescu joined the design and development effort in 2007. Though it originated as a re-engineering of C++, D is now a very different language drawing inspiration from other high-level programming languages, notably Java, Python, Ruby, C#, and Eiffel.
OpenMP is an application programming interface (API) that supports multi-platform shared-memory multiprocessing programming in C, C++, and Fortran, on many platforms, instruction-set architectures and operating systems, including Solaris, AIX, FreeBSD, HP-UX, Linux, macOS, and Windows. It consists of a set of compiler directives, library routines, and environment variables that influence run-time behavior.
In computer programming, a function object is a construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax. In some languages, particularly C++, function objects are often called functors.
In compiler construction, name mangling is a technique used to solve various problems caused by the need to resolve unique names for programming entities in many modern programming languages.
In class-based, object-oriented programming, a constructor is a special type of function called to create an object. It prepares the new object for use, often accepting arguments that the constructor uses to set required member variables.
The syntax of Java is the set of rules defining how a Java program is written and interpreted.
In computer programming, a nested function is a named function that is defined within another, enclosing, block and is lexically scoped within the enclosing block – meaning it is only callable by name within the body of the enclosing block and can use identifiers declared in outer blocks, including outer functions. The enclosing block is typically, but not always, another function.
C++/CLI is a variant of the C++ programming language, modified for Common Language Infrastructure. It has been part of Visual Studio 2005 and later, and provides interoperability with other .NET languages such as C#. Microsoft created C++/CLI to supersede Managed Extensions for C++. In December 2005, Ecma International published C++/CLI specifications as the ECMA-372 standard.
C# is a general-purpose high-level programming language supporting multiple paradigms. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.
Oxygene is a programming language developed by RemObjects Software for Microsoft's Common Language Infrastructure, the Java Platform and Cocoa. Oxygene is based on Delphi's Object Pascal, but also has influences from C#, Eiffel, Java, F# and other languages.
C++11 is a version of the ISO/IEC 14882 standard for the C++ programming language. C++11 replaced the prior version of the C++ standard, called C++03, and was later replaced by C++14. The name follows the tradition of naming language versions by the publication year of the specification, though it was formerly named C++0x because it was expected to be published before 2010.
A property, in some object-oriented programming languages, is a special sort of class member, intermediate in functionality between a field and a method. The syntax for reading and writing of properties is like for fields, but property reads and writes are (usually) translated to 'getter' and 'setter' method calls. The field-like syntax is easier to read and write than many method calls, yet the interposition of method calls "under the hood" allows for data validation, active updating, or implementation of what may be called "read-only fields".
This article describes the syntax of the C# programming language. The features described are compatible with .NET Framework and Mono.
Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its NeXTSTEP operating system. Due to Apple macOS’s direct lineage from NeXTSTEP, Objective-C was the standard programming language used, supported, and promoted by Apple for developing macOS and iOS applications until the introduction of the Swift programming language in 2014.
Swift is a high-level general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. and the open-source community. Swift compiles to machine code, as it is an LLVM-based compiler. Swift was first released in June 2014, and the Swift toolchain has shipped in Xcode since version 6, released in 2014.
Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.
{{cite web}}
: CS1 maint: bot: original URL status unknown (link)