News for hackers. Stuff that matters.
Re:Interview with Simon Peyton-Jones by macintux on Friday April 20, 2018 @02:11AM (#16882514)
As fond as I am of Erlang, I still find it hard to picture an immutable OO language.
Re:Interview with Simon Peyton-Jones by kbp on Friday April 20, 2018 @05:43PM (#16888668)
> I still find it hard to picture an immutable OO language.

Picture an object-oriented procedural language like Java, and then make everything immutable; for every 'void' method, return an updated copy of 'this'; for every non-void function, return a tuple of the updated copy and the value you were going to return. No change to const methods, obviously. And you're done, and you can still take advantage of encapsulation, polymorphism, and inheritance without any hoops. You can even do it in Java itself as a style thing without too much effort and only a modest amount of boilerplate. Alternatively, it's not that much work to build this same thing out of lambdas and dictionaries, if your language has those but not objects (adding mutation into that object system would then be trivial) (and of course, you can build dictionaries out of lambdas and lambdas out of objects, if need be).

Re:Interview with Simon Peyton-Jones by mgummelt on Friday April 20, 2018 @01:29PM (#16886714)
Write in scala using only "vals" and there you have it!
Re:Interview with Simon Peyton-Jones by lgas on Saturday April 21, 2018 @12:19AM (#16889960)
Not quite because you can still have a val that points to a mutable object.