Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Sather
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Object-oriented programming language similar to Eiffel}} {{About||people with the surname|Sather (surname)}} {{Infobox programming language |name = Sather |logo = |paradigm = [[Object-oriented programming|object-oriented]], [[Functional programming|functional]] |family = [[Eiffel (programming language)|Eiffel]] |designer = [[Steve Omohundro]] |developer = [[University of California, Berkeley]], [[University of Waikato]], [[GNU project]] |released = {{Start date and age|1990}} |latest release version = {{wikidata|property|reference|P348}} |latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}} |typing = [[static typing|static]], [[Strong and weak typing|strong]] |implementations = ICSI Sather, GNU Sather |dialects = |influenced by = [[Eiffel (programming language)|Eiffel]], [[CLU (programming language)|CLU]], [[Common Lisp]], [[Scheme (programming language)|Scheme]] |influenced = Cool }} '''Sather''' is an [[Object-oriented programming|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 (computer science)|garbage collection]] and [[Generic programming|generics]] by [[Subtyping|subtypes]]. Originally, it was based on [[Eiffel (programming language)|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: [[iterator]]s, [[design by contract]], [[abstract class]]es, [[multiple inheritance]], [[anonymous function]]s, [[operator overloading]], [[Covariance and contravariance (computer science)|contravariant]] type system. The original Berkeley implementation (last stable version 1.1 was released in 1995, no longer maintained<ref>{{cite web| url = http://www.icsi.berkeley.edu/~sather/future.html| title = ICSI Sather future plans| access-date = 2012-03-02| archive-date = 2012-02-05| archive-url = https://web.archive.org/web/20120205024842/http://www.icsi.berkeley.edu/~sather/future.html| url-status = live}}</ref>) has been adopted by the [[Free Software Foundation]] therefore becoming GNU Sather. Last stable GNU version (1.2.3) was released in July 2007<ref>{{cite web| url = http://ftp.gnu.org/gnu/sather/| title = GNU Sather downloads| access-date = 2012-03-02| archive-date = 2012-04-05| archive-url = https://web.archive.org/web/20120405211902/http://ftp.gnu.org/gnu/sather/| url-status = live}}</ref> and the software is currently not maintained. There were several other variants: Sather-K from the [[University of Karlsruhe]];<ref>[https://web.archive.org/web/20011202073442/http://i44s11.info.uni-karlsruhe.de/sather/ Sather-K project page] (archive from year 2001)</ref><ref>{{cite web| url = ftp://ftp.icsi.berkeley.edu/pub/sather/Sather-K/| archive-url = https://web.archive.org/web/20240429011023/ftp://ftp.icsi.berkeley.edu/pub/sather/Sather-K/| archive-date = 2024-04-29| url-status = dead| title = Sather-K 0.9 download, version from year 1994| access-date = 2012-03-02}}</ref> Sather-W from the [[University of Waikato]]<ref>[https://web.archive.org/web/20021213090342/http://www.cs.waikato.ac.nz/sather/ Sather-W 1.3 project page] (archived link from year 2002)</ref> (implementation of Sather version 1.3); Peter Naulls' port of ICSI Sather 1.1 to [[RISC OS]];<ref>Peter Naulls' port is no longer available on the Web.</ref> and pSather,<ref>{{cite web| url = http://www.icsi.berkeley.edu/~sather/psather.html| title = pSather description| access-date = 2012-03-02| archive-date = 2012-02-05| archive-url = https://web.archive.org/web/20120205024939/http://www.icsi.berkeley.edu/~sather/psather.html| url-status = live}}</ref><ref>{{cite web| url = ftp://ftp.icsi.berkeley.edu/pub/sather| archive-url = https://web.archive.org/web/20170706110058/ftp://ftp.icsi.berkeley.edu/pub/sather| archive-date = 2017-07-06| url-status = dead| title = pSather download| access-date = 2021-10-11}}</ref> 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 (programming language)|C]], i.e., the compiler does not output [[object file|object]] or [[Machine language|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 [[GNU General Public License|GPL]] & [[LGPL]]. == Hello World == <syntaxhighlight lang="eiffel" line> class HELLO_WORLD is main is #OUT+"Hello World\n"; end; end; </syntaxhighlight> A few remarks: * Class names are ALL CAPS; this is not only a convention but it's enforced by the compiler. * The method called <code>main</code> is the entry point for execution. It may belong to any class, but if this is different from <code>MAIN</code>, it must be specified as a compiler option. * <code>#</code> is the constructor symbol: It calls the <code>create</code> method of the class whose name follows the operator. In this example, it's used for instantiating the <code>OUT</code> class, which is the class for the [[Standard streams#Standard_output_(stdout)|standard output]]. * The <code>+</code> operator has been overloaded by the class to append the string passed as argument to the stream. * Operators such as <code>+</code> are [[syntactic sugar]] for conventionally named method calls: <code>a + b</code> stands for <code>a.plus(b)</code>. The usual arithmetic precedence conventions are used to resolve the calling order of methods in complex formulae. == Example of iterators == This program prints numbers from 1 to 10. <syntaxhighlight lang="eiffel" line> class MAIN is main is loop i := 1.upto!(10); #OUT + i + "\n"; end; end; end; </syntaxhighlight> The <code>loop</code> ... <code>end</code> construct is the preferred means of defining loops, although <code>while</code> and <code>repeat</code>-<code>until</code> 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.) <code>upto!</code> is a method of the <code>INT</code> class accepting one <code>once</code> argument, meaning its value won't change as the iterator yields. <code>upto!</code> could be implemented in the <code>INT</code> class with code similar to the following one. <syntaxhighlight lang="eiffel"> upto!(once m:INT):SAME is i: INT := self; -- initialise i to the value of self, -- that is the integer of which this method is called loop if i>m then quit; -- leave the loop when i goes beyond m end; yield i; -- else use i as return value and stay in the loop i := i + 1; -- and increment end; end; </syntaxhighlight> Type information for variables is denoted by the postfix syntax <code>variable:CLASS</code>. The type can often be inferred and thus the typing information is optional, as in <code>anInteger::=1</code>. <code>SAME</code> is a pseudo-class referring to the current class. ==References== {{reflist}} ==External links== {{cite web |title=Sather Home Page |url=http://www.icsi.berkeley.edu/~sather/ |archive-url=https://web.archive.org/web/20240325214242/https://www1.icsi.berkeley.edu/~sather/ |archive-date=2024-03-25 |access-date=2025-01-16}} [[Category:Class-based programming languages]] [[Category:GNU Project software]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:About
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)