Thanksgiving OSS sponsor appreciation post!

Dear sponsors,

As we approach Thanksgiving again, it's time for me to reflect on the past year and in particular on my activities in Clojure open source. I'm very grateful that my main projects babashka, clj-kondo, SCI, squint and all other related projects are thriving so far thanks to your ongoing support through GitHub Sponsors and Clojurists Together. Your contributions make a real difference: my Clojure projects wouldn't be nearly as polished, maintained, or ambitious without your help. I will apply for Clojurists Together long-term funding for 2027. If you're a CT sponsor, a vote in the next long-term funding round would be really appreciated.

Current top tier sponsors:

You can find all my sponsors on my GitHub Sponsors page. Thank you all!

Highlights of 2026

2026 felt like a really productive year to me. On the 1st of January I started hacking on async/await support in ClojureScript. Since Squint supported this feature, I had a vision of how it could work in ClojureScript. It turned out to be manageable and I got 95% working within a day. I know that a lot of people can say this in 2026 with Claude helping them to code, but I assure you no LLMs were used (or hurt) in this process. Of course it took some back and forth with maintainer David Nolen, but the patch was merged March 6th of 2026. A new release came out on May 7th 2026. It felt great to contribute something significant back to ClojureScript that benefits all of its users in the ecosystem and not just squint users.

Three years ago the first Babashka Conf took place. This was mainly organized by volunteers other than myself and was hosted at Pitch. I did the keynote that year. This year I decided to organize Babashka Conf 2026 myself, which took place on May 8th at the OBA Oosterdok library in Amsterdam. What prompted me to organize this was that the Dutch ClojureDays were resurrected after four years. Since many people would come over anyway, an extra conference the day before would align well with people's traveling plans. David Nolen, who came over all the way from New York, was our keynote speaker. You can watch all the videos here. The conference was only possible thanks to the kind companies and persons who decided to sponsor this event: Nubank, Exoscale, Flexiana, Bob and Itonomi. The day after, at Dutch ClojureDays, I presented the async/await support in ClojureScript, so it was quite a busy weekend.

Babashka Conf 2026 speakers and organizers

Another highlight this year was my visit to the Clojure Conj together with Rahul Dé, where we organized a Babashka workshop. It was great seeing lots of familiar and new faces over there. Rahul and I will give this workshop at EuroClojure 2027 as well. Make sure to be there!

Babashka workshop at Clojure/conj 2026, seen from the back of the room

To give people at the workshop the best experience possible, lots of improvements went into babashka prior to the conference... conference-driven development!

  • Automatic command line help and completions in babashka tasks via babashka.cli
  • Resolving dependencies without a JVM (by vendoring tools.deps and rewriting the maven part)
  • Babashka FFI: a foreign function library to call C-ABI functions from libraries
  • Better nREPL support: popular nREPL middleware like CIDER's test middleware, the CIDER inspector, etc.
  • TUI support via JLine

Rich Hickey told me in person that he considers babashka an official Clojure dialect, alongside ClojureScript, ClojureCLR, ClojureDart and Jank. That really means a lot to me. I'm allowed to use "Clojure" in the name if I want, but at this point, changing the name of babashka would probably lead to confusion? Let me know what you think.

Alex Miller on Clojurians Slack: the official dialects from Rich's perspective are Clojure, ClojureScript, ClojureCLR, ClojureDart, Babashka, and Jank

I could name a lot of other highlights: improvements to clj-kondo, SCI, squint, and related projects of the borkiverse. But that would make this blog post too long. You can find highlights in more detail in my OSS updates here: https://blog.michielborkent.nl/tags/oss-updates.html. A few things that stand out to me are:

  • support for source maps in squint
  • nREPL support for squint
  • JIT-compilation in SCI when running in JavaScript
  • running macros directly from source in clj-kondo

Plans for 2027

As I said, I will apply for Clojurists Together long-term funding for 2027. If you're a CT sponsor, a vote in the next long-term funding round would be really appreciated.

Here are the main items I want to focus on in 2027.

  • Better support for Clojure dialects in clj-kondo, starting with ClojureDart and Jank
  • Clj-kondo project configuration (rather than doing everything via command line arguments)
  • Clj-kondo: run exported config/hooks directly from a classpath (depends on the previous point)
  • Clj-kondo: improvements to the type system
  • Babashka: remaining work on babashka tasks (e.g. colored output for parallel tasks)
  • Babashka: include (parts of) bbin (package manager for bb scripts/projects) in bb itself
  • Babashka: better support for self-contained binaries
  • Babashka: compatibility with more Clojure libraries
  • Babashka: more libraries that leverage babashka.ffi
  • EuroClojure talk and workshop
  • Another Babashka Conf...?
  • Attend meetings of the Clojure CLI working group and provide feedback
  • Scittle2: Scittle but based on squint or cherry
  • Overall: performance improvements and bugfixes of all my projects

I can't make any promises on hard deadlines, but I definitely intend to work toward realizing the above goals.

Wrapping up

As always, feel free to reach out anytime, whether here, on Clojurians Slack, or by email at michielborkent@gmail.com. I love hearing about what you are doing with my projects. Also if you are struggling with something, let me know. Your feedback and use cases continue to shape the direction of my work.

Here's to another strong year of Clojure OSS!

Thank you for making this journey possible.

With appreciation,

Michiel Borkent / @borkdude

PS: if you aren't sponsoring, but are interested, here are the main ways to do so:

Sponsor info

Published: 2026-11-23

Tagged: sponsors

SCI sandboxing on JS host considered unsafe

SCI for sandboxing

SCI is a Clojure interpreter that is mostly known for its use in babashka, a Clojure environment for scripting. SCI gives access to Clojure scripting in environments where it would otherwise be difficult. Babashka runs as a GraalVM native-image, which until recently did not allow dynamic class loading. SCI, being an interpreter rather than a compiler that targets bytecode, still offers you Clojure evaluation. SCI can also be used in the browser, where ClojureScript eval normally does not reach, unless you're using its bootstrapped version and are willing to accept the bundle size that comes with that. Scittle is an example of a SCI-based environment for the browser. It allows you to run Clojure code directly in script tags.

Another use that SCI is designed for is sandboxing. A sandbox allows you to run code in a restraining environment. SCI achieves this by limiting the set of host functions (via the :namespaces option) and classes (via the :classes option) you can use. SCI has a fairly safe set of defaults. For example, SCI does not allow you to read or write files by default.

Most people who use SCI for sandboxing use it in a JVM-based environment. This article is not about that. Using the sandbox on a JS host like Node.js should be considered unsafe. This came to light through a report about bytefield-svg, which uses SCI and is served by Kroki.

SCI sandboxing on JS should be considered unsafe

This is why SCI sandboxing on JS should be considered unsafe today. In SCI, a handful of clojure.core functions that are enabled by default can read or write any property of a JS value. Take aget, a function that is essential in ClojureScript, for reading from an array. When you evaluate:

(def str-ctor (aget "x" "constructor"))

you'll get the constructor for a string, String, which is itself a function in JS. When you in turn get the constructor from that using (aget str-ctor "constructor") you'll get back the Function constructor. Using that you can evaluate anything you want.

(let [F (aget (aget "x" "constructor") "constructor")
      f (F "return 'ESCAPE_OK_' + (6*7)")]
  (f))
;;=> "ESCAPE_OK_42"

A simpler variant of this is:

(def f ((type (type "x")) "return 1 + 1"))
(f) ;;=> 2

On Node.js such a function has access to process. You can already guess where this is going right?

(let [F (aget (aget "x" "constructor") "constructor")]
  ((F "return process.version")))
;;=> "v22.11.0"

Using process you can spawn any process on your system to do harmful stuff.

In SCI js/... globals and dot interop like (.-constructor x) are blocked in a default context. But SCI doesn't protect you from the above "jailbreak".

Since functions like aget and type are essential for CLJS to operate (note that aget is not only used for arrays, but also, against its design, to get fields from objects), I have decided against changing this since that would break existing programs.

Security on the host level

The best way to sandbox an environment is on the host level. In Node.js you can limit evaluation of arbitrary code with this option:

NODE_OPTIONS=--disallow-code-generation-from-strings node your-app.js

This makes new Function(...) and eval(...) throw.

SCI keeps working with this flag, but you will no longer have JIT (which was introduced a couple of versions ago).

In the browser, a Content Security Policy without 'unsafe-eval' has the same effect.

On top of that, you can remove the functions that allow the unsafe evaluation from the context:

(sci/init {:namespaces {'clojure.core {'aget nil
                                       'aset nil
                                       'unchecked-get nil
                                       'unchecked-set nil
                                       'type nil}}})

or change them to alternative behaviors. E.g. you could change aget, aset, unchecked-get and unchecked-set to functions that only accept a numeric index, and type to a function that throws when it would return Function. Checking that the first argument is an array is not enough: (aget arr "constructor") still reaches Array.

Note that any macros that rely on these functions will break if you override the functions with nil. E.g amap breaks when you remove aget.

Closing thoughts

In Clojurians I did a poll on how many people were using sandboxing with SCI on JS. All people who used sandboxing were doing so on a JVM-based host. Therefore, I declare SCI sandboxing bankruptcy on JS hosts by default. The onus of making the behavior safe is on the user. I documented how to do so in SCI's README. Contributions to that documentation are welcome.

Published: 2026-11-17

Tagged: security clojure SCI clojurescript

Babashka vs cream

I've given a lot of thought to whether cream should affect babashka. Cream is based on Crema, a native-image compatible bytecode interpreter, basically a JVM inside of native-image.

What it concretely would mean to move babashka to Crema is that we could run virtually any Clojure program without changes. This is exciting.

Crema is an impressive piece of engineering. Native-image could not define classes at run time before, which is the reason SCI exists. Instead of using eval, SCI allows you to interpret Clojure code inside of a native image. With Crema, eval, require and Java libraries just work in a native binary using the normal Clojure compiler (with mild patches). That's the approach that cream takes.

But it has serious downsides compared to using SCI.

Load time

The main downside is the load time of Clojure sources. Evaluating a fn in cream runs the Clojure compiler and emits a class which then has to be loaded by a classloader. This takes longer than it takes SCI to construct an interpreted function.

Here is the time to load malli 0.16.4 from source:

DEPS='{:deps {metosin/malli {:mvn/version "0.16.4"}}}'
CP=$(clojure -Spath -Sdeps "$DEPS")
E="(time (require 'malli.core 'malli.generator))"

bb -cp "$CP" -e "$E"
clojure -Sdeps "$DEPS" -M -e "$E"
./cream -Scp "$CP" -M -e "$E"
bb     ## 0.06s
JVM    ############################ 0.93s
cream  ######################################## 1.34s
requirewhole process
bb55ms0.06s
JVM610ms0.93s
cream1310ms1.34s

Babashka on SCI is just way faster for loading bigger libraries from source and then executing some expressions, which is commonly called "scripting". When loading a bigger lib like malli, you might as well just use a normal JVM instead of cream.

The gap shrinks with smaller libraries, but it stays quite significant. Babashka loads medley 9x faster than cream and camel-snake-kebab 15x faster.

Startup is the same in both babashka and cream: about 10ms.

With AOT-compiled classes, malli loads in about 300ms in both cream and the JVM. Cream spends 10ms on startup and 290ms on loading classes, the JVM 200ms on startup and 100ms on loading classes. Run-time performance is worse in cream, so if you AOT anyway, the JVM is the better choice. Cream could AOT-compile libraries on first use and cache the classes, but caches are a hassle, and babashka is faster than the AOT case anyway. So it seems something Crema-based in between bb and a JVM doesn't offer us much benefit here.

Performance

Performance of cream is better than bb for hot JIT-ed code, but worse than a JVM.

bbcreamJVM
malli validate, 1M calls300ms70ms35ms
fib 35, hot1230ms815ms73ms
fib 27, cold26ms46ms5ms
(reduce + (map inc (range 10000000)))157ms725ms80ms

Cream's JIT makes no difference in the last row, it takes 725ms with the JIT off too.

Cream's JIT is still warming up during fib 27. For a script, the code does not run long enough for that JIT to pay off. Since the core feature of bb is scripting with good startup time, bb + SCI wins here.

Binary size and build time

Another major downside of including Crema is the binary size. Even when I only use Crema for loading Java classes, as described below, the binary goes up from 75MB to about 200MB. Cream itself is about 225MB. Maybe this isn't that important, but compile times also go up. I expect double or triple in CI, which isn't fun at all when you build a binary for several OSes. SCI is just way more light weight here too.

Combining SCI and Crema

Another option is to combine both approaches: SCI keeps interpreting Clojure and Crema is only used to load Java classes that are not in the image. I tried this on the crema-hybrid branch and it works for many libraries. A tiny script with BouncyCastle, commons-compress or Caffeine takes about 40ms for the whole process, against about 320ms on the JVM. Loading malli is slow in cream because Clojure compiles every form and defines about 1670 classes. A Java library is already compiled, and a single call only loads the classes it needs.

Load time of Clojure code is not the problem here, since SCI still does that. The main downside of this hybrid is that a JDK package that wasn't preserved at build time aborts the process instead of throwing an exception, and you only find out by running the library. Of course we can protect users from this with extensive testing.

The binary size and build time downsides are the same as for cream. The 200MB applies to every user, even for scripts that never load a class, because Crema needs a table of all compiled methods and whole preserved JDK packages.

If GraalVM shrinks that table or turns the abort into an exception, I'll look at this again.

Babashka + SCI's trade-off

Without Crema, babashka can't load JVM classes that aren't baked into the native image. However, babashka is extensible via pods and more recently FFI. Babashka code is fully portable with JVM Clojure so it should always be easy to migrate a bb scripting project to a full-blown Clojure JVM project, when a project outgrows the light-weight babashka runtime.

Conclusion

This article is not a verdict on Crema, which is still experimental and improving fast. A native binary with full Clojure and a working JIT is very interesting and exciting. Most of the load time comes from the Clojure compiler. It's just not the right trade-off for babashka today. Perhaps with an experimental fork of Clojure that reduces the number of emitted classes, this picture will change. I do use a fork of Clojure for cream, but it only has very mild changes to make it work with Crema. I haven't changed anything significant in the compiler.

The hybrid is more tempting, since it keeps SCI's load time and loads Java libraries faster than a JVM. But today it costs every user about 125MB and slower builds, and a library can still abort the process. So for now it stays on a branch.

For a while I thought SCI would be replaced with Crema in bb, but it still wins for the scripting use case. And babashka is all about scripting. I will keep improving SCI to make it both load and run faster over time. I was planning to do that anyway but the above gives me even more determination to make the babashka + SCI combination the best possible scripting experience for Clojure.

You can view more numbers in the cream README.

Published: 2026-11-02

Tagged: clojure babashka graalvm

Archive