News for hackers. Stuff that matters.
Re:Ask HN: Immutable data structures for the back end? by bbcbasic on Sunday June 26, 2016 @06:30AM (#11980180)
Well it is trite to say it but Haskell has many examples of servers and idiomatic haskell will almost always use immutable data. Examples are web frameworks like Yesod and web servers like Warp.

I'm working on a toy stock exchange app to learn haskell and of course it will be mostly immutable. It will use some shared global state. This will have mutable reference using mvars or transactional memory but the "objects" themselves will be immutable.

Communicating between threads makes total immutability hard (maybe impossible?) unless you have a very clever threading model.

Re:Ask HN: Immutable data structures for the back end? by arms on Sunday June 26, 2016 @09:05AM (#11980593)
Sure they can. You can use server side languages like Clojure, Erlang, Elixir, F# and a few others I'm sure I'm missing.

There also exist libraries for some languages that introduce immutable data structures, like pysistance for Python.

Re:Ask HN: Immutable data structures for the back end? by hakanderyal on Sunday June 26, 2016 @04:04AM (#11979852)
You can check out Datomic[0], a database built on immutability, championed by Rick Hickey of Clojure.

[0]: http://www.datomic.com/

Re:Ask HN: Immutable data structures for the back end? by gary__ on Sunday June 26, 2016 @04:58PM (#11982688)
See the event sourcing pattern for an example of immutability at the backend.

http://martinfowler.com/eaaDev/EventSourcing.html

https://msdn.microsoft.com/en-us/library/dn589792.aspx

Re:Ask HN: Immutable data structures for the back end? by _RPM on Monday June 27, 2016 @04:11PM (#11989093)
Did you just learn about the concept of Immutable? It's a very simple concept, it seems to be the buzzword lately, especially with JavaScript libraries.
Re:Ask HN: Immutable data structures for the back end? by uptownhr on Sunday June 26, 2016 @02:37AM (#11979653)
Are there any examples of this being done?
Re:Ask HN: Immutable data structures for the back end? by galistoca on Sunday June 26, 2016 @03:42AM (#11979816)
What do you think would be the benefit?