Difference between revisions of "FAQ"

From Clean
Jump to navigationJump to search
(Updated benchmark links)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== 1.  What is the purpose of Clean? ==
 
== 1.  What is the purpose of Clean? ==
  
The purpose of Clean is to serve as a fast, non-strict, purely functional programming language that is easy to optimize.  Clean is characterized by lazy evaluation, which means that only arguments that need to be evaluated in a function call are actually evaluated.  In addition, Clean functions can be written to use (partially) strict evaluation when necessary.  Unlike R6RS Scheme and similar to Haskell, Clean offers pattern-matching, guards, array comprehensions, and a Hindley-Milner style type inferencing scheme .  Unlike Haskell, Clean offers list comprehensions.  For I/O-related functions, in contrast to Haskell's monads, Clean offers a uniqueness type inferencing system, which allows destructive transformation of state information within a purely functional framework.  Clean is useful for writing relatively bug-free programs in fewer lines of code, and for formally proving properties of those programs, thereby often eliminating the need for debugging.
+
The purpose of Clean is to serve as a fast, non-strict, purely functional programming language that is easy to optimize.  Clean is characterized by lazy evaluation, which means that only arguments that need to be evaluated in a function call are actually evaluated.  In addition, Clean functions can be written to use (partially) strict evaluation when necessary.  Unlike R6RS Scheme and similar to Haskell, Clean offers pattern-matching, guards, array comprehensions, and a Hindley-Milner style type inferencing scheme .  For I/O-related functions, in contrast to Haskell's monads, Clean offers a uniqueness type inferencing system, which allows destructive transformation of state information within a purely functional framework.  Clean is useful for writing relatively bug-free programs in fewer lines of code, and for formally proving properties of those programs, thereby often eliminating the need for debugging.
  
 
== 2.  What are the advantages of Clean? ==
 
== 2.  What are the advantages of Clean? ==
 
Clean has the following advantages over similar functional programming languages:
 
Clean has the following advantages over similar functional programming languages:
*'''Efficient running-time of compiled code:'''  Clean is one of the fastest functional programming languages.  For many applications, Clean is appreciably faster than Haskell, and at least on par with OCaml.  According to a [http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=clean&lang2=ghc Gentoo benchmark], the current Clean entry runs the [http://shootout.alioth.debian.org/gp4/benchmark.php?test=meteor&lang=all meteor-contest] benchmark 2.6 times faster than the corresponding Haskell GHC entry.
+
*'''Efficient running-time of compiled code:'''  Clean is one of the fastest functional programming languages.  For many applications, Clean is appreciably faster than Haskell, and at least on par with OCaml.
 
**For benchmarks, see the following:
 
**For benchmarks, see the following:
***[http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=clean&lang2=ghc Clean benchmarks | Gentoo : Intel® Pentium® 4 Computer Language Benchmarks Game (vs. Haskell GHC)]
+
*** http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=clean&lang2=ghc
***[http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=clean&lang2=ocaml Clean benchmarks | Gentoo : Intel® Pentium® 4 Computer Language Benchmarks Game (vs. OCaml)]
+
*** http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=clean&lang2=ghc
 
*'''Easy optimization of code:'''  According to at least [http://www.algorithm.com.au/blog/files/36ca9a664954e680edb64d260d763252-350.php one user] on [http://www.algorithm.com.au/blog/files/category-2026on-coding.php Stay Hungry, Stay Foolish - Blog], Clean code can be easier to optimize than Haskell code.  Also, according to [http://www.google.com/gwt/n?u=http%3A%2F%2Fwww.nabble.com%2FRe%253A-Re%253A-Why-can%2527t-Haskell-be-faster--p13510257.html one user] on [http://www.google.com/gwt/n?u=http%3A%2F%2Fwww.nabble.com%2FWhy-can%2527t-Haskell-be-faster--td13505750.html&_gwt_pg=1 Nabble - Haskell - Haskell-Cafe - Why can't Haskell be faster?], "[T]he Clean type system gives more information to the compiler than the Haskell system does. The Haskell type system doesn't say that a certain value can be updated in-place or that a certain value should not be boxed (not counting the GHC extension for unboxed types)." (quote by Reinier).  In addition, according to [http://www.google.com/gwt/n?u=http%3A%2F%2Fwww.nabble.com%2FRe%253A-Re%253A-Why-can%2527t-Haskell-be-faster--p13510295.html another user] there, "[C]lean's uniqueness types allow for a certain kind of zero-copy mutation optimisation which is much harder for a haskell compiler to automatically infer." (quote by Jules).
 
*'''Easy optimization of code:'''  According to at least [http://www.algorithm.com.au/blog/files/36ca9a664954e680edb64d260d763252-350.php one user] on [http://www.algorithm.com.au/blog/files/category-2026on-coding.php Stay Hungry, Stay Foolish - Blog], Clean code can be easier to optimize than Haskell code.  Also, according to [http://www.google.com/gwt/n?u=http%3A%2F%2Fwww.nabble.com%2FRe%253A-Re%253A-Why-can%2527t-Haskell-be-faster--p13510257.html one user] on [http://www.google.com/gwt/n?u=http%3A%2F%2Fwww.nabble.com%2FWhy-can%2527t-Haskell-be-faster--td13505750.html&_gwt_pg=1 Nabble - Haskell - Haskell-Cafe - Why can't Haskell be faster?], "[T]he Clean type system gives more information to the compiler than the Haskell system does. The Haskell type system doesn't say that a certain value can be updated in-place or that a certain value should not be boxed (not counting the GHC extension for unboxed types)." (quote by Reinier).  In addition, according to [http://www.google.com/gwt/n?u=http%3A%2F%2Fwww.nabble.com%2FRe%253A-Re%253A-Why-can%2527t-Haskell-be-faster--p13510295.html another user] there, "[C]lean's uniqueness types allow for a certain kind of zero-copy mutation optimisation which is much harder for a haskell compiler to automatically infer." (quote by Jules).
 
**For discussions on how Clean optimizes its code vs. Haskell, see the following:
 
**For discussions on how Clean optimizes its code vs. Haskell, see the following:
 
***[http://www.algorithm.com.au/blog/files/36ca9a664954e680edb64d260d763252-350.php Stay Hungry, Stay Foolish - Haskell's Performance | …on Coding | Algorithm.com.au]
 
***[http://www.algorithm.com.au/blog/files/36ca9a664954e680edb64d260d763252-350.php Stay Hungry, Stay Foolish - Haskell's Performance | …on Coding | Algorithm.com.au]
 
***[http://www.google.com/gwt/n?u=http%3A%2F%2Fwww.nabble.com%2FWhy-can%2527t-Haskell-be-faster--td13505750.html Nabble - Haskell - Haskell-Cafe - Why can't Haskell be faster?]
 
***[http://www.google.com/gwt/n?u=http%3A%2F%2Fwww.nabble.com%2FWhy-can%2527t-Haskell-be-faster--td13505750.html Nabble - Haskell - Haskell-Cafe - Why can't Haskell be faster?]
 +
 +
== 3.  Why do some users call the language "Concurrent Clean?" ==
 +
 +
According to [http://en.wikibooks.org/wiki/Concurrent_Clean Concurrent Clean - Wikibooks, collection of open-content textbooks], "'Concurrent' refers to Clean's ability to run the same process on several computers, similar to Ada."
 +
 +
Further, according to [http://osdir.com/ml/lang.clean/2006-03/msg00030.html History of "Clean Functional Language.": msg#00030],
 +
 +
:We started the work on Clean in 1984, as part of the Parallel Reduction Machine project. In the beginning, Clean was meant as an intermediate language. The first version was defined and running in 1987. Hereafter Clean was turned into a fully featured functional programming language. Special features are its Graph Rewriting Semantics (1987, Barendregt, Plasmeijer, Van Eekelen) which is still the core semantics of Clean, Eric Nockers strictness analyser (1994, very recently completely formally proven to be correct), the uniqueness typing (Smetsers, Barendsen, Plasmeijer), the object I/O library (Peter Achten), the concurrent implementation (Marco Kesseler), and, of course the very good code generation (John van Groningen). There is much more, you can find a list of publications [[Publications|here]].
 +
 +
:We had a lot of influence on Haskell (which started in 1987) and later also Haskell influenced Clean.
 +
 +
The original version of Clean was also known as "CLEAN 0.8" (see "Release History," by the Software Technology Research Group, at http://clean.cs.ru.nl/Recent_Latest_News/body_recent_latest_news.html).  The name "Concurrent Clean" is actually a synonym for "CLEAN 1.0," which was the first version when Clean changed from an intermediate language for graph reduction to a fully-fledged general-purpose functional programming language (see "Release History" above).
 +
 +
Another reason is that the word "Clean," being a generic adjective, by itself, usually generates too many false positives in a search on the Internet.  Users in other countries who do not speak English and who only know how to search by name would have a hard time in finding Clean if that were its only name.  "Concurrent Clean," however, is much easier to find as a name on the Internet, and can be used even by users in other countries who do not speak English.

Latest revision as of 13:03, 18 April 2011

1. What is the purpose of Clean?

The purpose of Clean is to serve as a fast, non-strict, purely functional programming language that is easy to optimize. Clean is characterized by lazy evaluation, which means that only arguments that need to be evaluated in a function call are actually evaluated. In addition, Clean functions can be written to use (partially) strict evaluation when necessary. Unlike R6RS Scheme and similar to Haskell, Clean offers pattern-matching, guards, array comprehensions, and a Hindley-Milner style type inferencing scheme . For I/O-related functions, in contrast to Haskell's monads, Clean offers a uniqueness type inferencing system, which allows destructive transformation of state information within a purely functional framework. Clean is useful for writing relatively bug-free programs in fewer lines of code, and for formally proving properties of those programs, thereby often eliminating the need for debugging.

2. What are the advantages of Clean?

Clean has the following advantages over similar functional programming languages:

3. Why do some users call the language "Concurrent Clean?"

According to Concurrent Clean - Wikibooks, collection of open-content textbooks, "'Concurrent' refers to Clean's ability to run the same process on several computers, similar to Ada."

Further, according to History of "Clean Functional Language.": msg#00030,

We started the work on Clean in 1984, as part of the Parallel Reduction Machine project. In the beginning, Clean was meant as an intermediate language. The first version was defined and running in 1987. Hereafter Clean was turned into a fully featured functional programming language. Special features are its Graph Rewriting Semantics (1987, Barendregt, Plasmeijer, Van Eekelen) which is still the core semantics of Clean, Eric Nockers strictness analyser (1994, very recently completely formally proven to be correct), the uniqueness typing (Smetsers, Barendsen, Plasmeijer), the object I/O library (Peter Achten), the concurrent implementation (Marco Kesseler), and, of course the very good code generation (John van Groningen). There is much more, you can find a list of publications here.
We had a lot of influence on Haskell (which started in 1987) and later also Haskell influenced Clean.

The original version of Clean was also known as "CLEAN 0.8" (see "Release History," by the Software Technology Research Group, at http://clean.cs.ru.nl/Recent_Latest_News/body_recent_latest_news.html). The name "Concurrent Clean" is actually a synonym for "CLEAN 1.0," which was the first version when Clean changed from an intermediate language for graph reduction to a fully-fledged general-purpose functional programming language (see "Release History" above).

Another reason is that the word "Clean," being a generic adjective, by itself, usually generates too many false positives in a search on the Internet. Users in other countries who do not speak English and who only know how to search by name would have a hard time in finding Clean if that were its only name. "Concurrent Clean," however, is much easier to find as a name on the Internet, and can be used even by users in other countries who do not speak English.