Content deleted Content added
Citation bot (talk | contribs) Add: s2cid, isbn, year, journal, authors 1-2. Removed parameters. Some additions/deletions were parameter name changes. | Use this bot. Report bugs. | Suggested by RoanokeVirginia | Category:Programming languages | #UCB_Category 146/200 |
m Open access bot: url-access updated in citation with #oabot. |
||
(33 intermediate revisions by 19 users not shown) | |||
Line 1:
{{Short description|Prototype-based programming language}}
{{Infobox programming language
| name = Self
| logo =
| logo size = 200px
| paradigm = [[Object-oriented programming|object-oriented]] ([[prototype-based programming|prototype-based]])▼
| logo caption = Self logo
| year = {{Start date and age|1987}}▼
| screenshot = <!-- Filename -->
| designer = [[David Ungar]], Randall Smith▼
| screenshot caption =
| developer = David Ungar, Randall Smith, [[Stanford University]], [[Sun Microsystems]]▼
▲|
| latest release version = Mandarin 2017.1▼
| family = [[Smalltalk]]
| latest release date = {{Start date and age|2017|05|24}}▼
| typing = [[Type system|dynamic]], [[Strongly-typed programming language|strong]]▼
▲|
▲| typing = [[Type system|dynamic]], [[
| operating system = [[Cross-platform software|Cross-platform]]: [[Unix-like]], [[macOS]], [[Microsoft Windows|Windows]]
| website = {{URL|www.selflanguage.org}}▼
| implementations = Self
| dialects =
|
| influenced = [[NewtonScript]], [[JavaScript]], [[Io (programming language)|Io]], [[Agora (programming language)|Agora]], [[Squeak]], [[Lua (programming language)|Lua]], [[Factor (programming language)|Factor]], [[
▲| license = BSD-like license
▲| website = {{URL|www.selflanguage.org}}
}}
'''Self''' is
Several just-in-time compilation techniques were pioneered and improved in Self research as they were required to allow a very high level object oriented language to perform at up to half the speed of optimized [[C (programming language)|C]]. Much of the development of Self took place at [[Sun Microsystems]], and the techniques they developed were later deployed for [[Java (programming language)|Java]]'s [[HotSpot (virtual machine)|HotSpot]] [[virtual machine]].
At one point a version of Smalltalk was implemented in Self. Because it was able to use the JIT, this also gave extremely good performance.<ref>{{cite
== History ==
Self was designed mostly by [[David Ungar]] and Randall Smith in 1986 while working at [[PARC (company)|Xerox PARC]]. Their objective was to
The first public release was in 1990, and the next year the team moved to [[Sun Microsystems]] where they continued work on the language. Several new releases followed until falling largely dormant in 1995 with
The [[Morphic (software)|Morphic]] [[user interface]] construction environment was originally developed by Randy Smith and John Maloney for the Self programming language.<ref>{{cite conference |last1=Maloney |first1=John H. |last2=Smith |first2=Randall B. |book-title=Proceedings of the 8th annual ACM symposium on User interface and software technology |title=Directness and liveness in the morphic user interface construction environment |date=1995 |pages=21–28 |doi=10.1145/215585.215636 |isbn=089791709X |s2cid=14479674 |url=http://bibliography.selflanguage.org/directness.html |access-date=24 March 2020|url-access=subscription }}</ref> Morphic has been ported to other notable programming languages including [[Squeak]], [[JavaScript]], [[Python (programming language)|Python]], and [[Objective-C]].
▲The first public release was in 1990, and the next year the team moved to [[Sun Microsystems]] where they continued work on the language. Several new releases followed until falling largely dormant in 1995 with the 4.0 version. The 4.3 version was released in 2006 and ran on [[macOS|Mac OS X]] and [[Solaris (operating system)|Solaris]]. A new release in 2010,<ref>{{cite web|title=Self 4.4 released|url=https://blog.selflanguage.org/2010/07/16/self-4-4-released/|date=16 July 2010|access-date=24 May 2017|archive-url=https://web.archive.org/web/20171205194557/https://blog.selflanguage.org/2010/07/16/self-4-4-released/|archive-date=5 December 2017|url-status=dead}}</ref> version 4.4, has been developed by a group comprising some of the original team and independent programmers and is available for Mac OS X and [[Linux]], as are all following versions. The follow-up 4.5 was released in January 2014,<ref>{{cite web|title=Self Mallard (4.5.0) released|url=http://blog.selflanguage.org/2014/01/12/self-mallard-4-5-0-released/|date=12 January 2014|access-date=24 May 2017|archive-url=https://web.archive.org/web/20171206074534/https://blog.selflanguage.org/2014/01/12/self-mallard-4-5-0-released/|archive-date=6 December 2017|url-status=dead}}</ref> and three years later, version 2017.1 was released in May 2017.
Self also inspired a number of languages based on its concepts. Most notable, perhaps, were [[NewtonScript]] for the [[Apple Newton]] and [[JavaScript]] used in all modern browsers. Other examples include [[Io (programming language)|Io]],
== Prototype-based programming languages ==
Line 70 ⟶ 78:
<syntaxhighlight lang="smalltalk">'Hello, World!' print.</syntaxhighlight>
This is the Self version of the [[
Grouping can be forced by using parentheses. In the absence of explicit grouping, the unary messages are considered to have the highest precedence followed by binary (grouping left to right) and the keywords having the lowest. The use of keywords for assignment would lead to some extra parenthesis where expressions also had keyword messages, so to avoid that Self requires that the first part of a keyword message selector start with a lowercase letter, and subsequent parts start with an uppercase letter.
Line 84 ⟶ 92:
And: ((base top) / (scale factor))).</syntaxhighlight>
In Smalltalk-80, the same expression would
<syntaxhighlight lang="smalltalk">valid := self base bottom
Line 105 ⟶ 113:
=== Delegation ===
{{main|Delegation (object-oriented programming)}}
In theory, every Self object is a stand-alone entity. Self has neither classes nor meta-classes. Changes to a particular object do not affect any other, but in some cases it is desirable if they did. Normally an object can understand only messages corresponding to its local slots, but by having one or more slots indicating ''parent'' objects, an object can '''delegate''' any message it does not understand itself to the parent object. Any slot can be made a parent pointer by adding an asterisk as a suffix. In this way Self handles duties that would use [[inheritance (
For example, suppose an object is defined called "bank account", that is used in a simple bookkeeping application. Usually, this object would be created with the methods inside, perhaps "deposit" and "withdraw", and any data slots needed by them. This is a prototype, which is only special in the way it is used since it also happens to be a fully functional bank account.
Line 151 ⟶ 159:
===Performance===
Self VMs achieved performance of approximately half the speed of optimised C on some benchmarks.<ref>{{cite
This was achieved by [[just-in-time compilation]] techniques which were pioneered and improved in Self research to make a high level language perform this well.
Line 159 ⟶ 167:
===Optimizations===
The run time system selectively flattens call structures. This gives modest speedups in itself, but allows extensive caching of type information and multiple versions of code for different caller types. This removes the need to do many method lookups and permits conditional branch statements and hard-coded calls to be inserted- often giving C-like performance with no loss of generality at the language level, but on a fully garbage collected system.<ref>
==See also==
* [[Morphic (software)]]
* [[Cecil (programming language)]]
Line 172 ⟶ 181:
| first1= C. |last1= Chambers
| year=1992
| title = The Design and Implementation of the
| citeseerx = 10.1.1.30.1652
| publisher=[[Stanford University]]
Line 179 ⟶ 188:
==External links==
* {{Official website|www.selflanguage.org}}
* {{
* [https://web.archive.org/web/20020606124955/http://research.sun.com/self/ Former Self Home Page at Sun Microsystems]
{{Smalltalk programming language}}
Line 200:
[[Category:Object-oriented programming languages]]
[[Category:Prototype-based programming languages]]
[[Category:Software using the BSD license]]
[[Category:Cross-platform free software]]
[[Category:Free
[[Category:Programming languages created in 1987]]
[[Category:1987 software]]
<!-- Hidden categories below -->
[[Category:Articles with example Smalltalk code]]
|