TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

3 点作者 nikvdp超过 3 年前

2 条评论

nikvdp超过 3 年前
I&#x27;ve been learning Clojure recently and loving it, but one thing I&#x27;ve found myself missing from my Golang days is how easy it is to build and deploy CLI tools in Golang.<p>With GraalVM it&#x27;s finally possible to compile Clojure apps into static binaries that give your users a deploy and startup experience similar to Go&#x27;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&#x27;t find out that your working JVM Clojure code won&#x27;t work as a native-image until it&#x27;s too late.<p>BabashkaBins&#x2F;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&#x27;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.<p>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&#x27;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&#x27;s not GraalVM compatible at least you&#x27;ll know early!<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;borkdude&#x2F;babashka" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;borkdude&#x2F;babashka</a> [2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;l3nz&#x2F;cli-matic" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;l3nz&#x2F;cli-matic</a>
hgranthorner超过 3 年前
This is great, and definitely scratches an itch that I’ve had. A couple questions:<p>1. How do I install this? Is it a clojar or a separate binary?<p>2. How do I use it? You reference bbb once in the README but then use bb in examples farther down.<p>Both of these may be ID10T errors where I missed a link to additional documentation…
评论 #30318813 未加载