Fork me on GitHub

And the video is up as well now:

👍 9

you beat me by 1 millis on posting the video... Babashka is soo fast! 🙂

👍 1
😄 3

Should I expect this to return something useful?

$ bb

user=> (doc io/reader)


(doc map) works fine


you can report vars for which the docstring does not work, this needs fixing. sometimes the issue is that we didn't copy in the docstring of the corresponding clojure var


Although in this case I would have expected it to work


@U06BE1L6T I think you are on an old version:

$ bb
Babashka v0.2.4 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (doc io/reader)


Thanks, updated from v0.2.2 to v0.2.4 and it works now

Michaël Salihi16:12:52

Is there "how to" documentation somewhere to build Babashka pods? I guess Docker it's best choice at first to avoir to install all Graalvm toolchain on local computer, am I right?


@admin055 The pod implementation reference is here: And here is a list of examples:

Michaël Salihi17:12:21

Perfect, thx for links and your disponibility. And for Graalvm docker tool chain image, you confirm?


I then use this in a project to build its native image. For example,

Michaël Salihi06:12:08

Thanks @U0P7ZBZCK I'll check your links. 👍


I usually download GraalVM to a local dir and set GRAALVM_HOME

👍 1

@admin055 also see: Note that you don't need to compile with GraalVM in order to test a pod. You can develop with the normal JVM


I’m interested in making a simple web server which accepts POST/GET requests similar to this node script: Is there any ring or compojure support being added to babashka? Most clojure examples I’ve seen use those.


@trailcapital babashka currently comes with the http-kit server. but there is no routing library included. for the small sized web-apps people typically make with bb it's probably sufficient to look at the :method and :uri of the incoming request and act accordingly. You can see an image viewer web-app in the example folder of the babashka repo which demonstrates this.


ah awesome, I was looking through at http_server.clj in examples but this one looks much more straightforward. Thanks! Really been enjoying bb by the way - I work at a scala shop but use babashka for all of my own scripting 🙂


awesome :) this is a small demo of echo-ing the request: ~

👍 1

ah nice, thats great! thanks again


This one is nicer and simpler, to inspect the request:

$ bb -e '(org.httpkit.server/run-server (fn [req] (clojure.pprint/pprint req) {:body "hello"}) {:port 3000}) (curl/post "") nil'
{:remote-addr "0:0:0:0:0:0:0:1",
 {"accept" "*/*",
  "accept-encoding" "deflate, gzip",
  "host" "localhost:3000",
  "user-agent" "curl/7.54.0"},
 #object[org.httpkit.server.AsyncChannel 0x2630dd1e "/0:0:0:0:0:0:0:1:3000<->/0:0:0:0:0:0:0:1:52341"],
 :server-port 3000,
 :content-length 0,
 :websocket? false,
 :content-type nil,
 :character-encoding "utf8",
 :uri "/",
 :server-name "localhost",
 :query-string nil,
 :body nil,
 :scheme :http,
 :request-method :post}

💯 1

@trailcapital Here is a small function that you could use to generate some HTML (if you wish to): There will probably be a babashka.hiccup or .html namespace in the future, but not there yet.


built-in hiccup would be cool. I think bootleg can be used as a pod for this in the meantime, yes?


true! a nice example of that is Gaiwan's site:


I’m doing something similar on my personal site - use clojure to dump a bunch of static files into a directory then serve them from gh-pages. Over the holidays I may have time to try and port the hiccup portions to babashka and switch over to that as my html/static file build tool


I see you also have a bit of Rust in there. Are you using Rust much?


Not really, but I’d like to dig into it more. Only using it for that post since the library to perform some required cryptography is only available in rust + to play around with WASM


I have this thing you can use with babashka. It's written in Rust: