This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-02
Channels
- # adventofcode (76)
- # announcements (1)
- # asami (1)
- # babashka (31)
- # beginners (302)
- # calva (3)
- # cider (1)
- # clj-kondo (1)
- # cljdoc (1)
- # cljfx (63)
- # cljsjs (2)
- # clojure (36)
- # clojure-europe (29)
- # clojure-gamedev (2)
- # clojure-nl (5)
- # clojure-sanfrancisco (2)
- # clojure-spec (2)
- # clojure-uk (71)
- # clojurescript (19)
- # conjure (21)
- # core-async (10)
- # core-matrix (1)
- # cryogen (4)
- # cursive (12)
- # datomic (22)
- # emacs (4)
- # events (1)
- # figwheel-main (7)
- # fulcro (9)
- # graalvm (1)
- # jobs (1)
- # kaocha (17)
- # lambdaisland (1)
- # meander (7)
- # mount (2)
- # nrepl (12)
- # off-topic (35)
- # re-frame (15)
- # reagent (17)
- # remote-jobs (1)
- # reveal (41)
- # shadow-cljs (13)
- # spacemacs (2)
- # tools-deps (24)
you can report vars for which the docstring does not work, this needs fixing. sometimes the issue is that we didn't copy in the docstring of the corresponding clojure var
@U06BE1L6T I think you are on an old version:
$ bb
Babashka v0.2.4 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (doc io/reader)
-------------------------
Is there "how to" documentation somewhere to build Babashka pods? I guess Docker it's best choice at first to avoir to install all Graalvm toolchain on local computer, am I right?
@admin055 The pod implementation reference is here: https://github.com/babashka/babashka.pods And here is a list of examples: https://github.com/borkdude/babashka/blob/master/doc/projects.md#pods
Perfect, thx for links and your disponibility. And for Graalvm docker tool chain image, you confirm?
I then use this in a project to build its native image. For example, https://gitlab.com/tvaughan/kibit-runner/-/blob/master/native-image.mk
Thanks @U0P7ZBZCK I'll check your links. 👍
@admin055 also see: https://github.com/lread/clj-graal-docs Note that you don't need to compile with GraalVM in order to test a pod. You can develop with the normal JVM
I’m interested in making a simple web server which accepts POST/GET requests similar to this node script: https://www.tutorialsteacher.com/nodejs/create-nodejs-web-server Is there any ring or compojure support being added to babashka? Most clojure examples I’ve seen use those.
@trailcapital babashka currently comes with the http-kit server. but there is no routing library included. for the small sized web-apps people typically make with bb it's probably sufficient to look at the :method
and :uri
of the incoming request and act accordingly. You can see an image viewer web-app in the example folder of the babashka repo which demonstrates this.
ah awesome, I was looking through at http_server.clj in examples but this one looks much more straightforward. Thanks! Really been enjoying bb by the way - I work at a scala shop but use babashka for all of my own scripting 🙂
This one is nicer and simpler, to inspect the request:
$ bb -e '(org.httpkit.server/run-server (fn [req] (clojure.pprint/pprint req) {:body "hello"}) {:port 3000}) (curl/post "") nil'
{:remote-addr "0:0:0:0:0:0:0:1",
:headers
{"accept" "*/*",
"accept-encoding" "deflate, gzip",
"host" "localhost:3000",
"user-agent" "curl/7.54.0"},
:async-channel
#object[org.httpkit.server.AsyncChannel 0x2630dd1e "/0:0:0:0:0:0:0:1:3000<->/0:0:0:0:0:0:0:1:52341"],
:server-port 3000,
:content-length 0,
:websocket? false,
:content-type nil,
:character-encoding "utf8",
:uri "/",
:server-name "localhost",
:query-string nil,
:body nil,
:scheme :http,
:request-method :post}
@trailcapital Here is a small function that you could use to generate some HTML (if you wish to): https://github.com/borkdude/babashka/blob/9661d8e3372e766046f22a6587050537b8b6a16f/examples/notes.clj#L21 There will probably be a babashka.hiccup or .html namespace in the future, but not there yet.
built-in hiccup would be cool. I think bootleg can be used as a pod for this in the meantime, yes?
true! a nice example of that is Gaiwan's site: https://github.com/lambdaisland/gaiwan_co#tech-stack
I’m doing something similar on my personal site - use clojure to dump a bunch of static files into a directory then serve them from gh-pages. Over the holidays I may have time to try and port the hiccup portions to babashka and switch over to that as my html/static file build tool https://matthewfors.com/decrypt-zcash.html
Not really, but I’d like to dig into it more. Only using it for that post since the library to perform some required cryptography is only available in rust + to play around with WASM
I have this thing you can use with babashka. It's written in Rust: https://github.com/babashka/pod-babashka-filewatcher