This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-26
Channels
- # announcements (10)
- # asami (15)
- # babashka (200)
- # beginners (48)
- # calva (56)
- # cider (6)
- # clara (2)
- # cljs-dev (18)
- # cljsrn (6)
- # clojars (3)
- # clojure (23)
- # clojure-czech (2)
- # clojure-europe (41)
- # clojure-germany (5)
- # clojure-italy (19)
- # clojure-nl (5)
- # clojure-uk (8)
- # clojurescript (60)
- # clojureverse-ops (5)
- # cursive (14)
- # datomic (6)
- # events (1)
- # figwheel-main (5)
- # graalvm (17)
- # honeysql (2)
- # instaparse (1)
- # integrant (9)
- # jobs (5)
- # music (2)
- # off-topic (37)
- # other-languages (1)
- # pathom (10)
- # proletarian (5)
- # quil (3)
- # reagent (39)
- # reitit (4)
- # remote-jobs (3)
- # reveal (6)
- # rum (9)
- # shadow-cljs (27)
- # vrac (3)
- # xtdb (5)
What methods and tools do people use to explore medium size clojure data (small enough to fit in memory, large enough to be unwieldy for pprint)? Some options I can think of: • portal • REBL • reveal • graphviz • pprint • treemaps • foldable/collapsible trees
Usually I output to a .edn
file and inspect it programmatically (with bb
, jet
or just in a JVM REPL)
@U04V15CAJ, are there any typical patterns you use when you programmatically inspect (eg. keys, vals, some other common functions)? I do use the repl to programmatically inspect, but it can be annoying when you try to look at a value and get a mountain of text.
Part of the reason I'm asking is that I'm considering building better tools for this use case.
and there are also some data shapes that circumvent those types of restrictions (eg. a 2d array of 10x10 elements)
I have:
(defn truncate [s n]
(subs s 0 (min (count s) n)))
As part of trying to upgrade my work flow and tooling, I have a project that exposes a dev
namespace where I can put dev utlities. eg.
(require 'dev)
(dev/truncate s 20)
And I have a :dev alias that adds the project to my classpath.Isn't this what people use the 'user
namespace for? I've never really used it as such though
yea, I guess I could have my dev project add the utilities to 'user
. still experimenting.
You could be very evil and intern those vars into clojure.core
which is how some tools achieve "injections"
yea, I've thought about that. having a very short ns is also pretty close.
A +1 for Reveal in general. pprint
if I need it in logging.
I often just sit at the repl with (def x some-big-data)
and build a big arrow expression
Most of the time I use "foldable / collapsible trees" that Chlorine already have
When the data is too complicated, I use reveal
And when it's too big, too nested, and I probably care a lot about a subset of fields, I use a "custom command with a specific renderer" on Chlorine, that's a feature that I'm aware is poorly documented 😢
I've been using Cider's inspector to great effect recently https://docs.cider.mx/cider/debugging/inspector.html