Show HN: Easy intro book to Clojure and immutability
getprogrammingwithclojure.com
getprogrammingwithclojure.com
After seeing this discussion we changed the unscrambling animation--it's not a rotation anymore but simply a replacement. Let us know. Also, the amount of time we let people read unscrambled content is limited. Maybe it needs to be longer?
We keep trying ideas that we hope will please our readers; sometimes we are going to fail.
This is part of a "Get Programming" series by Manning, which means that the reader is guided from concrete to abstract until the ideas are fully integrated.
This book takes a pragmatic down to earth approach:
- Lots of code snippets in each Lesson
- Several exercises at the end of each Lesson
- A Capstone Project at the end of each Unit
The book is in MEAP (Manning Early Access Program) stage which means that for now only the digital version is available and 5 out of 16 Units are published. (When a new Unit is published, the reader gets notified.)
Hopefully you'd find interest in this book whether you are a Clojure beginner and want to learn the basics of Clojure in a structured way or a Clojure experienced developer and want to help your friends or teammates in their Clojure journey.
I am very interested in hearing comments (in particular improvement suggestions) both about the approach and the realisation.
Unit 1: https://docs.wixstatic.com/ugd/8165fc_a165a000ec444796b7e63c...
Unit 1: https://docs.wixstatic.com/ugd/8165fc_a165a000ec444796b7e63c...
A guide is needed for interfacing with Java beyond simple method to dot notation interop that only works for the simplest of cases and only with well designed libraries that exposes clean APIs. Most significant projects in Java are built as massive frameworks with all sorts of weird tooling and dependencies. E.g. Minecraft Forge, Android Dalvik. Clojure has this 'small libraries good, big frameworks bad' mentality and expects everyone to be of high calibre software developers. You have to start somewhere and if you are not an Java developer experienced in wrangling with JVM intricacies then anything interesting can't be done with Clojure. You have to spend weeks on the IRC and mailing lists in the hopes of finding someone who either cares to help you with your problem or just builds the bindings for you. The company driving Clojure development (Cognitect) is small so I suppose their hands-off approach can be excused. But the community really need to pick up the slack for users coming to Clojure who are not experienced Java Devs. E.g. Go/C++/Common Lisp developers who wants to integrate a application written in JRuby and built with a custom Groovy Gradle build script with Clojure. For Java this is very common use case since it's the lowest denominator in the JVM. But good luck for Clojure. There is a huge need for a good book on this. Most Clojure books are generally: how to reinvent a web framework, 101 ways to process a text file using Clojure concurrency features and sequences with a dose of functional programming.
Clojure's error messages (or JVM stack traces for better or worse) are infamously terrible compared to similarly "hip" languages like Elm and Rust that have wonderful error messages. (Version 1.10 improved on this area though there's still plenty of room to grow to reach Rust-level of developer UX) It would also be nice to let users know early on when starting to use the language that Clojure libraries needs minimal maintenance and are almost always completely reverse compatible. (Whether this really is good practice or not when most large software projects are 'evergreen' with 'living documentation' is besides the point. A white lie to users won't hurt anyone. It would be terrible if a person reading a blog post on constraint solving in Core.Logic realizes it hasn't seen a major update in 3 years, gives up on Clojure, and ends up using miniKanren in Python instead.)
I myself would be interested in writing something like this, but I am not sure that enough people would want to buy that? Would YOU buy that book if it was available today?
Looks like a very good and up-to-date guide to the JVM for Clojure developers.
Did anybody else have a similar experience?
Though when I learned Clojure, I was already familiar with Java and much less so with Javascript. Probably as a result, Clojurescript actually feels much more complicated to me.
The problem is: Once an ecosystem is stagnating or on the decline it's a huge risk to enter this space. It's not just your own market value you might be destroying, it's hard to find resources and to scale development.
Besides this, what I really want is strong competition between lib authors in order to keep the ecosystem evolving. Even current blockbusters like React face problems in this regard, like the react-router monopoly where maintainer Michael Jackson buys competitors from the market to keep his leadgen machine running. I know this is OT but a language without a huge OR trending ecosystem is worthless.
I know some high-profile people have left the language for various reasons, but there are lots of people I know personally who are joining it. We should expect some churn.
I won't try to convince you that it isn't stagnating, but I want to put out an alternate perspective from someone who is investing a lot in the ecosystem.
Anecdotally speaking, I'm not sure I agree that the Clojure ecosystem is stagnating (it's relatively small and likely always will be) but a big draw of ClojureScript is the way it piggy backs on the Node/NPM community.
I recently spun up a React/Reagent UI paired with a Clojurescript node.js server. I was pleasantly surprised how easy it was to do ClojureScript <--> JS interop in Shadow-Cljs projects.
I understand it was never meant to supplant Java or C#, but I tried to look up how to set up tooling and most of what I found was very out of date.
My team uses it almost exclusively. I know Walmart uses it a lot, they even maintain a GraphQL open source framework for it. There's other medium to small shops that are either using it or exclusively using it.
I'm trying to publish new guides on my blog. So I'm interested in the out of date setup you found. Can you link to some, it would be nice to see what kind of content you were looking for and if I can put out an updated version. Cheers!
The Tools page under ClojureScript site doesn't mention Sublime Text 3 or VS Code at all (in typing this I realize Emacs would probably be the most common editor while working with a lisp like Clojure...). https://clojurescript.org/tools/repls
LightTable hasn't been updated in forever, but they're cognizant of that and are working on it.
Clojure on Windows is apparently still in alpha state. Out of curiosity, do you work on Mac or Linux? https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Wind...
The repl.it Clojure instance is very old, but that's not unique to Clojure.
Clojure looks to be a very good language, and I enjoyed playing with it a few years ago, and I understand it's improved a lot since then, especially in error handling, which is why I bounced off back then. I was just worried it was more like Objective-C (an apparently declining language with a clear successor) than Rust (a small but passionate community). Good to hear it's still going strong!
Which is made by the author of book. The link was under https://clojurescript.org/community/resources.
Clojure certainly not a widespread like Java, Python or Go, but it is also certainly not dead. A bit niche perhaps.
What and why they move then ? What they value ?
Beauty vs pragmatism ?
Pure static typing vs gradual typing ?
Pure backend vs universal stack ?
On top of that, Clojure ecosystem is a lot more stable than Js. Library APIs don't keep randomly changing, there isn't an explosion of frameworks. My team has been using Reagent/re-frame for the past 4 years, and it just works. Whenever a new version comes out we just bump up the dependency.
What's more interesting is that Reagent is built on top of React, and React itself went through many breaking changes over the years. Yet, Reagent API remained stable throughout that time. I think that's a testament to how well it was designed from the start.
I did see people move to say Scala, Clojure, Kotlin, Rust, Go, F#, Erlang and the likes, which are arguably other mainly backend languages and ecosystems.
Edit: For front end yes. Like I myself know JavaScript/HTML/CSS and use ClojureScript as well for frontend work. I understood your question more as if any backend dev had moved to using Node.js. away from more traditional backend systems.
I would love to code Scala across the board but the value proposition that frontend frameworks provide is too compelling to ignore -- code splitting/lazy loading, strong UI support (via Ionic), fantastic tooling (VS Code + Angular CLI), standard app structure, etc.
Now the backend is a fairly dumb API that just shovels JSON to/from database with some Akka messaging mixed in here and there for websocket based content.
Never would have imagined leaving Scala.js, which is amazing in its own right, but the vast majority of frontend work has migrated to Typescript for a reason.
From the Show HN guidelines:
> If your work isn't ready for people to try out yet, please don't do a Show HN.
There is clearly no way to try out this book. The "Show HN:" prefix should be removed from the title so that this post can belong to the list of regular posts.
The intention of the "try out" guideline is to make sure that the work actually exists and that people can play with it to get an idea of what's there. It's not intended to force Show HN projects to all be free.
Unit 1: https://docs.wixstatic.com/ugd/8165fc_a165a000ec444796b7e63c...
It's user-hostile, why did you think this was a good idea?
That said, it's pretty evident that Manning and PragProg have taken the lead in tech-book publishing that O'Reilly ceded when they went to all-subscription for their e-book offerings.
When you self publish, that aspect is easier. You simply do what you think is best, listen to the audience, and make it better whenever possible. Now I'll shamelessly put a link to samples of my Clojure book here. It is not competing with the OP's Clojure book, since mine is about Deep Learning and high performance computing. I simply put several chapters as PDFs for free, and if you like it, you can subscribe to the whole book (still a WIP, so you get drafts as they are written).
https://aiprobook.com/deep-learning-for-programmers/#downloa...
Of course, this requires manual maintenance, something that I can do, but is too much hassle for big publishers that have to deal with many books and even more readers at the same time.