This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-21
Channels
- # announcements (24)
- # aws (2)
- # babashka (20)
- # beginners (147)
- # cider (20)
- # clara (43)
- # clj-kondo (3)
- # cljdoc (15)
- # cljsjs (1)
- # cljsrn (36)
- # clojars (19)
- # clojure (64)
- # clojure-europe (4)
- # clojure-italy (45)
- # clojure-nl (1)
- # clojure-spec (20)
- # clojure-uk (26)
- # clojurescript (16)
- # cursive (9)
- # datomic (18)
- # dirac (14)
- # docker (3)
- # fulcro (48)
- # keechma (1)
- # leiningen (32)
- # luminus (1)
- # off-topic (40)
- # pedestal (1)
- # quil (1)
- # re-frame (24)
- # reagent (3)
- # reitit (3)
- # remote-jobs (2)
- # ring-swagger (4)
- # shadow-cljs (115)
- # spacemacs (22)
- # specter (4)
- # tools-deps (76)
I ended up incorporating data.csv into babashka at some point (when it wasn't possible to run libs yet), but I just discovered that we've been using clojure-csv at work for a few years now. Not sure why one would prefer one over the other. Something around csv seems convenient to have in a scripting tool, but I could also remove data.csv as a built-in and add support to be able to run either library as an interpreted/optional lib. Any opinions? (cc @plexus)
run as optional lib sounds good to me - especially if you are unsure about inclusion. no idea about who might be already using it though.
if going the optional route, might be nice for folks to have a clear specific example for migration.
The issue with clojure.data.csv is that it uses defprotocol
which is not (yet) supported in bb, so it can't be an interpreted lib. Same thing with cheshire and clojure.data.json
https://github.com/borkdude/babashka/commit/55ff698908b01f3161bb72ab68d95572307883e2
defmethod is first on the list. I would likely just translate defprotocols to defmethod-like functionality
I agree that it's convenient, but since I'm not a hard-core user of data.csv vs clojure-csv, it's hard to make informed choices there. but the difference doesn't seem that big to make a big deal out of it
i think there are some things that jvm clojure in retrospect would prefer not to have had bundled
at any rate, if it turns out x is actually used widely, then i think that might count as a significant factor toward inclusion
right. I've chosen cheshire over data.json, because it seems to be the defacto lib in the community (although that may still be a subjective judgement)
fwiw it's now possible to run clojure-csv as a library with bb on master (see #babashka_circleci_builds for downloads):
borkdude@MBP2019 ~ $ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {clojure-csv {:mvn/version "RELEASE"}}}' -Spath)"
borkdude@MBP2019 ~ $ rlwrap clojure -A:bb-local
user=> (require '[clojure-csv.core :as csv])
nil
user=> (csv/write-csv (csv/parse-csv "a,b,c\n1,2,3"))
"a,b,c\n1,2,3\n"
user=>