I was trying to do some simple scripting work with Clojure. For example, I would load a json which contains a map from a file, remove a given key, and save it back to the file. With leiningen, seems I would have to create an app, add data.json or whatever into the dependencies, then I could start a lein repl to do the real work. Think about doing the same thing with Python. It should be done with 3 lines of code in Python. Is there an easy way to do it with leiningen?
Clojure is not a scripting language: Clojure compiles directly to JVM bytecode, and thus runs at native speed. Thus one must think of Clojure as a true alternative to Java the language, but much more expressive, flexible and powerful.
Working with ClojureThe latest version of Clojure (1.11) has a 41% adoption rate and Java 17+ shows a 49% adoption rate among Clojure users. VS Code use with Calva has continued to grow with its integration of clojure-lsp and joyride.
Clojure is a practical and pragmatic language. It helps to organize a fast and efficient software development process. So, I can recommend it for rapid prototyping and lean startups. It's an important feature for building extensible and flexible systems.
Clojure is a dynamic programming language that has been growing in popularity in recent years, seeing adoption from many developers and companies. Big names such as Adobe, Amazon, Apple, Facebook, and Netflix (among many others) all use Clojure somewhere in their tech stacks.
You can try out the lein-oneoff plugin which was made for situations like these (I'm the author). It lets you declare dependencies and write code in a single file, avoiding the need to generate a proper leiningen project.
You can use lein-exec.
To add a bit more info, I wrote up some notes on standalone scripts with Clojure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With