1. 18

Hi Everyone, I’m myself a python programming and i have been thinking about trying functional programming lately. So i came across clojure and it really caught my attention since it was simple and easy to use.

Furthermore i would love to know if you guys have written projects in Clojure and what separates clojure from other functional programming languages such as haskell ocaml elixir and etc

  1.  

  2. 8

    Clojure is amazing, I really like it. At my company, it’s one of our primary languages. We’ve released some FOSS projects written in Clojure:

    We’ve also built our primary product alephDAM using Clojure. It’s a digital asset management system used by news agencies and publishers: https://alephdam.200ok.ch/

    In all above projects, having a live REPL in the editor, paired with immutable data structures, proved to be a fun, fast and robust programming experience. I haven’t seen another language family - other than LISP - to give the programmer such fast and concise feedback. I can only recommend it.

    We also host the Clojure meetup in Zurich, Switzerland: https://www.meetup.com/zh-clj-Zurich-Clojure-User-Group/

    1. 5

      A few years ago, as part of Cognitect, I helped Defold write their new IDE for building games. Called Editor2, it’s a bit off the beaten path for Clojure, considering the editor is a desktop application using JavaFX with a lot of 3d.

      They wanted to replace their Eclipse-based IDE for a few reasons. One of the subtle ones was the challenge of “undo.” In a text-based environment, undo is pretty straightforward. But they have game objects (edited in one view) that could be composed into collections, which would then appear in scenes. Each of those were different views of the same underlying assets: game objects with textures, scripts, particles, etc. Coordinating undo across those views was an endless source of pain. The project’s sponsor learned about Clojure and immutable values, which sounded like a good way to solve the undo problem… just go back to the previous value.

      The editor we built was essentially one big dataflow graph. Every view is a node. The menu is a node. Game assets are nodes. Nodes have inputs, properties, and outputs. If you’ve seen graphs of shader composition, it’s kind of like that. Every change is an epochal evolution from one state of the graph to another. Undo just means going back to a previous version of the graph… which could be done with an atomic action.

      As an added benefit, the IDE devs got great productivity. A new tool in Eclipse had taken them a few months of a pair to create. Within Editor2, one dev created a platform level editor in about a week… and he had only learned Clojure in the previous month or two.

      1. 1

        Nice By the way I clicked on the tool you mentioned and it took me to 404

        1. 3

          A corrected link: https://defold.com/

          1. 1

            Looks pretty cool

          2. 1

            Oops, sorry about that. @roryokane has the right link.

        2. 5

          We’ve been using Clojure as our main development language for several years now. Much of it isn’t open sourced yet, but we have released Braid, our chat platform that we use for our internal communication.

          As munen said, Clojure’s live integration with the editor is really fantastic; it makes just having a plain repl seem like having to go back to an edit-compile-run cycle.

          1. 4

            At the end of last year I wrote this little program that generates random images and posts them to Twitter, and then uses Twitter interactions as input to a genetic algorithm’s fitness function, recombining “fit” images for the next generation: https://github.com/bi1yeu/generation-p

            There’s a lot to love about Clojure, but one of my favorite things is the speed of feedback that comes from repl-driven development.

            1. 2
              • https://github.com/winks/multiplex
                • my soup/tumblr clone (mostly embedded video/audio/image posts, not text)
              • https://github.com/winks/battlenet
                • a client library for Blizzard’s Battle.net API, currently in rewrite because they changed their API
              • in a former small company I hacked up a quick CRUD web app to keep track of applicants, so we had a consolidated view of CVs etc. Yes, one could have used a CRM or a pro tool but I coded it up in my free time on a weekend.
              • same company, one of our big projects was written in Java and we needed a web service, so I used Clojure that simply used the original jar as a library dependency and so I could easily interface with it without adding cruft there
              1. 2

                I wrote mjuziq using Clojure, and have been maintaining it for a few years now. It boils down to a slightly more opinionated RSS/Atom feed reader, but there’s a lot of (fairly simple) text extraction & parsing happening in there, and I have a primitive “plugin” system which allows me to quickly add new sources of data which was trivial to write in Clojure.

                This is highly subjective, but I found one thing most interesting: I work on mjuziq very sporadically with commits that are sometimes separated by more than a year(!), and I don’t use Clojure too much outside of this project anymore. Yet even when I return to it after a very long time, things look obvious and familiar: it’s like returning home after a long trip. The development environment is stable and rock-solid (I use Emacs + CIDER), the language moves at a fairly slow and steady pace that’s easy to follow, and the whole thing somehow puts my “business logic” front-and-center in a way that other languages don’t.

                That said, I know some people aren’t too happy with how Cognitect runs Clojure as an open source project. I’ve never tried contributing so I’ve missed a lot of the “drama”, but it’s probably important to keep in mind that Clojure is a product that’s, for better or for worse, made in large part by a single highly opinionated company.

                1. 2

                  Wrote memory hole to help track support issues at work, migrations library, pdf building library, and HTML templating library.

                  Here’s my take on why I prefer Clojure to other languages.

                  1. 2

                    That’s so cool I definitely check out your post