Fork me on GitHub

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 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


Maybe for now it's just a nice bonus that you can use clojure-csv as a lib


ah - so defprotocol is something that you are hammocking about then?


the docs and test look good to me :thumbsup:

Nate Sutton15:01:00

defprotocol would be so so nice to have, fwiw


defmethod is first on the list. I would likely just translate defprotocols to defmethod-like functionality

Nate Sutton15:01:14

I think including core libs in bb makes sense, stuff like data.csv and such


assuming that's possible, not sure, I didn't do any work on this yet


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 am not so sure about inclusion of core libs "because x was a core lib"


sorry mobile 🙂


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)


just my 2 cents 🙂


fwiw it's now possible to run clojure-csv as a library with bb on master (see #babashka_circleci_builds for downloads):

[email protected] ~ $ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {clojure-csv {:mvn/version "RELEASE"}}}' -Spath)"
[email protected] ~ $ rlwrap clojure -A:bb-local
user=> (require '[clojure-csv.core :as csv])
user=> (csv/write-csv (csv/parse-csv "a,b,c\n1,2,3"))