Show HN: Bbb – an easy way to build and compile Clojure CLIs with GraalVM

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • bbb

  • babashka

    Discontinued A Clojure babushka for the grey areas of Bash (native fast-starting Clojure scripting environment) [Moved to: https://github.com/babashka/babashka] (by borkdude)

    I've been learning Clojure recently and loving it, but one thing I've found myself missing from my Golang days is how easy it is to build and deploy CLI tools in Golang.

    With GraalVM it's finally possible to compile Clojure apps into static binaries that give your users a deploy and startup experience similar to Go's, but I found GraalVM very difficult to configure and use, and was often frustrated because not all JVM code is compatible with GraalVM. Worse still, because native-images take a while to build you often don't find out that your working JVM Clojure code won't work as a native-image until it's too late.

    BabashkaBins/bbb is my attempt to fix this: it lets you easily run the same codebase under babashka or JVM Clojure, and will automate compiling your project to a static binary for you using GraalVM's native-image. It also takes care of collecting some tweaks that make it easy to use the cli-magic [2] library under babashka, which means you can easily make complex CLI tools with nested subcommands a la git or docker, with all the bells and whistles.

    Since babashka is itself compiled under GraalVM, this arrangement provides a other few nice benefits: 1) babashka starts quickly, so you can test your CLI from an actual command line without waiting for the JVM to spin up each time. 2) babashka's codebase contains a treasure trove of GraalVM related tweaks and fixes that using bbb lets you take advantage of in your own CLIs for free, and 3) it functions as a quick sanity check since babashka itself is compiled under GraalVM. If you find yourself doing something that's not GraalVM compatible at least you'll know early!

    [1]: https://github.com/borkdude/babashka

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • cli-matic

    Compact, hands-free [sub]command line parsing library for Clojure.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts