Features of Diesel
Diesel is a purely object-oriented, type-safe,
garbage-collected language intended to support rapid construction of
high-quality, extensible software. Diesel is an evolutionary
successor to Cecil, retaining Cecil's support
for multimethods, first-class function objects, uniform access to all
instance variables and methods via dynamically dispatched messages,
predicate classes, multiple inheritance, open classes where methods
and instance variables are declared separately from their classes, and
a constraint-based polymorphic static type system. Diesel differs
from Cecil in the following ways:
- Diesel includes a module system, which supports namespace
management and encapsulation. (Generic) functions are now explicit in
Diesel, with their visibility controlled by modules.
- Diesel's object model includes explicit concrete and abstract
classes, which can be instantiated as either anonymous or globally
named concrete objects. This differs superficially from Cecil's
classless object model, however semantically Diesel's concrete and
abstract classes correspond exactly to Cecil's template and abstract
objects. Both languages drop the instance-of relation and instead use
inheritance as the sole relation between classes and objects: in
Diesel, an object inherits from its class, and other classes and
objects can inherit from named objects, uniformly.
- Diesel merges inheritance and subtyping: each class introduces a
corresponding type, and one class type is a subtype of another class
type exactly if the first's class inherits from the second's. (Diesel
also includes function types, which obey the usual contravariant
structural subtyping rule, as well as union and intersection types and
top and bottom types.) In contrast, Cecil allowed subtyping and
inheritance to be distinct, but provided syntactic sugar for the
common case in which they were parallel. Diesel simplified this
design, based on practical experience with Cecil, difficulties in
typechecking inherited methods without subtyping, other features which
make subtyping without inheritance unnecessarily restrictive, and
features like F-bounded polymorphism and multiple dispatching which
remove much of the need for inheritance without subtyping.
Some resources for Diesel
Cecil/Vortex
Project