Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojure: What site to use to search for "Function that does X"

Tags:

clojure

  1. Suppose I wanted to find the sin/cos function. In haskell, I would fire up https://www.haskell.org/hoogle/ , search for "sin" or "cos", read the type signature, and be done.

  2. In Clojure, it seems the best I can do so far (for functions not in clojure.core) is to fire up google, and type in "clojure sin" or "clojure cos" -- then get a package about Quil/sin and Quil/cos -- and wonder

    2a. What is this Quil package? 2b. Do I want to pull in this package just to get sin/cos? 2c. Is there a "more standard" package that also provides sin/cos ?

==

Thus, my question, for functions where you almost certainly know the 'type signature' (which I recognize does not exist in clojure) or 'common name', what is the standard way to figure out "what common package do most clojureists use to get this function" ?

like image 447
eav db Avatar asked Oct 19 '25 15:10

eav db


2 Answers

Besides googling, don't forget to look at these sites:

  • Clojure Cheatsheet (I am always (re-)discovering new built-in functions I had somehow missed before)
  • http://www.clojure-toolbox.com/
  • https://crossclj.info/

When googling, also try out this trick when entering terms in the search window:

clojure parse site:github.com 

It restricts your search terms ("clojure" & "parse") to the URL you choose (in this case "github.com"), which can be quite handy sometimes. Google is nearly always much better than a site's built-in search engine.

UPDATE:

This book helped me a lot:

Google Hacks

like image 197
Alan Thompson Avatar answered Oct 22 '25 05:10

Alan Thompson


I have found https://clojuredocs.org/ to be very valuable to find examples of how to use a particular functions of clojure.core. There is http://clojure.github.io/ for "blessed" utilities.

Otherwise, your question does not seems very specific to Clojure. As you guessed, using google is probably a good start.

So I would say google for what you are looking for, then if you have several alternatives use any heuristics you want (count stars on github, number of downloads on clojars, ask other clojurists what they think - there is a great slack channel at http://clojurians.net/).

https://crossclj.info/ is a great site that allows you to search Clojure code in the wild. I found it invaluable to get inspiration.

There are some libraries repositories, although I tend not to use those:

  • http://www.clojure-toolbox.com/
  • https://github.com/razum2um/awesome-clojure
  • http://clojure.org/community/libraries (not the github search trick at the bottom)
  • http://blog.takipi.com/the-top-100-clojure-libraries-in-2016-after-analyzing-30000-dependencies/ (I find it amazing that clojurescript is "just" a Clojure library)
  • http://clojurewerkz.org/ and https://funcool.github.io/organization/ both have a nice set of libraries
like image 21
nha Avatar answered Oct 22 '25 05:10

nha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!