This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-01
Channels
- # adventofcode (93)
- # announcements (44)
- # asami (23)
- # aws (1)
- # babashka (48)
- # beginners (112)
- # calva (26)
- # cider (57)
- # clj-kondo (17)
- # cljfx (5)
- # cljs-dev (21)
- # clojure (124)
- # clojure-europe (19)
- # clojure-hungary (40)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (3)
- # clojurescript (3)
- # cursive (81)
- # datalog (11)
- # events (21)
- # exercism (1)
- # fulcro (37)
- # graalvm (1)
- # introduce-yourself (8)
- # jobs (1)
- # lsp (1)
- # malli (5)
- # membrane-term (17)
- # minecraft (3)
- # nextjournal (5)
- # off-topic (14)
- # other-lisps (14)
- # polylith (58)
- # reagent (16)
- # reclojure (3)
- # reitit (6)
- # remote-jobs (1)
- # shadow-cljs (55)
- # spacemacs (15)
- # testing (2)
- # tools-build (7)
- # tools-deps (191)
Advent of Code 2021 Day 01 in bb... https://gist.github.com/borkdude/b5cf0e9d2d8ab7c678d88e27a3357b33
Hi, I found that bb won’t complain about the bad recur position here, and will continue execution as if it doesn’t exist. Is this a bug?
(loop [n 10]
(when (> n 0)
(when (= n 1)
(println "one")
(recur (- n 2))) ;; <- This recur
(println n)
(recur (- n 1))))
feel free to post issues at both. it's actually a SCI issue, so please post in the SCI repo
Just to verify, bb does not need java/jvm/jre to installed? eg to be used on a Gitlab runner or in AWS Codepipeline
Good question. There can be bb own deps as well, don't remember all the docs by heart : )
there is no distinction between bb deps or clj deps: they are both downloaded via the same tool
I am using :deps {medley/medley {:mvn/version "1.3.0"}}
at the moment in the bb.edn. If it must have java i can probably get read of it
I could thanks. But ideally, no java so that I can 'sell' it to colleagues as a script : )
you need to provide an entry point like bb uberscript script.clj -m foo.bar
, then when executing script.clj
it will execute the main function
but in this case, perhaps just copy pasting that function from medley keeps things a little smaller ;)
working on writing my first pod and it made me curious if there is a "podify" clj wrapper library already out there. since it seems like you could basically examine a namespace to expose its public vars to a pod client in a fairly straightforward, generic manner (and indeed that's what I started writing)
if you make something nice I'll make it a (mediocre) logo that looks like a bunch of peas in a pod. 🙂
haha, yes!!! now I need to do it!
@cap10morgan The idea has come up before (I think @nate has mentioned this once) but so far nobody really implemented it I think :)
@cap10morgan here is my in-progress library to make pod writing easier: https://github.com/justone/bb-pod-racer
I use it in both of the pods I've made so far:
• https://github.com/justone/tabl
• https://github.com/justone/brisk
Look in either main.clj
for how to use the lib. Feel free to use the code as inspiration or if you'd like to add to it, let me know and we can talk about design.
now that @hobosarefriends's logo offer is on the table the gauntlet has really been thrown down!
I'll probably remake this in svg (because I shamelessly stole half of it from the internet)
does a pod need a shutdown op if all it would do is call (System/exit 0)
? i.e. will it hang the client if it doesn't do that? or is the shutdown op more for cleanup kinds of things before the client kills the pod?
what's the minimum amount of building I need to do before I can point a pod client at this thing? I assume I can't just call load-pod
on a dir w/ a deps.edn
and some clojure code?
@cap10morgan you can call load-pod like this: (load-pod ["clojure" "-M:pod"])
Ohhh nice!
If that wasn't obvious from the docs, please leave some feedback or PR an improvement to the docs
hmm, having a hard time making that work. created an alias to run a repl that replaces all deps with just babashka.pods so I can consume the :pod
alias like you showed above. but it errors out when trying to run (require '[babashka.pods :as pods])
. that's most likely a problem w/ my editor / repl rather than any of your stuff though. just wanted to see if I was being dumb w/ my whole approach or not. 🙂
for some reason trying to use just babashka.pods in that alias wasn't working. :extra-deps
worked, but I had to use a different ns for my code vs. the ns name I exposed to the pod client in describe. that's probably going to be a sanity-preserving thing anyway, so all good. just added -impl
to the code ns.
the above makes sense b/c running (require '[code.ns])
was pulling in the actual code, not what load-pod had exposed
so having two separate namespaces helps
yeah, @U04V15CAJ whenever you have a moment, I could use a little more context on the (load-pod ["clojure" "-M:pod"])
approach. think I'm missing something simple... no rush