Live data from Hacker News

Clean – A functional programming language

clean.cs.ru.nl

21–30 of 68 posts

Re: Clean – A functional programming language

#21

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

Also, aren't the types incorrect? Glancing over their docs, Int represents a signed integer. A negative input shouldn't be allowed, nor can you guarantee that your output fits in an int. Now I'm slightly curious as to how they handle overflows. Maybe they do runtime checks?

Conflating of data types with storage types is a surprisingly common occurrence, although I can appreciate it's largely due to pragmatism.

Re: Clean – A functional programming language

#22

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.

It took ages for Haskell to become "popular". My personal impression is that OCaml was more popular in the past and lost ground in recent years. OCaml's story demonstrates though how difficult it is to turn an academic research language into a widely accepted tool that is (financially) supported by the industry.

Clean had a performant compiler when Haskell was mostly interpreted and slow. Why didn't it take off? Maybe it wasn't the main goal of its developers once the publications were done.

Re: Clean – A functional programming language

#23

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

Just implemented a List in OOP, just to proof a (different) point.

Everything is way more "disconnected" in OOP. For example I have to implement length in both the classes EmptyElement (0) and Element (1+next->length()). Both belong together, but they are scattered across the source code. With clean like syntax i would have written them right next to each other.

Re: Clean – A functional programming language

#24
post #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 zer…

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)

Re: Clean – A functional programming language

#25
post #9

Earlier quoted context omitted.

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

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)

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

Re: Clean – A functional programming language

#26

Earlier quoted context omitted.

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)

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

Yes, we are talking about syntax.

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

Re: Clean – A functional programming language

#28

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

Anyone who hasn't tried a whitespace-significant language in anger is missing out.

I had started with F# and was put off by it like you described. I moved to Haskell and had difficulty understanding it yet again, but when I moved back to F# one more time it was a delight.

Re: Clean – A functional programming language

#29
post #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.

Can anybody comment on this?

Re: Clean – A functional programming language

#30

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

Anyone who hasn't tried a whitespace-significant language in anger is missing out. I had started with F# and was put off by it like you described. I moved to Haskell and had difficulty understanding it yet again, but when I moved back to F# one more time it was a delight.

I LOVE python, it is the weapon I first take to any battle and the language I recommend to beginners. But, I have to admit that the fact that it is so easy to lose track of which "if" a nested "else" belongs to when modifying code, and, I've seen this being the source of so many bugs, that it has changed my opinion about whitespace-significant languages.

Also, I've come to appreciate when I write in say Rust, the fact that I can let go of the syntax, just write and focus on my ideas and let my editor sort the mess at the end.

Post reply on HN