Blog post: What D got wrong

Russel Winder russel at winder.org.uk
Tue Dec 18 13:45:57 UTC 2018


On Tue, 2018-12-18 at 12:20 +0000, Kagamin via Digitalmars-d-announce wrote:
> On Tuesday, 18 December 2018 at 10:19:14 UTC, Russel Winder wrote:
> > Clojure is but you have to work hard for that, the initial 
> > language is effectively pure.
> 
> https://ideone.com/y8KWja clearly it isn't, its site only claims 
> that most code happens to be pure, but it looks like it's not 
> checked in any way and not sure if purity can be even checked 
> there.

Can we all agree that Haskell is a pure functional language. I think we must
because: a) it says it is, and b) it is.

   f2 = print "Hello World."
   f1 = f2
   main = do
     f1

result of running this:

   GHCi, version 8.0.1
   >
   "Hello World."
   >

OK so Haskell uses monads and Clojure just uses the JVM I/O. Haskell is pure,
Clojure is impure. But I stand by my original statement: Clojure is best used
as a pure language.

Even if I/O is impure, you can make it pure with monads if you really have to.
 
-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20181218/84505220/attachment.sig>


More information about the Digitalmars-d-announce mailing list