Live data from Hacker News

Clean – A functional programming language

clean.cs.ru.nl

31–40 of 68 posts

Re: Clean – A functional programming language

#31
post #29
post #7

Earlier quoted context omitted.

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?

Their documentation states: "The latest version 2.0 of the IDE is currently only available on the Wintel and MacOS/PowerPC platform. On the other platforms a much more restricted and older version of the IDE is available. "

So it sounds about right to me.

Re: Clean – A functional programming language

#32

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? Mayb…

Languages don't win. Package management and distribution wins. Access and energy required for a viable solution.

Re: Clean – A functional programming language

#33
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)

In Haskell:

    fac :: Int -> Int
    fac x = case x of
      0 -> 1
      n -> n * fac (n-1)
or even

    {-# LANGUAGE LambdaCase #-}

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

Re: Clean – A functional programming language

#34

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.

No, I don't. I actually wonder why it gets mentioned. It is some professor's research project not an actual programming ecosystem. The documentation on the site is more than a decade old, it covers version 2.2 released in 2006. Want documentation on what has been happening since then? Pick up a research paper. By comparison Haskell has a dozen books on Amazon and plenty of newbie level documentation since multiple universities use it as a teaching language.

Re: Clean – A functional programming language

#35

Earlier quoted context omitted.

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

How does Rust make it any easier?

Re: Clean – A functional programming language

#36

Earlier quoted context omitted.

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

How does Rust make it any easier?

All clauses are defined within curly brackets like C so indentation has no meaning and you can let tools take care of that.

Re: Clean – A functional programming language

#37

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.

That's the whole point. Syntax can be very influential in how people use (or don't) a language

Re: Clean – A functional programming language

#38

Earlier quoted context omitted.

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

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

Having types and removing statements from the language make this much less of an issue

> I can let go of the syntax, just write and focus on my ideas and let my editor sort the mess at the end.

Elm has a whitespace significant syntax, but it too has an excellent code formatter tool.

Re: Clean – A functional programming language

#39

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

Especially if the function has a longer name.

Re: Clean – A functional programming language

#40

Earlier quoted context omitted.

How does Rust make it any easier?

All clauses are defined within curly brackets like C so indentation has no meaning and you can let tools take care of that.

Also, with editors like vim, you can press % to go to the matching brace (curly bracket). In fact that works in vi too, right from the early vi days; also, in vim, if you position the cursor on an opening or closing brace, it momentarily highlights the other one (at least if that brace is visible on the screen, can't remember offhand if this works even if not visible).

I still like languages like Python and F# though.

Post reply on HN