Live data from Hacker News

Clean – A functional programming language

clean.cs.ru.nl

1–10 of 68 posts

Re: Clean – A functional programming language

#3
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.

Re: Clean – A functional programming language

#4

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.

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?

Re: Clean – A functional programming language

#5
post #4

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.

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?

No change, according to c2wiki[0] it has always been phrased like that.

[0]: http://wiki.c2.com/?CleanLanguage

Re: Clean – A functional programming language

#6

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'…

I don't program in functional environments, however this seems beautiful to me.

I do understand your argument and tend to agree, I would like to see a syntax error if there is anything between the multiple lines of implementation.

Re: Clean – A functional programming language

#7

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.

I don't know if it's changed much, but I remember that several years ago I thought about trying to learn Clean but I gave up because it looked like Linux was a second-class platform and the Clean project mostly focused on a Windows IDE.

Re: Clean – A functional programming language

#8

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'…

I think this is exactly the same as Haskell. As a matter of fact, I had to actually search their Wiki for the first example that was different from Haskell

I think it’s just a matter of familiarity. Once you learn how it works, it’s actually extremely elegant and in no way “disconnected.”

Re: Clean – A functional programming language

#9

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'…

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.

Post reply on HN