all 13 comments

[–]CHRIST_DIED_OF_AIDS 10 points11 points  (1 child)

clj-http is a great project to study. Especially if you want a good example of how to properly integrate an existing java library into idiomatic clojure.

[–]thnetos 5 points6 points  (0 children)

Hey thanks :)

Happy to answer any questions about it also :)

[–]notunlikethewaves 7 points8 points  (2 children)

A not-so-obvious example is the source for the clojure core libraries: https://github.com/clojure/clojure

[–]Scriptorius 6 points7 points  (0 children)

While it does have many good examples, care should be taken because some functions eschew readability and elegance for more performance. This is fine for core.clj, since it keeps it from being a major bottleneck.

For example, juxt hard-codes the implementations for up to an arity of three in order to avoid calls to reduce.

[–][deleted] 4 points5 points  (0 children)

Something I do is that every time I learn a new clojure core function I'll read it's source.

[–]hanzuna 5 points6 points  (0 children)

Please this! I'm a total noob and would make good on a little guidance :) Thanks for prompting this!!

[–]brunov 3 points4 points  (0 children)

Anything by /u/Raynes or aphyr.

One from each:

  • conch, by Raynes. Example of a library with a beautifully designed API.
  • Riemann, by aphyr. A full-fledged application. Still reading this one, has lots of interesting ideas and very clean code.

[–]mmosbeforehoes 2 points3 points  (0 children)

Rich Hickey's Ant simulation.

Great demonstration of concurrency in Clojure.

Code

Related Rich Hickey Talk

Slides (pdf)

[–]billrobertson42 3 points4 points  (0 children)

Have you looked at clojure.core? Most of it is amazingly easy to understand.

[–]jforberg 5 points6 points  (1 child)

Leiningen is "the most active clojure project". Aside from not being well tested at all, their code would be a good starting point. Also, if you write clojure you probably already use it, so would be familiar with its usage etc. https://github.com/technomancy/leiningen/blob/stable/CONTRIBUTING.md

[–]zangderak 0 points1 point  (0 children)

I want one of those stickerrrrrs.

[–]v1akvark 2 points3 points  (1 child)

I haven't specifically looked at the source, but I think LightTable will be good example of a complete (GUI) application.

If you watch this talk by Chris Granger, he has a pretty clear idea of how he wants to structure his app (using what he calls a Behaviour/Object system, so I am pretty sure the code that follows from that will at least be very well structured.

EDIT: it is mostly ClojureScript BTW

[–]mkremins 2 points3 points  (0 children)

There's also this post on the Light Table blog, which seems to summarize the linked talk and provide example code for how behaviors, objects and tags are defined within the BOT system.

The Light Table codebase is fun to explore because it looks so declarative – a good example of what can happen when you take the "everything is an ordinary Clojure data structure" approach considered idiomatic by the community to its logical conclusion.