Talk:Comparison of programming languages (object-oriented programming)

Latest comment: 1 year ago by Rursus in topic Table contents

More languages

edit

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)Reply

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 is:

 system state is modified 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 manipulating (and creating) the classes is performed 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, and new ones can be invented at will.
 A universe of objects forming a bounded system is incrementally constructed by sending messages to already existing objects.

Since these objects include the threads of execution, the system can be seen as a set of interacting objects.
Usage of message everywhere 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).

Messages and a properly defined Virtual Machine operating on the bouded system 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)Reply

I'm surprised that Lisp isn't mentioned. I don't know quite enough to be helpfull, but it should probably be included. — Preceding unsigned comment added by Aero-Plex (talkcontribs) 21:04, 2 October 2011 (UTC)Reply


Java does not have a 'dispose' method--the information listed is incorrect and needs to be removed. Look at Object Documentation. — Preceding unsigned comment added by 98.213.109.106 (talk) 05:32, 19 February 2013 (UTC)Reply

done, though you could have done this yourself ;) - Njol #T·C 18:29, 15 October 2013 (UTC)Reply

Table contents

edit

What is a syntax like this intended to show: class *variable = new class«(parameters)»;? The keyword class is not a type name so the syntax of the clause is invalid. Perhaps if « and » intend to surround a metasyntactic variable, it might be comprehensible but then it should be «class_name» *variable = new «class_name» «(parameters)»;. But, why not just use italic instead of « and »? Rursus dixit. (mbork3!) 02:41, 10 January 2023 (UTC)Reply