This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-18
Channels
- # announcements (6)
- # aws (1)
- # babashka (47)
- # beginners (50)
- # calva (65)
- # cider (4)
- # clj-commons (1)
- # clj-kondo (44)
- # clojure (150)
- # clojure-europe (41)
- # clojure-nl (4)
- # clojure-spec (1)
- # clojure-sweden (4)
- # clojure-uk (6)
- # clojurescript (15)
- # clr (1)
- # conjure (1)
- # core-async (7)
- # cursive (5)
- # datomic (12)
- # events (2)
- # fulcro (17)
- # graphql (12)
- # introduce-yourself (1)
- # jackdaw (5)
- # jobs (2)
- # lsp (52)
- # malli (5)
- # meander (3)
- # minecraft (2)
- # missionary (2)
- # off-topic (10)
- # other-languages (9)
- # reitit (9)
- # remote-jobs (1)
- # ring (8)
- # rum (7)
- # shadow-cljs (9)
- # sql (2)
- # tools-deps (20)
- # xtdb (12)
I wonder if I'm overlooking something very obvious, but so far I haven't been able to figure out what that may be. When I try to eval an ns (specifically the main ns) using a repl started with a cider-jack-in, I see a YAMLException:
Syntax error (ClassNotFoundException) compiling at (src/babashka/main.clj:1:1).
org.yaml.snakeyaml.error.YAMLException
ERROR: Unhandled REPL handler exception processing message {:nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70}, :op stacktrace, :session e6516ced-649d-48c9-8b1e-55f1a86e5c71, :id 12}
java.lang.NoClassDefFoundError: Could not initialize class babashka.impl.classes__init
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at clojure.lang.RT.classForName(RT.java:2212)
The thing you download to get the fast startup time: https://github.com/babashka/babashka/releases/tag/v0.7.3
With reproducing I mean: reproducable for me or anyone else who would take a look at the issue. Detailed instructions how to get the error, step by step.
but if you are using lein repl
, then you are not using the binary version, you are using the JVM.
I recommend starting it with lein with-profiles +test repl
The it will include all the dependencies
Or you can use clojure -M:cider-nrepl
instead where cider-nrepl is an alias for cider
Similar to this: https://github.com/clj-kondo/clj-kondo/blob/master/doc/dev.md#toolsdeps
Would it make sense to try to get babashka running on more restricted JS environments? Thinking of espruino or other embedded devices JS implementations. Or is this rubbish "cross-compilation" of clojurescript to minimized JS is the best option? :thinking_face:
Naive question here, but would the espruino be tough enough to support that kind of "double interpretation"? Interpreting JS which interprets Clojure (via SCI)
@ordnungswidrig We have #nbb and #obb for getting SCI to run on JS hosts. We could certainly make one for espruino.
The babashka AWS pod, based on cognitect/aws-api, was updated to the newest release - includes a fix for new services like proton. v0.1.2: https://github.com/babashka/pod-babashka-aws/blob/main/CHANGELOG.md#v012 Thanks @jeroenvandijk
@U04V15CAJ You’re welcome and thank you too!
when playing around with task definitions and trying to find a good balance of what should go into bb.edn
and what should live in a .clj
file, i noticed that using functionality that depends on reader macros such as #()
@
in the edn file throws an error. i don’t think this needs to be supported (imo one goal for task defs should be to do as little as possible) but it might make sense to mention that fact in the book somewhere. worth filing an issue?
My convention lately is to use {:paths ["bb"]}
and then put the bb scripts in $project/bb
all things like #(...)
and @(...)
can be written as (fn ...)
and (deref ...)
so there is always a solution for this
in my current case the whole project is just a collection of tasks backed by some code so atm everything is just in the base dir, but i like that convention because it works in larger projects as well
yeah, eg using #()
gives me
> bb tasks
Exception in thread "main" java.lang.RuntimeException: No dispatch macro for: (
at clojure.lang.Util.runtimeException(Util.java:221)
I'm also considering making linting for bb.edn - if you want to take a stab at that in clj-kondo, certainly welcome. One thing I want to lint is that every :depends
name is also a task name
unless you use a clojure reader to parse .edn files, but that doesn't match with the EDN specification
iirc you can provide reader tags (for eg stuff like #inst
) but that’s probably not relevant for #()
btw, i came across babashka.fs.unzip
- is there a reason there’s no babashka.fs.zip
or just that no one has had the need to implement it yet?
yes, I want to have that, but I have to think about the API... :) probably I'll be looking at the implementation in tools.build