This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-01
Channels
- # announcements (21)
- # architecture (6)
- # aws (18)
- # babashka (14)
- # beginners (231)
- # boot (1)
- # calva (2)
- # chlorine-clover (22)
- # cider (34)
- # clara (16)
- # clj-kondo (53)
- # cljdoc (5)
- # cljs-dev (22)
- # cljsrn (3)
- # clojure (283)
- # clojure-europe (24)
- # clojure-italy (9)
- # clojure-nl (5)
- # clojure-spec (5)
- # clojure-uk (57)
- # clojurescript (14)
- # core-typed (8)
- # cursive (4)
- # data-science (11)
- # datomic (41)
- # docker (24)
- # duct (2)
- # emacs (2)
- # exercism (29)
- # fulcro (96)
- # graalvm (4)
- # jobs-discuss (1)
- # kaocha (53)
- # lambdaisland (20)
- # malli (5)
- # nrepl (4)
- # observability (7)
- # off-topic (40)
- # pathom (44)
- # pedestal (8)
- # re-frame (19)
- # shadow-cljs (58)
- # spacemacs (2)
- # sql (9)
- # tools-deps (15)
- # vim (3)
- # yada (10)
$ ./bb '(with-open [os (.ByteArrayOutputStream.)] (bencode/write-bencode os {"greeting" "Good morning"}) (str os))'
"d8:greeting12:Good morninge"
ClojureScript podcast episode about babashka and the Small Clojure Interpreter: https://twitter.com/borkdude/status/1245286719240404992
I'm working with Fulcro which requires its network traffic to be encoded in transit. This prevents me from (easily) using restclient.el to test api endpoints. Would it be possible (I assume after having written some non-trivial emacs lisp) to replace restclient.el with a combination of babashka, babashka.curl, and jet? I understand I could do this in clojure but I don't want to have to connect to a clojure repl. I want to write my queries in edn, have them automatically converted to transit, and then have the response decoded to edn and pretty-printed. Does this make sense? Is this feasible?
Sorry if this is a weird question, but is there a way to make the cljs.pprint
namespace available to code running inside SCI?
@deep-symmetry what about:
cljs.user=> (require '[cljs.pprint :as pprint])
nil
cljs.user=> (sci/eval-string "(pprint (range 30))" {:bindings {'pprint pprint/pprint}})
(0
1
2
3
4
5
Ok, something like that could work, I was aiming for cl-format
but could bind that. Is there a way to bind the namespace so the hosted code can require it if they want it, though?
Or does tree-shaking make that an impossible idea?
cljs.user=> (sci/eval-string "(require '[clojure.pprint :refer [pprint]]) (pprint (range 30))" {:namespaces {'clojure.pprint {'pprint pprint/pprint}}})
(0
1
2
?Ah, cool. So as long as I enumerate the functions I want, they get copied down, perfect.
As an aside, SCI is proving a perfect weapon in my effort to induce someone to learn a little Clojure. 😉