Skip to content

Using tap> #231

Open
Open
@practicalli-johnny

Description

@practicalli-johnny

In my quick googling I didn't find the reasoning behind adding tap?
usually there is some specific reason behind adding any new thing, often because the new thing would be unlikely to be added well or safely with the new feature. It seems that tap is something anyone could add to their system if they needed it. Is it because tap is required for making some other cool thing work?

My sense is that tap> is "plumbing": something that adds value in core because then all tooling can rely on it. It's very low-level (and quite primitive) by design, as far as I can tell. I've found it useful when firing up a process to add a Socket REPL (JVM options) and then connect to that port and (add-tap println) and anything my app sends to tap> shows up in that console (without impacting any other logs or REPLs I may have connected). I can imagine various tools adding their own taps to display, log, or visualize data. There's a "taps" tab in REBL but it's currently not wired up (and I heard it may disappear which I think would be a shame: I think it's a good example of usage). All that said, I'd love to here from @Alex Miller (or Stu or Rich) about how it came to be.

Overall, 1.10 strikes me as a big push for tooling even tho' that's not either of the "two major areas" stated in the release news item (improved error reporting and Java compatibility). Between prepl, datafy, nav and the "tap" system, it seems like it is laying the groundwork for some potentially awesome tooling in the future...

Alex just clarified on the mailing list: "tap is a replacement for using pr for debugging - libraries generally shouldn’t be using it indiscriminately.

If you do have multiple things putting values into tap, they can tag their values appropriately."

re REBL, the tap stuff is not going away, it's going to get wired up so you can see tunneled tap values!

Create examples of using tap> for exploring data and debugging

Cursive
https://quanttype.net/posts/2018-10-18-how-i-use-tap.html

Add examples to clojuredocs
https://clojuredocs.org/clojure.core/tap%3E
https://clojuredocs.org/clojure.core/add-tap
https://clojuredocs.org/clojure.core/remove-tap

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions