|(3 intermediate revisions by the same user not shown)|
|−|== The Functional Programming Language Clean == |+|
Clean is thepure functional
|−|A functional programming language like Clean is based on the concept of mathematical functions. Clean is a pure functional language , there is not such a thing as an assignment. This has a big advantage: a function cannot have a side- effect. A Clean function is referential transparent: the result of a function only depends on the value of the function arguments and on nothing else. |+|
is a of the
| || |
|−|This has important consequences: |+|
* Clean is a , , functional language .
Once a function is working, it will always work. A function will always react in the same way, regardless when and in which context the function is used; One can reason about Clean functions and the Clean program as a whole (which is a function application) by using traditional mathematical reasoning: uniform substitution and mathematical induction. | |
|−|* For making real world applications one needs of course to be able to update a database, perform I/O, update an array destructively, pass a message to another program. And, the application should run efficiently enough. Although Clean does not have assignments, objects can be updated destructively. Clean is the only functional language in the world which has a special type system, uniqueness typing. This type system is developed in Nijmegen. It enables to update function arguments destructively retaining the purity of the language. | |
| || |
|−|== Research Concepts Used in Clean == |+|
Clean is by lazy , /of .
|−|The Software Technology Research Group is working on functional languages since 1984. Many new concepts which are now commonly used in the functional language community have been introduced by our group (such as term graph rewriting, lazy copying, abstract reduction, uniqueness typing, Clean's Object I/ O concept, concurrent and parallel aspects of Clean, dynamic typing) have a look at our [[publications]]. | |
| || |
|−|== Feature List of the Clean Language == |+|
Clean a of the the , .
|−|For people who are familiar with other functional languages, such as Haskell, we give here a short list with the features of the language. For more information on the language, look here. | |
| || |
is a lazy, pure, higher-order functional programming language with explicit graph-rewriting semantics; one can explicitly define the sharing of structures (cyclic structures as well) in the language; |+|
* Clean , , , and -out .
|−|* Although Clean is by default a lazy language one can smoothly turn it into a strict language to obtain optimal time/space behavior: functions can be defined lazy as well as (partially) strict in their arguments; any (recursive) data structure can be defined lazy as well as (partially) strict in any of its arguments; |+|
|−|* Clean is a strongly typed language based on an extension of the well-known Milner / Hindley / Mycroft type inferencing/checking scheme (Milner 1978; Hindley 1969; Mycroft 1984) including the common higher order types, polymorphic types, abstract types, algebraic types, synonym types and existentially quantified types; |+|
* classes and type constructor classes to make overloaded use of functions and operators possible
|−|Due to the strong typing of Clean and the obligation to initialize all objects being created run- time errors can only occur in a very limited number of cases: when partial functions are called with arguments out of their domain (e. g. dividing by zero), when arrays are accessed with indices out-of-range and when not enough memory (either heap or stack space) is assigned to a Clean application; |+|
Type classes and type constructor classes are provided to make overloaded use of functions and operators possible ; |+|
* uniqueness system , a refined control over the singlethreaded use of objects can influence the time and space behavior of programscan be used to incorporate destructive updates of objects within a pure functional frameworkallows destructive transformation of state information enables efficient interfacing to the world (to C but also to I/O systems like X-Windows) offering direct access to file systems and operating systems
|−|* Clean offers the following predefined types: integers, reals, Booleans, characters, strings, lists, tuples, records, (destructively updateable) arrays and files; |+|
|−|* Clean has pattern matching, guards, list comprehensions and array comprehensions and a lay-out sensitive mode; |+|
* Clean and and
|−|* One can define functions on a local level using where blocks, let expressions (even before a guard) and strict let expressions; |+|
Clean's key feature is a polymorphic uniqueness type inferencing system, a special extension of the Milner / Hindley / Mycroft type inferencing/checking system allowing a refined control over the single threaded use of objects ; with this uniqueness type system one can influence the time and space behavior of programs ; it can be used to incorporate destructive updates of objects within a pure functional framework , it allows destructive transformation of state information , it enables efficient interfacing to the non-functional world (to C but also to I/O systems like X-Windows) offering direct access to file systems and operating systems ; |+|
* Clean a and , and can be and
is a modular language allowing separate compilation of modules; one defines implementation modules and definition modules; there is a facility to implicitly and explicitly import definitions from other modules; |+|
offers a sophisticated I/O library with which window based interactive applications (and the handling of menus, dialogues, windows, mouse, keyboard, timers and events raised by sub-applications) can be specified compactly and elegantly on a very high level of abstraction; |+|
a -in .
|−|GUI- based programs written in Clean using the 0.8 I/O library can be ported without modification of source code to anyone of the many platforms we support. |+|
* There are many [[
official libraries|libraries]] available offering additional functionality. |+|
* There are many [[libraries]] available offering additional functionality.
Clean is a general purpose, state-of-the-art, pure and lazy functional
programming language designed for making real-world applications.
Here is a list of the most notable language features: