Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    J

    Jean Niklas L'orange

    hypirion.com · Personal blog · on HN since 2013

    Jean Niklas L'orange writes technical posts on Clojure internals, persistent data structures, Postgres, and Haskell.

    Visit blogRSSHN submissions
    Languages & CompilersProgrammingSystems & Performance
    What HN says

    HN commenters recommend his multi-part series on Clojure's persistent vectors as the go-to explanation of how persistent data structures work.

    Stats for nerds
    60HN people shared it
    45linked in comments
    829story points
    Jan 2026last shared
    2013people per year2026

    Top posts on HN

    1. 1
      Understanding Clojure's Persistent Vectors, Part 1
      36 people · 233 points · first shared 2013 · 23 comments on HN
    2. 2
      Using Python for Scripting
      2 people · 170 points · first shared 2025 · 107 comments on HN
    3. 3
      Implementing system-versioned tables in Postgres
      3 people · 168 points · first shared 2024 · 92 comments on HN
    4. 4
      A Language Without Conditionals
      1 person · 67 points · first shared 2013 · 43 comments on HN
    5. 5
      Understanding Clojure's Persistent Vectors, Pt. 3
      1 person · 62 points · first shared 2014 · 41 comments on HN
    6. 6
      Persistent Vector Performance, summarised
      1 person · 38 points · first shared 2015 · 3 comments on HN
    7. 7
      Understanding Clojure's Persistent Vectors (Part 2)
      2 people · 20 points · first shared 2013 · Discussion on HN
    8. 8
      Swearjure - Clojure without alphanumerics
      3 people · 15 points · first shared 2013 · 4 comments on HN
    9. 9
      Persistent Vector Performance
      2 people · 14 points · first shared 2015 · Discussion on HN
    10. 10
      A Resilient Git Dependency Algorithm
      2 people · 5 points · first shared 2018 · Discussion on HN

    What HN people wrote when they linked it

    • yjgyhjAug 2015

      Yes, mutating something at one place in memory is more efficient, because you don't need to allocate new memories.

      I don't know all to much about other functional languages, as I learned perl -> ruby -> javascript -> little bit C & Java & Go -> now doing Clojure. But I find Clojures collection data structures interesting. The vector (collection like lists or array) type look immutable, but under the hood are trees. When you append to a vector, you seem get a new vector returned.

      In reality, you added the new element as a node in a tree. Then just modified pointers to that the new and old version share almost all of the pointers & allocations. With simple arrays or lists, you would allocate every element anew.

      Idk if I can properly explain. Found this blog post very interesting and easier to follow: http://hypirion.com/musings/understanding-persistent-vector-pt-1

      Personally, most things in business I find easily parallelisable. You mostly decouple the I/O parts of something with the logic parts of it. But yeah I still have much to learn. Thanks for the link! Interesting :)

    • khgvljhkbDec 2015

      The difference (like the author states) is that JS & family has mutable data by default, while Clojurescript defaults to immutable such. You have to specify that you want your vectors and maps etc to be transient (fancy pants word for mutable).

      You want immutability - think about it: how large % of your bugs are due to more than one procedure changing the value of one variable, and state getting out of sync?

      For me in my JS day job, it is definitely a majority of the bugs we create. We also code very defensively to protect us against this.

      In CLJS on the other hand, you'd have immutable data, and in tight loops where allocating objects would be expensive, you make your data transient, and then mutate it as much as you wish.

      Living your life with immutable values is a serious improvement. Not only to code, but honestly quality of life.

      Edit: Clojure doesn't return whole new data structures under the hood, but you never notice that. Here is a great explanation, prepare for (= (mind article) :blown) => http://hypirion.com/musings/understanding-persistent-vector-pt-1

    • waffletowerSep 2023

      I can't downvote, but might have as the first sentence is an over-simplication and misunderstanding -- particularly as laziness for collections has always been available in clojure.core. Clojure transducers offer an optimization orthogonal to collections best summed above with: "transducers allow you to define steps in collection processing _per item_ rather than having collection processing as a series of transformations of collections". Yes, transducers can be viewed as somewhat of an analog to the Haskell conduit library (as discussed here several years ago: https://hypirion.com/musings/haskell-transducers). However, I think the distractors coming from strongly typed languages are decidedly missing much of the generalization of the transducer model, particularly those conflating transducers exclusively with streams.

    • pkaJun 2017

      > cloning the entire structure for every applied function sounds like it will be slow? is that not what you will have to do in practice?

      In short, no - as an example, when an element is added to an immutable map, a big part of the newly produced map is structurally shared with the old one (check out [0].)

      As for the ordering, you could have a list of geometry -> geometry functions. You could then take the initial geometry and apply the list of functions in order, or a permutation of it, or drop some functions, or apply some others multiple times, and so on.

      But anyway, it's just an idea - thinking in terms of atomic geometry transformations instead of alternations may or may not be easier in more complex scenarios, I don't know :)

      [0] http://hypirion.com/musings/understanding-persistent-vector-pt-1

    • chipsetAug 2017

      I'm not sure how it's implemented in Ferret but Clojure's data structures are implemented as trees so there's structural sharing that happens when a vector or hash map is updated or when a new version is produced.

      So the whole data structure isn't copied but only the relevant parts are added / updated in the tree and the rest is shared with the "new" data structure.

      Mutable data structures are still more memory effective but I'm assuming its fine since the author has a blog post on using ferret on an Arduino Uno which has 32k of ram.
      https://nakkaya.com/2017/02/15/bare-metal-lisp-rc-control-using-ferret/

      Clojure data Sturucture links:
      Persistent Vectors
      http://hypirion.com/musings/understanding-persistent-vector-pt-1

      Video with Rick hick on them
      https://youtu.be/wASCH_gPnDw?t=1742

    • mvcJun 2016

      > Conceptually, it does this by constructing a new copy of the result for every addition, since conj is not destructive

      That's not how persistent data structures work

      http://hypirion.com/musings/understanding-persistent-vector-pt-1

      > why does efficient set union of two collections require one of the two collections to support fast membership tests

      I haven't thought much about this but it seems intuitively true to me. You want to take the smaller set, and add each item to the larger set if it doesn't already exist. That last part is why you need a fast membership test.

      If you're still unconvinced, try loading up two similarly structured database tables with a million rows and get the union of them (with and without indices). The indexed one will be orders of magnitude quicker.

    Related

    Learning Clojurelearningclojure.com15 people

    An Introduction to the Lambda Calculus (2015)

    Learning Clojure
    Personal · last shared 2020
    Oleg Kiselyovokmij.org251 people

    How the OCaml type checker works (2022)

    Oleg Kiselyov
    Personal · last shared 2026
    Andrew Brehautbrehaut.net18 people

    A Brief Overview of the Clojure Web Stack

    Andrew Brehaut
    Personal · last shared 2013
    Daniel Janusblog.danieljanus.pl20 people

    I love my GPD Micro PC

    Daniel Janus
    Personal · last shared 2026
    Yogthosyogthos.net45 people

    Why I'm Productive in Clojure (2013)

    Yogthos
    Personal · last shared 2026
    Stuart Sierrastuartsierra.com51 people

    Clojure 2014 Year in Review

    Stuart Sierra
    Personal · last shared 2024
    LispCastlispcast.com108 people

    React: Another Level of Indirection

    LispCast
    Personal · last shared 2022
    Apocalispapocalisp.wordpress.com23 people

    Imperative vs Functional Programming

    Apocalisp
    Personal · last shared 2025