Fork me on GitHub

pod-babashka-go-sqlite3 0.1.0 is out: it's been a year since the previous release. use sqlite3 directly from babashka without installing sqlite, the pod is self-contained and written in ... golang!


A PR to make cli-matic compatible with babashka:


Was hacking on building an immutable journal with some automation against the Notion API. The last part I needed was the ability to have an embeddable button trigger a GitHub action. I was hoping a vanilla HTML form would be enough but after testing it clearly needed the auth token and json data. That's when babashka running as a cgi script was a really good fit! Just had to create a single clj script file to process the post data and used the curl wrapper to use the proper API and it worked!

babashka 2

That's awesome!


I've also explored an alternative CGI thing with bb recently, but then leveraging PHP which already ran on my VPS:


Also I think such a thing could run on AWS Lambda or Google Cloud very well now too, maybe even more so with #nbb


Ooh very nice! This might be even better given that it's easier to find php hosts than ones that let you change cgi handlers, I bet the debugging story is a bit better too. What does your passthru function look like? Lambda or Google cloud would work but I suspect would have a bit more upfront setup. In the cgi or php path we already had a suitable web server so the path of least resistance was to upload our scripts and we were good to go


Here's a reaction from someone who actually started rewriting his PHP website to Clojure with babashka as an in-between step.


I'm by no means a PHP expert, quite the opposite, so I just hacked together until this worked. There might be better ways


Writing an nbb lambda is actually very little code.


Ahhh I see! I just had to scroll to the right more to see the env vars passed to the bb script. At one point PHP was my go to but that was over a decade ago now that I think about it.


I figured it's not much code but I meant the aws console account setup, payment info and the steps to get to that point


Oh damn nbb might be the perfect solution for a project I had in mind. Keep trying to fix lumo’s build system to get that updated but this might be a lot better too


Welcome to join #nbb and ask anything ;)


Is sci accessible from bb? I’m writing a test util with clojure.test to conditionally print stdout on fail and I’ve been able to save the printlns running in the different deftests to a string writer but I noticed that the way the report works differently, it’s writing to sci/out is there any way to get to this internal sci/out?

$ bb
Babashka v0.7.3 REPL.
=> (require '[sci.core :as sci])
java.lang.Exception: Could not find namespace: sci.core.
=> (require '[babashka.impl.clojure.test])
java.lang.Exception: Could not find namespace: babashka.impl.clojure.test.


sci/out is the same as *out* within bb, similar to JVM Clojure.


Thanks for the report.


Yeah, I see what the issue is. sci/out here should probably be *out* here: since in this macro body we are using normal clojure prn etc, which print to *out* .


I'll push a fix to a branch and you can download this version in #babashka-circleci-builds in 10 minutes or so


Hmm, too soon, it's a bit harder than I thought. I'll report back when this is fixed


@UBBCH4TSA I pushed to the branch fix-test-out - a new binary should appear within 10 minutes in #babashka-circleci-builds


I now get the same output with as with JVM Clojure for your test program


@UBBCH4TSA can you give that a go?


sweet thank you, it works 🙇


Thanks for you donation!


Merged to master including a test. When that build finishes you can install it with:

bash <(curl ) --version 0.7.6-SNAPSHOT --dir .
until the next release.