[HN Gopher] ClojureDocs - Community-powered documentation and ex...
___________________________________________________________________
 
ClojureDocs - Community-powered documentation and examples for
Clojure
 
Author : capableweb
Score  : 116 points
Date   : 2022-06-01 17:57 UTC (5 hours ago)
 
web link (clojuredocs.org)
w3m dump (clojuredocs.org)
 
| carlgreene wrote:
| I love this site. As a total Clojure-noob, seeing the different
| code snippets and approaches for solving problems in Clojure has
| been a huge help!
 
  | alexott wrote:
  | You can also look onto this book (still in progress):
  | https://www.manning.com/books/clojure-the-essential-referenc...
  | - it tries to explain the standard library with examples, etc.
 
| dgb23 wrote:
| This is a great resource, especially because of its killer
| feature: user provided examples.
| 
| Some of the more powerful or special purpose utilities in Clojure
| are much easier to grasp by looking at some examples.
| 
| The only thing that is potentially better is a very well
| maintained wiki, like the MDN docs. But that's a much bigger
| effort and only few wikis reach that level of quality.
| 
| Another cool thing about Clojure is that its core library and
| other parts of the language are quite small and understandable. I
| had quite a bit of fun reading and skimming the source, trying to
| understand things etc.
 
  | dan-robertson wrote:
  | I remember very fondly that the php documentation would often
  | have nice practical examples in the comments below the
  | documentation for each function.
 
| tosh wrote:
| One of the best things about PHP years ago was its documentation
| with user contributed comments. ClojureDocs is that for Clojure.
| The comments are gold.
 
| FraaJad wrote:
| There is also JanetDocs for Janet, which is inspired by Clojure.
| 
| [1]: https://janetdocs.com [2]: https://janet-lang.org
 
  | swlkr wrote:
  | Hey thanks for the shoutout!
  | 
  | JanetDocs turned out ok in the end, it's been running on janet
  | for years at this point, no hiccups to speak of really. (Please
  | be nice to the server)
 
| lobstrosity420 wrote:
| I'm about a third of the way into Clojure for the Brave and True.
| Highly recommend for starting out from zero. You can read it for
| free at https://www.braveclojure.com/clojure-for-the-brave-and-
| true/
 
  | olah_1 wrote:
  | I'm not a fan of books like that because it doesn't teach you
  | real-world usage. You can't be thrown into a standard clojure
  | project repo after reading that book.
 
    | lobstrosity420 wrote:
    | I mean you have to start somewhere though
 
    | capableweb wrote:
    | I used this book (+ others obviously) and I think it was the
    | best one around so far, for me at least. It does contain
    | exercises for you to solve specific problems, which is
    | helpful, but otherwise 4clojure comes closest I guess.
    | 
    | By the way, what languages have books that makes you go from
    | knowing zero to being able to jump into a standard X-language
    | project repository after reading through the book? Usually it
    | goes from "knowing nothing" -> "knowing a bit, solving small
    | problems" -> "solving bigger problems, maybe contribute to
    | small projects" -> "being able to contribute substantially"
    | -> "being able to own a project and lead it", and I know of
    | no (single) books that takes you across multiple steps.
    | Usually books focuses on one of the steps.
 
| chrisweekly wrote:
| Clojure(Script) holds so much appeal for me, checks ~all the
| boxes... I just wish it were more popular. Curious why it's not.
 
  | Deadron wrote:
  | The tooling is far from simplistic to setup and the available
  | options can be overwhelming. Its all the pain of the JS stack
  | but with less easily available help and tooling that produces
  | less helpful error messages.
 
    | didibus wrote:
    | I think the tooling nowadays is pretty simple to setup, but
    | the information out there doesn't speak to that new simple
    | way, so everyone starting is following something that pushes
    | them to outdated tooling.
    | 
    | Install Java:                   brew tap homebrew/cask-
    | versions         brew install --cask temurin17
    | 
    | Install Clojure:                   brew install
    | clojure/tools/clojure
    | 
    | Type `clj` at the command line and play with Clojure!
    | 
    | Now install VSCode and get the Calva plugin for Clojure from
    | the marketplace.
    | 
    | That's it. You'll have autocompletion, jump to definition,
    | code formatting and highlighting, linting, support for editor
    | integrated REPL, debugger, etc.
    | 
    | Then you can run:                   clojure -Ttools install
    | io.github.seancorfield/deps-new '{:git/tag "v0.4.9"}' :as new
    | 
    | And now you can create new projects from various templates
    | using:                   clojure -Tnew app :name
    | myusername/mynewapp
    | 
    | This creates a new basic application project for example.
    | Open it in VSCode and you can connect a REPL to it and start
    | working.
 
    | CraigJPerry wrote:
    | I don't think it's that                   $ npx nbb -e
    | (println "Hello, world")         Need to install the
    | following packages:           nbb         Ok to proceed? (y)
    | Hello, world
    | 
    | Or more comprehensively:
    | https://clojurescript.org/guides/quick-start
 
      | [deleted]
 
      | Deadron wrote:
      | Your example is missing anything actually related to
      | rendering a webpage.
 
        | capableweb wrote:
        | Unclear what "rendering a webpage" entails exactly.
        | 
        | If you want to do frontend development, you can give
        | shadow-cljs a try, the quickstart is pretty quick:
        | https://github.com/thheller/shadow-cljs#quick-start
        | 
        | If you want to just render server-side HTML, something
        | like compojure (HTTP routing) and hiccup (Clojure data ->
        | HTML) is pretty easy and quick to get started with (https
        | ://gist.github.com/zehnpaard/2071c3f55ed319aa8528d54d90..
        | .).
        | 
        | If you want to generate HTML files to serve with
        | nginx/whatever, you can just use hiccup and `(spit)` the
        | resulting HTML to files on disk.
 
  | BaculumMeumEst wrote:
  | It seems really nice to work with but investing in a niche
  | ecosystem that adds another layer of complexity on top of a
  | tall stack is a hard sell for me personally
 
    | didibus wrote:
    | That's a good reason. You are working above Java, JavaScript
    | and others, and that's often something that you need to be
    | aware of and the details of those layers leak in a little.
    | 
    | It's still worth it for me personally, but I recon the
    | additional challenge.
    | 
    | If you try babashka and nbb it won't feel as much of an extra
    | layer, but they're both interpreted, so expect only Ruby like
    | performance out of them. That said, it's a good way to get
    | started if you don't want an extra layer under Clojure.
 
      | BaculumMeumEst wrote:
      | I actually did learn Clojure on the JVM. I read two and a
      | half Clojure books, built a number of side projects, and I
      | worked as a Java developer for a few years so the JVM
      | wasn't an issue. But even with all that, building a web app
      | is far easier for me using Python/Flask, even with minimal
      | experience with the language or framework.
      | 
      | And if I want to build a web service, I reach for go
      | because it's faster and the memory footprint is much
      | smaller. I guess maybe if I was working on a super complex
      | project that justified using Clojure to build elaborate
      | abstractions, I would use it, but most of what I work on is
      | pretty straightforward.
      | 
      | ClojureScript I've avoided because I keep anything
      | frontend-related that I work on as dead simple as humanly
      | possible to avoid churn.
      | 
      | And babashka seems neat too but I'm already comfortable
      | with bash, and shellcheck works well.
      | 
      | It sucks but I just can't seem to find a good use case for
      | Clojure, even though I love the tooling and the language.
 
  | dgb23 wrote:
  | I'm torn about ClojureScript.
  | 
  | It is a layer of protection against JS madness, and just a
  | plainly better designed language. State management is much less
  | verbose and easier to reason about.
  | 
  | But it is hard to justify outside of SPA and for "in between"
  | use cases that for example Next solves very well.
 
  | slotrans wrote:
  | The Lisp Curse
  | http://www.winestockwebdesign.com/Essays/Lisp_Curse.html
 
| Borkdude wrote:
| Also check out:
| 
| https://github.com/oxalorg/4ever-clojure - clojure exercises in
| the browser
| 
| https://borkdude.github.io/re-find.web/?args=2%20%5B%3Aa%20%... -
| find clojure functions by example
 
| loevborg wrote:
| ClojureDocs is great. See also https://cljdoc.org/
 
| user3939382 wrote:
| If only Rich Hickey could time machine himself back to when they
| were about to decide for the first time to integrate JavaScript
| with the browser and replace it with ClojureScript...
 
  | lobstrosity420 wrote:
  | I don't have a good source for this but supposedly Brendan Eich
  | wanted to embed Scheme into Netscape, what a world that would
  | have been.
 
    | dgb23 wrote:
    | JavaScript was inspired by Scheme and Self. It's a wolf in
    | sheep's clothing in that way. But yes, a Scheme would have
    | solved so many issues and churn that we have to deal with.
    | However people are scared by Lisps so there's that.
 
      | aneil wrote:
      | Specifically, some manager at Mozilla was scared of it.
 
___________________________________________________________________
(page generated 2022-06-01 23:00 UTC)