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
Self (programming language)
(section)
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!
== Environment == One feature of Self is that it is based on the same sort of [[virtual machine]] system that earlier Smalltalk systems used. That is, programs are not [[Standalone program|stand-alone]] entities as they are in languages such as [[C (programming language)|C]], but need their entire memory environment in order to run. This requires that applications be shipped in chunks of saved memory known as ''snapshots'' or ''[[system image|images]]''. One disadvantage of this approach is that images are sometimes large and unwieldy; however, debugging an image is often simpler than debugging traditional programs because the runtime state is easier to inspect and modify. (The difference between source-based and image-based development is analogous to the difference between class-based and prototypical object-oriented programming.) In addition, the environment is tailored to the rapid and continual change of the objects in the system. Refactoring a "class" design is as simple as dragging methods out of the existing ancestors into new ones. Simple tasks like test methods can be handled by making a copy, dragging the method into the copy, then changing it. Unlike traditional systems, only the changed object has the new code, and nothing has to be rebuilt in order to test it. If the method works, it can simply be dragged back into the ancestor. ===Performance=== Self VMs achieved performance of approximately half the speed of optimised C on some benchmarks.<ref>{{cite journal |url=http://research.sun.com/jtech/pubs/97-pep.ps |title=Design and Implementation of Pep, a Java Just-In-Time Translator |last1=Agesen |first1=Ole |journal=Theory and Practice of Object Systems |volume=3 |issue=2 |date=March 1997 |pages=127β155 |doi=10.1002/(SICI)1096-9942(1997)3:2<127::AID-TAPO4>3.0.CO;2-S |archive-url=https://web.archive.org/web/20061124224739/http://research.sun.com/jtech/pubs/97-pep.ps |archive-date=November 24, 2006 |url-status=dead|url-access=subscription }}</ref> 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. ===Garbage collection=== The [[Garbage collection (computer science)|garbage collector]] for Self uses [[Tracing garbage collection#Generational GC (ephemeral GC)|generational garbage collection]] which segregates objects by age. By using the memory management system to record page writes a write-barrier can be maintained. This technique gives excellent performance, although after running for some time a full garbage collection can occur, taking considerable time.{{Vague|date=April 2020}} ===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>{{cite thesis |url=https://www.cs.tufts.edu/~nr/cs257/archive/craig-chambers/thesis.pdf |title=The Design and Implementation of the SELF Compiler, an Optimizing Compiler for Object-Oriented Programming Languages |first=Craig |last=Chambers |publisher=[[Stanford University]] |degree=PhD |date=March 13, 1992}}</ref>
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)