12 ms·
The Clean Language
- srean 5y agoWith 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.
- cies 5y agoI'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.
- jonsen 5y agoI remember a rather comprehensive online pdf manual/book back in '99 when I went Clean for a period.
- gonoid 5y agoThe documentation [1] has a bit of information about using uniqueness types for IO and other cases. [1] https://clean.cs.ru.nl/download/html_report/CleanRep.2.2_11.htm#_Uniqueness_Typing https://clean.cs.ru.nl/download/html_report/CleanRep.2.2_11....
- chriswarbo 5y agoClean 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"?)
- wakeupcall 5y agoIf I'm not mistaken, wasn't Clean closed source and commercial for a long time? I was very interested years ago, but I kept on thinking that without opening up it would eventually just fade into oblivion and never went beyond the toying phase. A common fate for the many languages with a single and commercial reference compiler/interpreter.
- srean 5y agoI seem to recall the same (of it being closed source initially)
- fbn79 5y agoI never heard of Uniqueness type (https://en.wikipedia.org/wiki/Uniqueness_type https://en.wikipedia.org/wiki/Uniqueness_type). Anyone can simply explain pro/contro of this versus monads?
- tempodox 5y agoThe IO monad (in Haskell) will always be the same, no matter how much I/O you perform. A unique File type, for instance, will be different before and after I/O, reflecting that side effects are not idempotent. In other words, a change in mutable state is reflected in a change of type.
- cies 5y agoI'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?
- cjfd 5y agoI studied clean a very long time ago, maybe 20 years, so I have no idea any more what the code looks like, but I can attempt to tell you the basic idea of this. There are objects that you cannot copy and also not use in multiple places as a function argument. E.g., if something is a file it is subject to these restrictions and functions that write to the file would accept the file as an argument and return a new object of type file that stands for the modified version of the file. This forces an explicit sequencing of side effects. This prevents the old version of the file still being usable in the code.
- toolslive 5y agoMercury has them too: https://www.mercurylang.org/information/doc-latest/mercury_ref/Unique-modes.html 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.
- deleted 5y ago
- tempodox 5y agoHaving never heard of this, I found the FAQ page an informative starting point. https://clean.cs.ru.nl/FAQ 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 disassemble the resulting binary, you will probably be able to make sense of what you see. When I disassemble a Haskell binary, I can't make heads or tails of it.
- dutchmartin 5y agoCool that you found this. I’m a student at this university and most alumni I’ve spoken say it is only used for research and a masters degree course course [1]. What’s interesting is that the bachelor course on functional programming gets thought in Haskell. [1] https://sis.ru.nl/osiris-student/OnderwijsCatalogusSelect.do?selectie=cursus&cursus=NWI-I00032&collegejaar=2020 https://sis.ru.nl/osiris-student/OnderwijsCatalogusSelect.do...
- Flashtoo 5y agoThe undergraduate course was taught in Clean until a few years ago. Learning functional programming in Clean is a nightmare because it is impossible to find any helpful resources online about the language and the tooling is useless compared to Haskell's.
- cies 5y agoIt'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.
- Xophmeister 5y agoI'd never heard of it, either, but its Wikipedia page[1] says it's been around since 1987, so it's a little bit older than Haskell. [1]: https://en.wikipedia.org/wiki/Clean_(programming_language) https://en.wikipedia.org/wiki/Clean_(programming_language)
- deleted 5y ago[deleted]
- steve_taylor 5y agoFor a language called clean, it has a messy website.
- schleck8 5y agoHow hard is it to include a syntax snippet? Same as with a lot of FOSS software which has a really long essay as explanation but not one screenshot of the GUI
- agumonkey 5y agoSyntax matter few for this language I assume.
- scoopertrooper 5y agoThere's a link to a page full of syntax examples in the first paragraph. https://clean.cs.ru.nl/Quick_impression https://clean.cs.ru.nl/Quick_impression
- deleted 5y ago[deleted]
- rowanG077 5y agoI used clean at school. Honestly it's basically Haskell without any libraries, much, much shittier errors and a bit more arcane syntax. I wouldn't really advise anyone to learn it since Haskell is superior in almost every way.
- felixr 5y agoIIRC I looked at Clean 10+ years ago and it was not BSD licensed; either closed source or some restrictive license. And that made me not invest any time into trying it out. Do I remember this correctly? Does anyone know/remember?
- felixr 5y agoAnswering my own question... From looking at https://gitlab.science.ru.nl/clean-and-itasks/clean-ide/-/commits/master/CleanLicenseConditions.txt https://gitlab.science.ru.nl/clean-and-itasks/clean-ide/-/co... - Clean used to be dual licensed: commercial license + LGPL - 3 years ago LGPL was replaced by Simplified BSD - 7 months ago the commercial license was removed
- carterschonwald 5y agoThanks I was wondering it myself!
- Aachen 5y agoAnd here I thought names couldn't be any more ambiguous than go and (to a slightly lesser extent because I use it less in normal conversation) rust. Here, even if you append lang(uage) I'm still not expecting a programming language when clicking the link.
- ModernMech 5y agoRust isn’t as ambiguous as you would think, but it’s ambiguous in a specific and annoying way: there is a popular game called Rust, and it very often shows up in my search results when I’m coding. For as much as search engines supposedly tailor their results, you’d think they would have figured out by now I never ever want results from that game.
- otabdeveloper4 5y agoSomeone should make a Language language already. (Let it be Microsoft or Google, for bonus points.)
- _vr9d 5y agoMeanwhile the lisp comunity...
- Aachen 5y agoWoa, I never even realized lisp is something other than a programming language actually. Non-native speaker, but still, the walls of my bubble must be thick...
- cryptos 5y agoIt is possibly the cleanest dead language out there! > December 12 2019: Programming Languages in the Netherlands