This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-17
Channels
- # announcements (12)
- # babashka (27)
- # beginners (65)
- # biff (8)
- # calva (22)
- # clj-kondo (1)
- # clj-otel (5)
- # clojure (65)
- # clojure-europe (127)
- # clojure-nl (1)
- # clojure-norway (11)
- # clojure-portugal (2)
- # clojure-uk (2)
- # clojurescript (18)
- # cursive (5)
- # data-science (3)
- # datahike (14)
- # datascript (3)
- # datomic (7)
- # deps-new (11)
- # emacs (31)
- # exercism (1)
- # fulcro (1)
- # honeysql (3)
- # hyperfiddle (38)
- # introduce-yourself (4)
- # leiningen (2)
- # malli (20)
- # meander (2)
- # missionary (3)
- # off-topic (4)
- # pathom (3)
- # practicalli (2)
- # reagent (5)
- # releases (1)
- # sci (1)
- # shadow-cljs (9)
- # xtdb (8)
Not sure if there's a better channel for this - recently on HN there was an interest in no-build-system web apps/pages. In the SCI-land, there's scittle, but recently there was also cherry and squint that might be in the same land? I thought a blog post detailing how you could do zero-build web apps with Clojure would be interesting 😉
The squint/cherry compiler can run inside a browser, but it still does a source -> source transformation, so it depends on your definition of build-less. I think babashka + scittle comes closest. E.g. this one: https://github.com/kloimhardt/babashka-scittle-guestbook or Babashka + HTMX: https://github.com/prestancedesign/babashka-htmx-todoapp
Hey Guys. What a fun with babashka ! @borkdude thanks for your effort here ! Wasn't aware, but now I have covered all 3 important areas for me: frontend (cljs), browser-free (clj) and YAY :female_superhero:my bash (zsh) as well ! It's really fun! Thanks!
I’m working with the babashka process library and I’m having trouble capturing the error message output from a command. As a simplified example, I’m trying this here:
(try (:out (shell {:out :string} "ls nofile"))
(catch ExceptionInfo e (-> e print)))
How can I capture the error message? The excpetionInfo doesn’t seem to have it?
"nofile": No such file or directory (os error 2)
Oooh - no sooner do I ask than I figure it out:
(try (:out (shell {:out :string :err :string} "ls nofile"))
(catch ExceptionInfo e (-> e ex-message print)))
so thats probably written to stderr. try with {:err :string}
as well
Yep - just realized that 👍 ty
has any thought been given to incorporating readline type support into the babashka repl? it is pretty painful to use without it. we've been wrapping the basic call to bb in rlwrap
, which works for that use case, but we're starting to find reasons to hit the repl from within a program, and it would be much easier to use if it was just built into the repl itself...
@U03A0EGF82E The babashka console REPL is as basic as the clj
REPL. If you want to have a better experience, you should probably just start the nrepl-server
and connect from your favorite editor
i guess that's fair.
You can also get a long way with load-file
and (require '[foobar] :reload)
and then edit the files in your editor, but reload the evaluation of that file in the console REPL
no, this all makes sense. the idea is to stop after generating a complex data structure and drop the user into a repl. i think i can do that by starting nrepl-server and pausing so they can connect to it, and get the desired functionality.
hmm - i just tried to use
babashka.nrepl.server
weird, my editor can't find it but it executes fine. Looks like it should work 🙂 thanks
$ bb -e '@(:future (babashka.nrepl.server/start-server!))'
Started nREPL server at 0.0.0.0:1667
the reason is probably that your editor is looking for an .nrepl-port
file or so - bb doesn't write that by default
You can see some snippet here which does that: https://book.babashka.org/#_nrepl
trying to use the babashka/babashka container but getting java not available please set JAVA_HOME, its a simple script with a bb.edn, is this because its using java to handle the bb.edn file initially ? seems i should not need java as I am using babaska
Java is only used when you have :deps
in bb.edn
to download them and construct the classpath
If you want to run in a container without java, it's probably better to construct an uberjar first
ah okay, I was hoping to have a simpler script but, it explains the errors so that's very helpful cheers
@U02DXJUS5JA outside of the container:
bb uberjar foo.jar
Then copy foo.jar
into the container and do:
BABASHKA_CLASSPATH=foo.jar bb
oh that's neat cheers