This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-06
Channels
- # adventofcode (99)
- # announcements (9)
- # aws (3)
- # babashka (22)
- # beginners (90)
- # boot (2)
- # calva (22)
- # cider (8)
- # clj-kondo (14)
- # cljsrn (20)
- # clojure (24)
- # clojure-europe (4)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (83)
- # clojure-spain (1)
- # clojure-spec (46)
- # clojure-uk (43)
- # clojuredesign-podcast (70)
- # clojurescript (40)
- # cursive (25)
- # datomic (9)
- # duct (3)
- # emacs (14)
- # figwheel-main (2)
- # fulcro (61)
- # graalvm (8)
- # juxt (7)
- # kaocha (2)
- # leiningen (19)
- # luminus (5)
- # malli (58)
- # off-topic (4)
- # re-frame (11)
- # reitit (5)
- # rewrite-clj (3)
- # shadow-cljs (63)
- # sql (5)
- # testing (5)
- # tools-deps (26)
- # uncomplicate (2)
- # vim (4)
We're starting our journey in that direction starting with the episode we're about to release today!
… because I built some simple toy transducers, and informally testing them with (time (…)) didn’t show an advantage over functions - but I guess, this view on the matter ist too narrow
Part of the challenge of keeping it practical is that reducers and transducers are a bit niche.
and, with transducers specifically, you can use them for Clojure core stuff with really having to know (or care) how they work.
So composition is a big deal, but the whole point of both of them is to separate out the computation from the underlying representation of the collection.
Reducing functions are useful in general. The reducers library doesn’t work in Clojurescript because it needs Java’s fork-join stuff.
I haven’t personally done a lot of benchmarking, but the bigger the transform (having a lot of steps), the faster it should run vs the equivalent thread macro version using sequences.
I suppose it’s worth saying that transducers are a great fit if you have some problem domain where you have to assemble different transforms before processing a seq.
I haven’t hit a concrete example of needing transducers yet, but I’m always looking for one.
@U0510902N (so this conversation shows up in your threads)
I’m just working on a musical subject, where transformations are a major thing (this was the main motivation to try a LISP, because it seems so very appropriate, and that lead - happyily - to Clojure)
after “Reducers!” I will come back with questions on XML, because of this one: https://music-encoding.org
I don’t know if I’d call processing XML “delightful”, but I think it’s about as delightful as possible in Clojure.
It’s the first usable music notation engine for the web; it understands music in the form of MEI XML
so this is the motivation (before I had tried to program such a thing with ClojureScript and SVG, but then found this engine
It’s been a pleasure chatting this morning! I’ve got to run, but feel free to post here or in the main channel. I’ll be back later.
Apologies for the late reply, but I'd love to help build an MEI parser because that would be super useful
Yes I thought it was pretty funny because I'm also building music training tools, but am still at the stage of attempting to write my own SVG rendering engine.
@U8LB00QMD maybe we should look at both options: parsing and using MEI/Verovio and thinking about “Music-SVG”
Sounds like a good idea. I set up a repo with a little starter app: https://github.com/porkostomus/mecca-mei Bonus: it uses transducers! I followed this article, and only had to change it to work in cljs: https://juxt.pro/blog/posts/xpath-in-transducers.html