Fork me on GitHub
#clojure
<
2022-02-13
>
Akiz14:02:17

Hi, what tools would you use if you wanted to create a graph from your namespace that contains all your functions, their definitions and ideally their interdependencies?

p-himik14:02:29

I have a whole bunch of saved links to projects which I haven't really tried myself. Can share them if you want.

p-himik14:02:23

This in particular looks promising, although it doesn't include definitions: https://github.com/gfredericks/clj-usage-graph This does include definitions, although it's not just something that creates a picture - it's a whole local web app: https://github.com/jpmonettas/clograms

Akiz14:02:28

Thank you guys. I has a crazy idea today - create 3d vr scene i can walk through and think about my code. Hammock ocullus driven development 🙃. I already did some tests with A-frame and babashka

borkdude14:02:10

Sounds great :)

borkdude14:02:14

With the clj-kondo analysis, which morpheus also uses, you will probably be able to fetch the definition source as well, using the location information.

borkdude14:02:52

What you are doing here is also already available in clojure-lsp which has a call hierarchy (incoming and outgoing) with code navigation

borkdude14:02:54

but not in 3d

p-himik14:02:06

Would love to see a video of how the end result looks like. :) Even if it's just an experiment.

🙏 2
borkdude14:02:33

Me too :)

🙏 2
Akiz14:02:52

i was looking into clojure-lsp (as it use clj-kondo) before i asked here but i was not successful to communicate with it from clojure yet (via stdin/out and process). if you know any good examples i will be grateful.

Akiz14:02:20

Btw. “graph” was probably a really misleading word. I need some data structure (edn, json..) that i will parse into hiccup basically.

borkdude14:02:22

@U0522TWDA clojure-lsp also has a Clojure API, perhaps it exposes call hierarchy etc?

borkdude14:02:10

Else maybe just look into the code and do it yourself. It's based on the clj-kondo analysis data: https://github.com/clj-kondo/clj-kondo/blob/master/analysis/README.md

👌 1
Akiz14:02:29

@U04V15CAJ That may be all i need, thanks. @U2FRKM4TW Clograms looks cool. It reminds me some smalltalk ide 😉

Carsten Behring21:02:39

I think https://github.com/nextjournal/clerk does this before render the notebook.

🧑‍🎓 1
Akiz15:02:22

First step done… But my eyes are bleeding already 🥴. VR Development is kind of a masochism.

🎉 2