Talk:Comparison of programming languages (object-oriented programming)
![]() | Computing Unassessed | |||||||||
|
More languages
Someone who is familiar with Smalltalk or Objective-C should add them to the comparisons. Thanks, --164.67.59.123 (talk) 01:56, 20 October 2008 (UTC)
I'm familiar, but all I see here is not-Smalltalk.
This page is mostly made up of syntactic sugar. Smalltalk has (almost) no syntactic sugar.
Smalltalk MOST essential feature as a language is:
you program by sending messages to objects
When an object receive a message, it reacts by executing a method which is a small procedure.
This method in turn send other messages to other objects...
The behaviour of an object is determined by its class (the dictionary of methods triggered by messages).
The second feature of Smalltalk is:
everything is an object
including:
- the classes and methods, thus you can manipulate (and create) the classes by sending messages to them;
- the concurrent Process or Thread of execution; thus creating/synchronizing/destroying processes is performed by sending messages
- the context of execution, thus manipulating call stack etc... is possible by just sending messages to special variable thisContext.
- Block closures which are like anonymous methods closing on other method context.
Programmatic access to Context of execution coupled with usage of block closures enable implementation of powerfull Exception handling / coroutines etc... without any syntactic sugar.
The messages are used everywhere, notably:
- There is no syntax for declaring a class, class are created/modified by sending a message to the superclass
- There is no conditional branch nor unconditional goto/jump in Smalltalk language, thus no control structures. In fact forward branching is controlled by polymorphic dispatching of messages and backward branching by recursion, thus control structures are just messages among others, using BlockClosure.
A universe of objects is incrementally constructed by sending messages to already existing objects.
The set of interacting objects including the thread of execution form a complex bounded system.
This implies that Smalltalk IDE operates directly and lively on this system in memory.
An image of this memory can be snapshoted to disk at any time, and restarted later (think of hibernate operation on laptops).
These features with a properly defined Virtual Machine provides reflexion capabilities like:
- requesting which message an object class canUnderstand::,
- creating an Array that gathers all the instances of a specific class, notably list all classes in the system
- enumerate all objetcs in the system
These capabilities enable implementing the whole IDE in Smalltalk and embed it in the system (Debugger and Compiler included).
The reflection capabilities are powerfull enough so that the language syntax itself can be extended/modified lively.
Where would these features fit in this page.
To what can they be compared to ? —Preceding unsigned comment added by 77.204.207.50 (talk) 23:39, 16 February 2011 (UTC)