News for hackers. Stuff that matters.
Re:Pixie – A small, fast, native Lisp by inconclusive on Tuesday January 17, 2017 @07:34PM (#13422966)
How is the cost of copying close to zero or not apparent?
Re:Pixie – A small, fast, native Lisp by rads on Wednesday January 18, 2017 @01:17AM (#13424455)
The data structures in Clojure are built on shallow 32-way trees. When you "change" a map or a vector, the algorithm only copies from the root node down to the parent of the leaf you're changing. That's log32(N) copied nodes in a tree of N nodes total.
Re:Pixie – A small, fast, native Lisp by macmac on Tuesday January 17, 2017 @08:38PM (#13423301)
Because persistent data structures that use structural sharing.
Re:Pixie – A small, fast, native Lisp by DannyB2 on Wednesday January 18, 2017 @04:17PM (#13430370)
Good answers by others. The cost it not quite zero, but very close. The benefits this buys are huge. The obvious case is recursive search algorithms.