Content deleted Content added
m v2.05b - Bot T20 CW#61 - Fix errors for CW project (Reference before punctuation - Title linked in text) |
m Open access bot: url-access updated in citation with #oabot. |
||
(27 intermediate revisions by 14 users not shown) | |||
Line 2:
{{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}}
}}
'''
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
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 73 ⟶ 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 87 ⟶ 92:
And: ((base top) / (scale factor))).</syntaxhighlight>
In Smalltalk-80, the same expression would
<syntaxhighlight lang="smalltalk">valid := self base bottom
Line 108 ⟶ 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 154 ⟶ 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 162 ⟶ 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==
Line 176 ⟶ 181:
| first1= C. |last1= Chambers
| year=1992
| title = The Design and Implementation of the
| citeseerx = 10.1.1.30.1652
| publisher=[[Stanford University]]
Line 183 ⟶ 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 204 ⟶ 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]]
|