
Clean – A functional programming language - EvergreenTree
http://clean.cs.ru.nl/Clean
======
johnbender
It's kind of a bummer to me that the one of the top comments here is about the
syntax.

I get that people have syntax preferences and that there's a certain level of
"sniff" test that goes along with these things, but as a fan of programming
languages I am always interested in the semantics. That is, I'm interested in
what's different about this language and its combination of features and
goals:

[http://clean.cs.ru.nl/Language_features](http://clean.cs.ru.nl/Language_features)

> The uniqueness typing system of Clean makes it possible to develop efficient
> applications. In particular, it allows a refined control over the single-
> threaded use of objects which can influence the time and space behavior of
> programs. Uniqueness typing can also be used to incorporate destructive
> updates of objects within a pure functional framework. It allows destructive
> transformation of state information and enables efficient interfacing to the
> nonfunctional world (to C but also to I/O systems like X-Windows) offering
> direct access to file systems and operating systems.

When I read that I think, "Wow! That seems really neat and reminds me of
linear types, and I should check this out". Maybe that's just me though.

It's also worth noting that the features page does not mention the word
syntax. That's not a deep insight or strong evidence for anything really but
it suggests that the designer was interested in the semantics too and that the
syntax was a secondary concern.

~~~
joe_the_user
_" It's kind of a bummer to me that the one of the top comments here is about
the syntax.

"I get that people have syntax preferences and that there's a certain level of
"sniff" test that goes along with these things, but as a fan of programming
languages I am always interested in the semantics."_

Well, as the syntax commenter, perhaps I'm a bit defensive but I feel like
syntax is inherently an important part of what makes a language appealing -
features aren't enough. To take it further, I'm pretty sure if you only
absolutely only wanted features for manipulating things, you could find those
features in some C++ or Java library. Just the Boost library is vast beyond my
ability to encompass it but I'd prefer not to be manipulating hundred-line
spews of angle-brackets and stuff.

And I, too, like programming language and I feel what makes a language as such
cool/useful/etc is that you express a computer's action in a compact, elegant
and clear fashion for one's fellow human beings. I remember Steve McConnell
said something like "the compiler only has to read source code once but your
fellow programmers will need to read it thousands of times".

 _...it suggests that the designer was interested in the semantics too and
that the syntax was a secondary concern_

Well, the problem is semantics is part of the user experience regardless of
the developers intent. If anything, whenever X is important but X is not a
concern of the developers, the chances of X biting you go up, not down.

~~~
johnbender
I agree with most of what you say, and I'm sorry I should have been clear that
I don't think your comment is without merit. In truth, I am reacting more to
the general direction I see in PL discussion on HN (which is what I should
have said but was too lazy to find other examples).

> To take it further, I'm pretty sure if you only absolutely only wanted
> features for manipulating things

I feel like lisp fits this bill to some degree. Being the AST itself it is
"without syntax" to some degree. I wonder if you dislike Lisps? I can't really
tell you what this means with regards to our discussion I'm just curious.

> And I, too, like programming language and I feel what makes a language as
> such cool/useful/etc is that you express a computer's action in a compact,
> elegant and clear fashion for one's fellow human beings.

Definitely! I would never suggest that we should entirely ignore how the
syntax affects our ability to read the code but, to borrow the lisp example
again, I don't care about typing lots of parenthesis if I'm otherwise
effective.

Again, your earlier comment is not unfounded and I appreciate where you are
coming from.

~~~
joe_the_user
Thanks for the generous reply,

I'll admit my professional work has been limited to C++, python, Ruby, PL/SQL,
Matlab and small DSLs. I've played lisp and the-fp-languages in college. Lisp
and the-fp-language both seemed to at least have clean, simple syntax rules.

I started using Ruby both it was hip and because it's free form syntax was
really fun. If there were languages I definitely to learn, I would be less
critical about syntax and style.

My original comment on Clean's syntax wasn't intended as a full judgment on
the language but simply a reaction, a reaction I shared because it seems like
subjective impressions of syntax matter for the reasons I mention above.

------
joe_the_user
The thing about syntax like this

    
    
        fac :: Int -> Int 
        fac 0 = 1
        fac n = n * fac (n-1)
    

to me, is that all the statements of this function declaration seem
"disconnected". I'm guessing the "fac" connects them but it seems less clear
than open-closed brackets in a c-like language (and also more cluttered).
Especially, I'm not sure what tells me I've reached the end of the function
declaration. This may seem trivial but it's always put my off this variety of
functional language.

~~~
ggm
I have struggled with FP for many years. What I try and do, is approach these
concepts with an open mind and I look for ways of 'saying' what I see which I
then rehearse with my FP friends and stick to the one which does not make them
wince when I say it.

So this says three true things we know about this 'fac'

Firstly it says it takes an int and it returns an int.

Secondly that if the int it takes is specifically zero then the int it returns
is specifically one.

Thirdly and lastly, for all other ints it returns that int, times (in the
arithmetic sense) a recursive call to itself of the int one less.

I worry about why it doesn't have to say abs(n) but then I remember two
negatives multiplied together are positive.

~~~
always_good
Might be cool to just overload in the function body instead of at the top
level:

    
    
        fac :: Int -> Int 
          (0) => 1
          (n) => n * fac (n-1)

~~~
thepratt
What you're describing is the exact same, just different syntax.

~~~
always_good
Yes, we are talking about syntax.

OP's first four words: "The thing about syntax".

~~~
thepratt
No, the comment replied to has the first four words "Might be cool to". The
differences are so minuscule that the argument could be made for it to be 2
differing standards for the same language.

~~~
always_good
I don't understand your point, much less why you're using the "first four
words" thing back at me on my own comment.

The differences may be miniscule. They are syntactic. "Might be cool to" have
this other syntax. You're just belaboring the obvious.

------
emmelaich
You wonder why Clean isn't as popular as Haskell and Ocaml.

I've read it's the lack of community. The name doesn't help either.

~~~
rixed
The only reason why clean has always been confidential is this:

"Developers wishing to distribute commercial applications (either publicly or
privately) can purchase a commercial license."

Although there seams to be a dual license now? Can anybody with more
understanding of legal verbiage confirm that if I choose to use the bsd+lgpl
then the above restriction don't hold anymore?

~~~
pmontra
According to the wiki linked into the other answer

> The company is not claiming that you can't sell your programs. The licensing
> only matters when it comes to modifying the compiler itself.

which it makes sense. The language runtime is LGPL but the program you write
is anything you want.

At
[http://clean.cs.ru.nl/download/Clean24/CleanLicenseCondition...](http://clean.cs.ru.nl/download/Clean24/CleanLicenseConditions.txt)

> Clean is available under a dual license. Users can choose which of these two
> licenses they wish to operate under:

> 1 The Simplified BSD License (see below) applies to the libraries, runtime
> system and examples, the LGPL the standard GNU Lesser General Open Source
> license (see below) to the rest. The libraries, runtime system and examples
> consist of the files in the following directories (including subdirectories
> of these directories):

> \- Libraries and Examples (versions for Windows)

> \- StdEnv, data and examples (versions for Linux and Mac OS X)

> \- libraries, RuntimeSystem and CleanExamples (source code).

> 2 A commercial license (see below) that can be purchased. Information on
> that license can be obtained from [check the original document for name and
> email]

So, it should be ok as using any LGPL library on any proprietary program. I
wonder if they are making any money from the commercial license or this
confusion is only harming the language.

------
ggm
Should it have been called Kleene? Is this like Dennis Ritchie and creat() ?

~~~
frou_dh
The great man Ken Thompson gets short-changed by the mindshare of "K&R"

------
cbcoutinho
For anyone in the Netherlands: There is a functional programming day being
hosted by the Dutch Tax Authority on Jan 5th, and today is the last day to
sign up! Check out the original link to see more details

------
sparaker
For a language that is named "clean", the documentation page is utterly
unclean and cluttered.

~~~
bsimpson
If you're going to be introducing a programming language, you should have an
example function on the home page.

