This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-18
Channels
- # announcements (5)
- # aws (4)
- # babashka (30)
- # beginners (90)
- # calva (31)
- # clj-on-windows (16)
- # clojure (110)
- # clojure-dev (10)
- # clojure-europe (26)
- # clojure-nl (1)
- # clojure-norway (20)
- # clojure-spec (25)
- # clojure-uk (15)
- # clojured (2)
- # clojurescript (12)
- # code-reviews (2)
- # community-development (3)
- # conjure (14)
- # datomic (15)
- # defnpodcast (2)
- # events (1)
- # fulcro (17)
- # graalvm (8)
- # gratitude (1)
- # introduce-yourself (2)
- # jobs-discuss (7)
- # kaocha (6)
- # lsp (9)
- # luminus (5)
- # nextjournal (7)
- # observability (9)
- # off-topic (71)
- # portal (5)
- # practicalli (1)
- # rdf (21)
- # re-frame (15)
- # releases (1)
- # shadow-cljs (24)
- # testing (7)
- # tools-build (13)
- # tools-deps (14)
- # xtdb (7)
pod-babashka-go-sqlite3 0.1.0 is out: https://github.com/babashka/pod-babashka-go-sqlite3 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: https://github.com/l3nz/cli-matic/pull/145
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!

I've also explored an alternative CGI thing with bb recently, but then leveraging PHP which already ran on my VPS: https://blog.michielborkent.nl/using-babashka-with-php.html
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
The source code is here: https://github.com/borkdude/bb-php-guestbook
Here's a reaction from someone who actually started rewriting his PHP website to Clojure with babashka as an in-between step. https://github.com/borkdude/blog/discussions/21
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. https://blog.michielborkent.nl/aws-lambda-nbb.html
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
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 deftest
s to a string writer but I noticed that the way the report works differently, it’s writing to sci/out
https://github.com/babashka/babashka/blob/e64db1028cfcbdfccbda572444e942f2a77b2dd7/src/babashka/impl/clojure/test.clj#L278-L283
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.
Yeah, I see what the issue is. sci/out
here should probably be *out*
here:
https://github.com/babashka/babashka/blob/e64db1028cfcbdfccbda572444e942f2a77b2dd7/src/babashka/impl/clojure/test.clj#L282
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
Here's the link: https://26283-201467090-gh.circle-artifacts.com/0/release/babashka-0.7.6-SNAPSHOT-linux-amd64-static.tar.gz
@UBBCH4TSA can you give that a go?