Live data from Hacker News

The Clean Language

clean.cs.ru.nl

41–48 of 48 posts

Re: The Clean Language

#41
post #9
post #7

With unique types and offering an alternative to monadic approach to pure functional programming, I always had an eye out for this language. I always found its syntax rather clean (no pun intended). Sadly there hasn't be much activity. or at least not much that could be discerned from its public facing website. I would love to see a revival in interest and development.

I'd love to learn some about the "alternative to monadic approach to pure functional programming" but the project's website is utterly useless in helping me to find it.

Clean has used uniqueness types since the 80s. Monadic effects were only discovered/implemented in the 90s. In fact, Haskell 1.0 didn't have monadic I/O either; AFAIK it implemented I/O using a "stream of actions", but that doesn't compose very well (e.g. we can get deadlocked if an earlier action depends on the result of a later action)

Uniqueness types are similar to to linear types (as found in Idris, ATS, and recently Haskell), and similar to Rust's 'ownership' model ("affine types"?)

Re: The Clean Language

#43
post #10

Earlier quoted context omitted.

I'd love to see an example of this (the wikipedia page is not very clear to me). Is there a Clean or Idris program somewhere I can have a look at?

Mercury has them too: https://www.mercurylang.org/information/doc-latest/mercury_r... useful for things like file descriptors. The type system will, for example prevent sharing of your file descriptors between threads.

I consider Unique as user-defined affine types— half of what makes up a linear type.

Clean and Mercury are both mentioned in: https://en.m.wikipedia.org/wiki/Substructural_type_system

Re: The Clean Language

#44
post #3

Having never heard of this, I found the FAQ page an informative starting point. https://clean.cs.ru.nl/FAQ In simplistic terms, Clean seems to be a “better Haskell”. Edit: I just downloaded the bundle tar, looked at some sources and found out that vim has syntax coloring for Clean out of the box. Vim never ceases to amaze me. More Edit: Clean transpiles to C, which means that when you look at generated code, or just…

> In simplistic terms, Clean seems to be a “better Haskell”. Actually Haskell is a better (or at least, standardised) Clean. There was a lot of interest in lazy functional programming in the 1980s, but everyone made their own mutually-incompatible systems (e.g. Clean, Miranda, and I heard that even Scheme was debating laziness at one point). Eventually a committee came together to standardise on a single language (wh…

An important point was to be non-proprietary, wasn't it? Clean and Miranda were proprietary, although the implementations are now available with permissive licences.

Edit: I don't know about Scheme debating laziness as such, but there's Friedman and Wise https://help.luddy.indiana.edu/techreports/TRNNN.cgi?trnum=T... and there was Lispkit Lisp, as in Hoare's CSP book.

Re: The Clean Language

#45
post #31
post #8

Earlier quoted context omitted.

It's a pity this info is so hard to find. I had to click for a minute to find some example code, and thought: this is very much like Haskell. I wonder how it's better than Haskell, why not Idris/Coq/Adga, and why not contribute to any of the just mentioned projects. This info, combined with some code and a description of the target audience of the project would be very helpful indeed.

> I wonder how it's better than Haskell I don't think anybody claims it's better than Haskell. It predates it, for one. The Clean programming language is its own thing, with its own philosophy, uniqueness types, etc. Don't be mislead by the usual online flamebait trying to turn everything into "X is better than Y". This is usually claimed by people with little experience in either X or Y.

Also, Clean is listed as a particular influence in the Haskell Report.

Re: The Clean Language

#46
post #3

Having never heard of this, I found the FAQ page an informative starting point. https://clean.cs.ru.nl/FAQ In simplistic terms, Clean seems to be a “better Haskell”. Edit: I just downloaded the bundle tar, looked at some sources and found out that vim has syntax coloring for Clean out of the box. Vim never ceases to amaze me. More Edit: Clean transpiles to C, which means that when you look at generated code, or just…

As I tried both Clean and Haskell, for me Clean is "worse Haskell".

As one example, Clean did not support non-latin1 alphabets in the UI library and my attempt to somehow correct the situation was in vain, the next release of the language did contain the same error. In contrast, when I discovered non-linear (at least quadratic) behavior in relatively fringe case of type checking algorithm in ghc, it was corrected quite quickly.

As per language themselves, Clean purported to have uniqueness types which should make programming better and easier and Clean developers came with special syntax to reuse same names during processing unique-typed values. Which is essentially a Haskell's do notation in disguise, except it cannot be used for different purposes, like non-deterministic List monad. At about 2008 or slightly earlier, type system of Haskell became powerful enough to erase bindings from environments (famous HList by Oleg Kiselyov), allowing one to express many things, including linear and unique types (example [1] - if state's parameters can change number of bindings, we can check for bindings' erasure, expressing linear (all bindings are erased, except ones returned) and unique (some bindings can be left) types).

[1] http://blog.sigfpe.com/2009/02/beyond-monads.html

I keep saying what is language feature in regular programming languages is a library in Haskell. Clean is no exception.

Re: The Clean Language

#47
post #46
post #3

Having never heard of this, I found the FAQ page an informative starting point. https://clean.cs.ru.nl/FAQ In simplistic terms, Clean seems to be a “better Haskell”. Edit: I just downloaded the bundle tar, looked at some sources and found out that vim has syntax coloring for Clean out of the box. Vim never ceases to amaze me. More Edit: Clean transpiles to C, which means that when you look at generated code, or just…

As I tried both Clean and Haskell, for me Clean is "worse Haskell". As one example, Clean did not support non-latin1 alphabets in the UI library and my attempt to somehow correct the situation was in vain, the next release of the language did contain the same error. In contrast, when I discovered non-linear (at least quadratic) behavior in relatively fringe case of type checking algorithm in ghc, it was corrected qui…

You can't compare fixing some quadratic time behavior in one place (the type checker) to something that sounds like could be a major piece of work: multilingual character support in UI. If it only goes to ISO latin, it's probably using 8 bit strings, and assuming that bytes and characters are 1:1.

Also, the average Haskell developer practically exists for the purpose of fixing quadratic behaviors in type checkers; you file that bug at 3 a.m. on December 25, and by 8 you have a shiny fix under the tree.

Re: The Clean Language

#48
post #46

Earlier quoted context omitted.

As I tried both Clean and Haskell, for me Clean is "worse Haskell". As one example, Clean did not support non-latin1 alphabets in the UI library and my attempt to somehow correct the situation was in vain, the next release of the language did contain the same error. In contrast, when I discovered non-linear (at least quadratic) behavior in relatively fringe case of type checking algorithm in ghc, it was corrected qui…

You can't compare fixing some quadratic time behavior in one place (the type checker) to something that sounds like could be a major piece of work: multilingual character support in UI. If it only goes to ISO latin, it's probably using 8 bit strings, and assuming that bytes and characters are 1:1. Also, the average Haskell developer practically exists for the purpose of fixing quadratic behaviors in type checkers; yo…

Here it is: https://mailman.science.ru.nl/pipermail/clean-list/2002/0021...

The code I've asked contains two calls instead of one, aside of that it was quite simple and would allow at least Russian users of Clean to have proper dialog titles.

I guess it is nothing like "major piece of work". It was a fix for peculiarities of Windows UI of that era - dialog titles required different approach than dialog fields.

Post reply on HN