D
David Nolen
swannodette.github.io · Personal blog · on HN since 2013
David Nolen, lead maintainer of ClojureScript, writes about ClojureScript, immutable data structures, CSP-style concurrency, and the design of JavaScript UI frameworks.
What HN saysCommenters say he and James Long are a few steps ahead of the industry and unusually productive. His immutability post is cited as a clear explanation of the benefits.
98HN people shared it
65linked it in comments
62stories submitted
3.1Kstory points
1 year agolast shared
2013people per year2026
Most-shared posts
- 1The Future of JavaScript MVCs23 people · 567 points · first shared 2013 · 156 comments on HN
- 2Mori: Clojure's persistent datastructures in vanilla JS14 people · 8 points · first shared 2013 · discussion on HN
- 3Communicating Sequential Processes10 people · 269 points · first shared 2013 · 76 comments on HN
- 4ES6 Generators Deliver Go Style Concurrency (2013)7 people · 42 points · first shared 2013 · 12 comments on HN
- 5ClojureScript 1.7: ClojureScript can compile itself6 people · 544 points · first shared 2015 · 106 comments on HN
- 6Comparative Literate Programming (2013)6 people · 75 points · first shared 2013 · 1 comments on HN
- 710,000 Processes5 people · 2 points · first shared 2013 · discussion on HN
- 8JavaScript Modularity Shaming4 people · 141 points · first shared 2015 · 68 comments on HN
- 9Logic Programming is Underrated4 people · 126 points · first shared 2013 · 27 comments on HN
- 10CSP is Responsive Design4 people · 28 points · first shared 2013 · 1 comments on HN
- 11Functional Programming Is A Scam4 people · 26 points · first shared 2013 · 6 comments on HN
- 12Google Closure module support in ClojureScript4 people · 21 points · first shared 2015 · 1 comments on HN
- 13Time Travel4 people · 16 points · first shared 2013 · 1 comments on HN
- 14ClojureScript 1013 people · 178 points · first shared 2013 · 42 comments on HN
- 15A Closer Look at Transit3 people · 122 points · first shared 2014 · 36 comments on HN
What HN people wrote when they linked it
Davertron · 2017-01-30
David Nolen - http://swannodette.github.io/
James Long - http://jlongster.com/
I follow these guys for similar reasons. They always seem to be a couple steps ahead of the rest of the industry and it's frankly a little embarrassing how productive they are. Come to think of it maybe I'd feel better about myself as a programmer if I stopped following them...
mfikes · 2017-02-21
I'm astounded by the pace of progress. It was only mid-2015 that ClojureScript first self-hosted [1], roughly year ago when it was stable [2], and mid-2016 when I had first heard that Google Closure runs in JavaScript [3], and now this.
Bravo António! Keep up the great work. :)
[1] http://swannodette.github.io/2015/07/29/clojurescript-17
[2] https://twitter.com/mfikes/status/702243790225068032
[3] https://twitter.com/swannodette/status/752957621204692992
davidgrenier · 2016-08-11
In other words futures are not as composable as one would hope.
John Reppy's CML seems like a much better toolbox which gets composability without pretension. Vesa Karvonen (whom I understand has worked on the MLTon compiler) has offered an excellent delivery in Hopac for C# and F# complete with a slew of combinators: https://github.com/Hopac/Hopac
I'm not aware of anyone offering an alternative superior to an informal CSP yet which seems to be the reason why Go and Clojure have picked it as well for their concurrency model.
See David Nolen's excellent blog posts on the matter:
http://swannodette.github.io/2013/07/12/communicating-sequential-proce…
http://swannodette.github.io/2013/08/17/comparative
krcz · 2014-10-28
Great project. Like more complex version of 99 Bottles of Beer for the client side web apps.
I wonder why Om version has not been submitted though:
http://swannodette.github.io/todomvc/labs/architecture-examples/om/
jimmyhmiller · 2014-09-23
Assuming you are referring to immutability in general, this post does a great job of showing the benefits.
http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
mudetroit · 2014-07-21
It's worth noting that Om uses React internally[1]. React, like almost every tool out there, can work very well when used appropriately, or poorly if use in appropriately.
[1] http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
malvosenior · 2014-05-13
I understand that there are sometimes practical reasons for not being able to use ClojureScript, but have you given it a go? It's really very, very nice (much nicer than JS in pretty much every way).
* Immutable data (you can get some of this in JS with Nolen's Mori http://swannodette.github.io/mori/)
* Better functional programming than Underscore (map :mykey some-objects)
* Great syntax: homoiconicity, thrush operator, first class set, regex, map, vector syntax
* Macros!
* Use of cool frameworks: Om, core.async
* Same language as back-end if using Clojure
It was quite frankly intimidating to get started with it all as an ex-Java/Obj-c/Python/JS dev but I could never go back.
juliangamble · 2014-05-05
David Nolen (@swannodette) has been doing some great work in Om with ClojureScript and React. In addition to the links posted - this is a link on why ClojureScript's data structures (functional with structual sharing) make implementing undo trival in Om http://swannodette.github.io/2013/12/31/time-travel/ and this is a link on data binding in Om with :instrument http://swannodette.github.io/2014/02/27/taking-off-the-blindfold/
nickik · 2014-01-16
> instead of vanilla JS in a project you want contributed to
Not sure what this means? If there is a existing project, it would probably be better to do JS. If you start a new project, or you want to change the language then you move forward with the new language and slowly replace or just keep using the old JS.
> (Oh, am I tired of Promises)
Insted of just adding Await and Defer, when you switch to ClojureScript, you will get full CSP semantics, full first class channels, essentially what Go offers on the server.
Check out this blog, it mostly talks about the difference between different ways of front end programming, callbacks, CSP and so on: http://swannodette.github.io/
calroc · 2014-01-15
Um, as long as you're asking ME what to do...
Node.js should vanish (except for where it is already deployed and useful, in maintenance/legacy mode) and all those really smart and talented people currently wasting their time on it should go build something even better and more useful.
There. How's that? ;-)
(Like this: http://swannodette.github.io/)
aidos · 2014-01-13
Great introduction - really well written, enjoyable to read. I read an article about clojurescript / om / react [0] the other day which piqued my interest - this is the first tutorial I've gone through on Clojure.
The api actually feels pretty similar to Python (eg rest-param ~= args) so it mapped over nicely for me. I studied functional programming some years ago and have tinkered with the like of erlang in the past so none of the concepts you presented felt too foreign.
I might be going insane but it looks like you have a typo in there - 'whether the ;; the part's name'*.
Kudos, again.
[0] http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
noelwelsh · 2013-12-23
Here's an article typeset in Computer Modern that was recently on the HN frontpage: http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
Great article, but ZOMG is the typesetting atrocious! Look at the kerning between F and u in Future, and a and S in JavSscript. So, so bad.
Knuth's contribution to typography was great for its time but with so many excellent free fonts available we have moved beyond the need for Computer Modern.
vithlani · 2013-12-20
http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
https://docs.google.com/document/d/1P3BLR31VA8cvLJLfMibSuTdwTuF7WWLux7…
Q.E.D
Get your core model and concepts right, everything else follows.
swannodette · 2013-08-15
Yes a thousand million times. This is the reason why people love golang and why there's a lot of excitement about core.async in the Clojure community, particularly for ClojureScript where we can target the last 11 years of client web browser sans callback hell:
http://swannodette.github.io/2013/07/12/communicating-sequential-proce…
Having spent some time with ClojureScript core.async I believe the CSP model actually has a leg up on task based C# F# style async/await. We can do both Rx style event stream processing and async task coordination under the same conceptual framework.
pizzeriafrida · 2021-04-06
Since this thread/Clojurescript is getting some love I'd like to express something to a hopefully receptive audience:
There was a point where Clojurescript and Javascript sort of walked hand-in-hand during the advent of when React started to make sense in the minds of the community[0].
It felt really exciting because of the cross pollination that was happening between the two languages, Redux felt very familiar, and we have re-frame for clojurescript.
There was a ton of promise with Apollo.js and an improvement on the `connect` functionality by upgrading to a proper query language for getting state into a component versus wrapping functions around multiple `state.some.path` `state.some.other.path`.
David Nolen built om.next around that very idea, it was basically Apollo.js lite, and it was very exciting scientifically but never quite caught on because maybe it was a little clunky. But using datomic pull query syntax to fetch state for use in a component was thrilling. (if you got this far and decided you hate me and your eyes are rolling so hard I get it lol)
And this was all years ago now. All that excitement and progress and effort seems to have been trapped inside of Typescript, and React hooks, and did everyone forget?
0: https://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs…
lewisl9029 · 2015-11-22
I agree that it sucks when the "worse" technology wins, but your points on why React is an example of one of these "worse" technologies are seriously misinformed regarding its shortcomings and have largely glossed over some of its most significant merits over existing technology.
> React seems to be designed to ignore 40 years of accumulated software best practices.
Best practices in software is not set in stone. Sometimes you need to break from existing best practices of the past in order to arrive at truly powerful new approaches to solving problems that may not seem intuitive at first, but eventually manage to redefine best practices through their technical merits.
The Virtual DOM and re-rendering on every change is one such approach popularized by React, but it's definitely not the only one, nor is it even the most significant one, in my humble opinion.
Before React, mutable models was the only game in town. Angular imposed mutable models, Ember imposed mutable models, Backbone imposed mutable models, your average custom ad-hoc JQuery framework probably also imposed mutable models. Everyone blindly followed this "best practice" simply because this was the status quo ever since the earliest days of UI development.
React is the first JS UI framework that does not impose a mutable model. And as a result, the ClojureScript community was able to build on top of it and show the world that change detection can be implemented as a constant-time reference comparison when…
mambodog · 2015-03-21
I recommend reading swannodette's The Future of JavaScript MVC Frameworks[1], which was the article which first got me to try React, after earlier passing it by. This meant I was coming to React via good examples of how to use it in an optimisable way, already thinking about reference equality of the props I was passing, and whether changes within state object structures were observable in my application (mutation vs copying etc).
Now that React has had a large recent influx of new users, hopefully these key concepts are not lost in the deluge of new blog posts and demo applications. Those who are championing React within groups and organisations should try to make sure developers who are more passively following are made aware of such useful ideas. Javascript (and software engineering in general) has a long history of collectively forgetting important ideas only to rediscover them later, but it would be better to be proactive than to leave it up to the archeologists.
[1] http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
dkarapetyan · 2015-01-29
I completely agree. When viewed from the right angle almost everything is a combination of some "VM bytecode" and a "compiler" targeting that bytecode. Greenspun's tenth rule applies to anything large enough. That's not what I'm getting at.
What I'm getting at is that when you have a bunch of problem solvers well versed in programming language design and theory the programming language at that point is no longer relevant. Standard Chartered doesn't have all that software because Haskell somehow gave them superpowers. Standard Chartered has all that software because a bunch of PhDs chose Haskell to write it in and along the way Lennart wrote another compiler because why not, the man is good at it. So instead of being a case study in how to apply a functional language to solve problems this is really a presentation about what kind of people you want to hire to build systems, i.e. PhDs, MScs, and MDs (apparently).
Imagine if the title of this post was "PHP in the large". Would anyone take it seriously? Does anyone really believe PHP is a great language to build large systems in? No, everyone would immediately jump on the fact that all of it is running on HHVM and there are bunch of smart folks optimizing the hell out of it. Same here.
The metapoint here is really a quote by Rich Hickey from a David Nolen talk/blog post - "Not everything is awesome". There are few hidden gems in the presentation when concessions are made by including Any type and re-inventing a lot of Erlang…
BenoitEssiambre · 2014-11-13
They use a mostly functional subset of javascript (You are not allowed loops). It is much more readable than scheme if you ask me but not necessarily more powerful. You get the benefits of the very powerful and ubiquitous javascript compilers that exist nowadays which I like.
I played with it and you are somewhat limited right now. The first issues is that you quickly hit the top of the javascript stack because of the recursive style (remember: no loops). The most elegant solution to that would be for browsers to support tail call optimisations which is in the ES6 standard (Are you listening Mozilla or Google? If you implement this part of the spec sooner you could be leading the way for the most promising area of AI and maybe of computing in general). Although there are possible work around namely if the webppl compiler were to use trampolines or "promise" like structures. IMO, it would clutter the code and be much less elegant than native ES6 TCO.
The second limitation is that you are not allowed mutability. There is a git branch with support for mutability partly implemented. I'm not sure they should go that way though. I've never really been into functional programming style but in the case of probabilistic languages, I really see the value. It's much simpler and easier to follow what is going on when debugging. Supporting mutability also makes the compiler more complex and memory usage high as you have to copy the whole memory footprint of your program at each…
kylebrown · 2014-06-17
I'm real curious about the potential interplay between core.async and om/react. Bruce Hauman has a great tutorial on using core.async channels (as opposed to event callbacks) to process user input and gestures.[1] David Nolen (creator of Om) also covered core.async.[2] But these tutorials pre-date Om; core.async came to clojurescript in summer 2013, Om wasn't released until 2014.
I guess the way React handles input is by attaching event handlers to child components, so that changes to the child properties bubble up to the root component state. Is this the optimal pattern for handling events in a React app? Or is there an advantage to be gained by using core.async channels to process event input for Om/react?
I haven't seen any examples which use both core.async and Om/react, but I'm very curious about the possibility.
1. http://rigsomelight.com/2013/07/18/clojurescript-core-async-todos.html
2. http://swannodette.github.io/2013/07/12/communicating-sequential-proce…
graue · 2013-08-24
This is definitely some impressive performance. In Firefox 24 the core.async example is significantly faster than When.js on average (though in repeated trials, the running times vary over wide (and overlapping) ranges).
Some commenters seem to assume David's point is "use core.async because it's faster than promises". I don't think so. My takeaway from this post is that, having been persuaded core.async is awesome and will give me joy as a programmer (and see David's other posts for evidence of that, e.g. [1]), performance concerns should not prevent me from going for it, because it's competitive.
For me personally, Clojure and ClojureScript still have a long way to go to catch up with JavaScript-based development using Node.js and say, Angular. A smaller community, fewer libraries and less mature tools makes it kind of a bummer from a social perspective. I'm also not impressed with the Clojure/ClojureScript code-sharing story, which requires hacks[2] to use the same code on the client and server. Here, Node frameworks like Derby[3], which emphasizes sharing nearly all your code, and Airbnb's Rendr[4], seem light-years ahead.
But when you consider that this is an early release of a language and async lib written by a surprisingly small team, with basically no corporate backing, it's a pretty amazing accomplishment. I love ClojureScript in theory and I'm eager for the day when I can love it in practice too.
[1]…
refset · 2025-07-06
The thing that tipped me over the edge into learning ClojureScript was the news almost exactly a decade ago about achieving self-hosted compilation with eval [0] (kudos David!). In the end that specific capability was not quite practical enough for what I needed, but it proved a level of sophistication and maturity in the stack that has only increased since.
Today we also have sci/scittle/cherry for anyone who's seeking that runtime Clojure->JS eval vision. And now with Jank (LLVM Clojure) on the horizon this year it's never been a better time to try Clojure, regardless of which hosted runtime you're enthusiastic to use - Basilisp on Python, ClojureCLR, ClojureDart etc.
[0] https://swannodette.github.io/2015/07/29/clojurescript-17/
alexdowad · 2023-06-02
In the comments, swannodette promised a response blog post to this one. Here it is: https://swannodette.github.io/2013/03/09/logic-programming-is-underrat…
sesm · 2022-10-05
Another ‘React before React’ is webfui from ClojureScript world: https://github.com/drcode/webfui
When React was first released, general JS public was skeptical towards it, but ClojureScript community immediately embraced it. One of the early articles praising React for it’s performance was written by David Nolen: https://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs…
panick21_ · 2021-12-09
Immutable JS is from Facebook.
Mori is the 'original' Clojure data-structures in Java Script.
https://swannodette.github.io/mori/
tosh · 2021-07-05
afaiu core.async in Clojure and channels in Go are inspired by Communicating Sequential Processes (CSP)
https://swannodette.github.io/2013/07/12/communicating-sequential-proc…
https://clojure.org/news/2013/06/28/clojure-clore-async-channels
https://en.wikipedia.org/wiki/Communicating_sequential_processes
lrenn · 2021-06-23
Om came first, Cloact (eventually renamed Reagent due to an unfortunate similarity with a certain body part of a snake) came after it.
Here is the original HN post about Cloact:
https://news.ycombinator.com/item?id=7037038
You can see people comparing it to Om.
Here is a blog post of his from 2013 that mentions Om:
https://swannodette.github.io/2013/12/31/time-travel/
And yeah, Reagent "won" because it was way simpler but I'd find it hard to believe that it wasn't influence or inspired by Om.
davedx · 2018-05-24
I'm reminded of the Hacker News post that introduced me to React from David Nolen back in 2013, where he first introduced ClojureScript's take on React, Om:
http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs
Interested to take this for a spin.
JBiserkov · 2016-03-26
Om (a ClojureScript wrapper for React) does exactly this.
http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
j-pb · 2015-12-02
We were talking about java here. ^^ So python is offering a lot more already with it somewhat first class functions. What would you guess even? does, btw?
But sure, let's make things a bit harder.
As below, let's produce a sequence of the form [true false false true true true false false false false ...] of exact length 1000 without computing any more than exactly 1000 elements.
(take 1000 (mapcat (fn [i] (repeat i (odd? i))) (range)))
Of course the really interesting stuff is hard to do in one liners. But I think one of the more mind bending things is probably core.async. Go style coroutines and channels implemented as a library on top of the language. Which allows for concurrent programming inside clojurescript which is compiled to JS and thus inherently single-threaded.
http://swannodette.github.io/2013/08/02/100000-processes/