Fork me on GitHub
#announcements
<
2024-03-25
>
valerauko04:03:02

Released sleepydog 0.2.0, now with #C05M8GRL65Q support https://github.com/StudistCorporation/sleepydog/releases/tag/v0.2.0

๐Ÿ• 7
๐ŸŽธ 2
rafaeldelboni15:03:25

Hey folks I've been a year rewriting http://clojuredocs.org in my free time just for study purposes and personal portfolio, but now I feel that it reached an state to show and get some feedback. I had two main goals when I started this project, one was to be easy to update and add different libraries to the site and the other was to empower companies to fork and easily use it for they private documentations. https://docs.clj.codes / https://github.com/clj-codes/docs It still has rough edges, a lot bad decisions that I took alone, it's far from battle tested and is running in a hobby http://fly.io pod with only 512mb of ram, so probably after this post it could die with more folks using it ๐Ÿ˜ฌ But I would love to have some feedback about it and open it for contributions.

4
๐Ÿ‘ 13
๐Ÿคฏ 4
clojure-spin 25
๐Ÿš€ 6
๐Ÿ™ 5
metal 7
๐ŸŽ‰ 30
catjam 6
martinklepsch15:03:37

Very cool! How would you compare the goal of this to those of http://cljdoc.org? cljdoc has some limitations (requirements) like that the artifact needs to come out of a Maven repo, is that one perhaps?

rafaeldelboni15:03:06

The idea was more the social aspect of clojuredocs, where you can post your own example, notes and see alsos, I don't know if you can do this with cljdoc. And for extraction it uses clojure.tools.deps for downloading the libraries and uses clj-kondo for extracting the analysis. For now I don't parse the markdowns of the documentations, I just use kondo's data to create the data

clj-kondo 3
martinklepsch15:03:32

Gotcha, that makes sense, thank you!

martinklepsch15:03:09

There's no user-contributed notes on cljdoc indeed

rafaeldelboni15:03:36

You can use tools.deps for the libs, but there is a gotcha, you need to use git libs for declaring the lib, because is a way that I found to generate source code links

martinklepsch15:03:47

interesting. I think in cljdoc it matches the namespaces to files in the git repo and creates the source links that way

martinklepsch15:03:41

It uses some heuristics that aren't 100% guaranteed to be correct but so far I think it worked for 99.9% of cases

rafaeldelboni15:03:45

I found the day that I had to create this requirement haha https://clojurians.slack.com/archives/CHY97NXE2/p1679674195357359

phronmophobic15:03:35

This is really neat! I have a project called dewey that runs clj-kondo analysis on all the clj projects I can find on github once a week, https://github.com/phronmophobic/dewey/releases. I was recently thinking about adding another step in the pipeline that feeds the analysis into datalevin and includes that as part of the weekly releases. I'm much better at making data pipelines than creating frontend webapps: โ€ข https://cloogle.phronemophobic.com/doc-search.html โ€ข https://phronmophobic.github.io/dewey/search.html Might be interesting to combine forces if you're interested.

๐Ÿ†’ 3
martinklepsch15:03:26

We've considered clj-kondo for cljdoc a few times but sticked to tools.analyzer because it will also correctly capture vars defined by macros

rafaeldelboni15:03:56

@U7RJTCH6J I used dewey to select the first libs for the site yesterday @UL618PRQ9 showed me when I asked for help to find the most stared clojure libs, it's super useful

rafaeldelboni15:03:18

Yeah, I want to review all the data pipeline, it's the thing I didn't thought much, I would be super keen to entirely rewrite or use another source, do you have a way to identify that a repo is a library in someway?

phronmophobic15:03:12

> do you have a way to identify that a repo is a library in someway? A library as opposed to an application?

yes 1
phronmophobic15:03:38

I don't do any filtering. I just include it if it's a clojure repository.

phronmophobic15:03:23

Even for most applications, most clojure namespaces are generally reusable so I'm not sure excluding whole repositories makes sense.

phronmophobic15:03:56

It might be interesting to be able to sort functions using some combination of relevance and usage.

๐Ÿ†’ 1
phronmophobic16:03:56

Like if a var is used outside its namespace or project more, it's maybe more likely to be relevant.

phronmophobic16:03:42

That's the kind of stuff that might be interesting to include either in a data dump or datalevin dump.

phronmophobic16:03:08

Every var could have a precomputed :stats/num-usages attribute (or similar).

rafaeldelboni16:03:55

Makes total sense, I think kondo has something in the analysis to find about the function usage, but would be limited to the project itself

phronmophobic16:03:09

Right, but you can combine analyses to derive stats across the whole ecosystem.

wow 12
โค๏ธ 9
๐Ÿš€ 1
phronmophobic16:03:15

This visualization is for namespace requires, but you could do the same for var-usages.

martinklepsch16:03:41

wow that is very cool

Ludger Solbach17:03:31

I really like that.

Max17:03:19

Itโ€™s so great that people are working on this area! One of the things I miss most about the Haskell ecosystem is Hoogle. Not only could you search for functions in the standard library by name or type signature, but it was also very easy to generate your own hoogle site based on your build. Pretty much every company Iโ€™ve heard of using Haskell just internally publishes a custom Hoogle based on all of their dependencies, and since itโ€™s based on their build, it works whether those deps are public or private. Adding community-generated docs just takes that to a whole new level!

โ˜๏ธ 1
lread20:03:08

@U050TNB9F > We've considered clj-kondo for cljdoc a few times but sticked to tools.analyzer because it will also correctly capture vars defined by macros This is true, but the only reason we don't also offer clj-kondo static analysis is that I did not finish the feature!

๐Ÿ˜„ 1
lread15:03:48

For the curious, here's a bit more on cljdoc API analysis: Cljdoc currently uses dynamic analysis to discover a library's public API. This means namespaces are actually loaded, so any parts of the API generated at load time are included. Because dynamic loading requires the namespaces to successfully load, it does not always succeed (sometimes there are optional dependencies, sometimes a library depends on a specific JDK or fails to load in some JDK versions, etc). Static analysis using clj-kondo has the advantage that it only examines the source code, doesn't load any namespaces, and only parses the source code. But as @U050TNB9F mentioned, it will miss dynamically generated vars (although it does understand and compensate for potemkin import-vars). While adding static analysis to cljdoc (a WIP), I started https://github.com/cljdoc/cljdoc/issues/543#issuecomment-1694509643, which might be of interest.

๐Ÿ‘ 1