Smalltalk
Smalltalk is one of the first computer programming languages Objet integrated into a Graphical interface. It was created in 1972. It is inspired by Lisp and Simula. It was conceived by Alan Kay, daN Ingals, Ted Kaehler, Adele Goldberg with the Palo Alto Research Center of Xerox. The language was formalized as Smalltalk-80 and since is used by a great number of people. Smalltalk is always actively developed and has a honest base of users.
Smalltalk was of a great influence in the development of many computer programming languages, of which: Objective-C, Actor, Java and Ruby.
A great number of the innovations of the software engineering of years 1990 come from the community of the Smalltalk programmers, such as the Design Patterns (applied to the software), the Extreme Programming (XP) and the Refactoring. Ward Cunningham, the inventor of the concept of the Wiki, is also a Smalltalk programmer.
Concepts
The principal concepts of Smalltalk are:- “All is object. ” The character strings, the entireties, the Boolean ones, the definitions of classes, the blocks of code, the piles and the memory are represented as objects.
- All is modifiable. If you want to change IDE, you can do it -- in the course of use, without recompiler and to start again the application. If you want a new instruction of control in the language, you can add it. With certain implementations, you can even change the syntax of the language, or the way in which the collect-crumb functions.
- the types are dynamic -- not need to define types in your code, which makes it possible the language to be concise.
- a Ramasse-miettes memory is integrated and transparent for the developer.
- a Management system of exceptions with recovery is provided.
- the Smalltalk programs are generally compiled in Bytecode, carried out by a virtual Machine.
- Dynamic relocation: the modern commercial virtual machines compile the bytecode towards the computer code native in order to obtain better performances, a technique of which Smalltalk-80 was the pioneer, developed by ParcPlace Systems in the middle of the Années 1980. This idea was adopted by the Computer programming language Java a few ten years afterwards and famous “compilation just-in-time ”, or JIT.
- a class can inherit only one another class (simple heritage).
Description
Smalltalk implements, in addition to the principles objects of bases (class, object, heritage, polymorphism), of the original concepts (métaclasse) and introduces the concept of persistent object, treatment of the exceptions and the principle Model-Sight-Controller.A surprising characteristic of Smalltalk is the complete absence of instructions of controls integrated into the language: yew-then-else, for, while, etc All these instructions are implemented by using objects. For example, the decisions are made by sending a message ifTrue to a Booléen object, and while passing a fragment of code to be carried out if the Boolean one is true. The only aspect integrated by defect is syntax to send a message to an object.
The following example (a code allowing to find the vowels in a chain) illustrates the style of Smalltalk programming. (the | declares the variables, : declares the parameters, and say you for the moment that and is accodances { and } ):
With the last line, the chain aString receives a message select: with a block of code in argument.
Here the code of the Collection super-class which does the work:
This code answers the message while reiterating through its members (it is the method C:) by evaluating the code aBlock with each character; aBlock (aCharacter isVowel) once evaluated creates Boolean, which is then sent to ifTrue:. If the Boolean one is true, then the character is added to the chain which will be turned over.
As select is defined in the abstract class Collection, one could also use it this way:
External bonds
Implementations
Tutoriels
Random links: Hedeby | Puycornet | Michel Bar-Zohar | Stage of Tree-Dryness | Serge Delmas