Skip to content

tuddman/clojure-graalvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clojure without the JVM

Thanks to GraalVM

specifically, building a 'native-image' so you don't need the JVM anymore.

Right.

Contents

This repo contains the base GraalVM (with native-image) docker image, which can be used to then build a clojure application into a native binary.

A bare-bones example clojure application is located in the /example directory.

Getting Started

compile the clojure into *.class files

# cd example/hello
# lein repl
user=> (require 'com.example.hello)
nil
user=> (compile 'com.example.hello)
com.example.hello
user=> quit
Bye for now!

# ./pull-in-clojure.sh

get the docker image

docker pull tuddman/graalvm:latest

or

build the docker images from source

build base GraalVM docker image

cd <basedir>
docker build -t tuddman/graalvm:latest .

build clojure example docker image

cd example/hello
docker build -t hello-clj-on-graalvm .

see how much smaller the compiled binary is

$ docker inspect hello-clj-on-graalvm | jq .[0].Size

Docker base GraalVM

tuddman/graalvm

Thanks to ...

About

Run Clojure Programs without the JVM

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published