\

Clojure on Fennel Part One: Persistent Data Structures

106 points - last Tuesday at 2:09 AM

Source
  • xeubie

    today at 4:54 PM

    Clojure's immutable HAMTs are still a superpower nearly 20 years later. They've been copied in pretty much every language as a library (I did so myself in Zig) but what really makes it work well in Clojure is the fact that they're built into the language, so the entire ecosystem is built around them. Libraries that were made independently usually fit together like a glove because they are all just maps/vectors in -> maps/vectors out.

      • dapperdrake

        today at 6:21 PM

        I thought it cheesy at the time. Then I tried clojure.

        "The value of values". Indeed. Q.e.d. No notes.

      • packetlost

        today at 6:59 PM

        Yeah. I do wish there was something that was like Clojure with a TypeScript or Go-like nominal typing, but I do feel myself missing types a lot less with Clojure compared to other languages.

          • ux266478

            today at 9:16 PM

            Type annotations mix poorly with s-expressions imo. Try an ML, which answers the same question of "How do we represent the lambda calculus as a programming language?"

        • iLemming

          today at 6:31 PM

          Yeah, they are so underappreciated - the practical differences in designing, delivering and maintaining software are real. Initially you see small differences "What's the point? I can write that in Python too... maybe it's not as delightful, but who cares?...", etc. Yet over time small annoyances accumulate and become an endless stream of headaches. I see it over and over again - I work on a team where we have codebases in different languages, and some services written in Clojure. Immutability by default is a game of a different league.

          • slowmovintarget

            today at 8:23 PM

            HAMT -> Hashed Array Mapped Trie for those wondering.

            https://en.wikipedia.org/wiki/Hash_array_mapped_trie

            (The acronym is expanded in the article, but a ways down.)

        • devnotes77

          today at 7:05 PM

          [dead]