Whatever motivation lies behind the development of a programming
language, every language is meant to serve some purpose.
Whether implicitly or explicitly stated, a programming
language is characterized by its design goals and
the applications it is intended to support.
A fortiori this holds for object-oriented programming
languages.
The impetus to research in object-oriented programming
may be traced back to the development of Simula,
which was originally intended for discrete event simulation.
As observed in
Of the 69 (standalone) object-oriented languages surveyed,
53 were research projects and only 16 were commercial products.
Of these, 14 were extensions of either Lisp (10)
or C (4).
Among the remaining languages, quite a number were derived from
languages
such as Pascal, Ada or Prolog.
There is a great diversity between the different object-oriented languages.
However, following
POOL-T also supports the notion of active objects.
Active objects have a body which allows them to execute their
own activity in parallel with other active objects.
To answer a request to execute a method, an active object must
explicitly interrupt its activity (by means of an answer or
accept statement as in Ada).
POOL-T is interesting, primarily, because it is complemented
by extensive theoretical research into the semantical foundations
of parallel object-oriented computing.
See
Alternative object models may also be encountered in object-oriented database managements systems and in systems embedding objects such as hypertext or hypermedia systems.
struct A { ... } == class A { public: ... } class A { ... } == struct A { private: ... }
JPL
Jacl, Tcl Blend
JPython
Scripting has clear advantages for rapid prototyping. Disadvantages of scripting concern the lack of efficiency, and the absence of compile-time checks.
Script languages may be extended using C/C++,
and more recently Java.
The impact of Java becomes evident when considering
that there exists a Java implementation for almost
each scripting language, including Tcl/Tk, Perl and Python.
JPython, which is the realization of Python in Java,
even offers the possibility to integrate Python classes with Java
classes, and is announced as a candidate
scripting platform for Java in
Java has also in other respects stimulated programming language
research,
since it appears to be an ideal platform
for realising higher level programming languages.
Objects in Javascript
Javascript is a somewhat special case, since it allows for
the use of built-in objects,
in particular the objects defined by the
Document Object Model (DOM),
and its precursors.
Nevertheless, due to its dynamic nature, Javascript also allows
for creating user-defined objects,
as indicated in the example
below.
function object_display(msg) { object method
return msg + ' (' + this.variable++ + ')';
}
function object() { object constructor
this.variable=0;
this.display = object_display;
return this;
}
var a = new object(); create object
document.write(a.display("a message"));
document.write(a.display("another message"));
</script>
Which objects are available as built-in objects depends on the environment in which Javascript programs are executed. In the example, there is an invocation of the write method for a document object. The document object, as well as other objects corresponding to the browser environment and the contents of the page loaded, are part of the Document Object Model, which is discussed in more detail in section DOM.
As an aside, Javascript has become surprisingly popular for writing dynamic HTML pages, as well as for writing server-side scripts. It is also supported by many VRML (Virtual Reality Modeling Language) browsers to define script nodes. See section DIVA. A reference implementation of Javascript is available, for embedding Javascript in C/C++ applications.