Go concurrency patterns in core.async: pipelines and cancellation

I came across a post on the Go Blog describing Go patterns for task pipelining and cancellation. I haven't got a lot of experience with core.async, so I thought I'd have a go at translating the Go patterns to Clojure. I won't rewrite all the prose from the original…

Get your :advanced mode on with the closurecompiler-externs npm module

I recently wrote a post on why you will have trouble compiling your node.cljs project with the :advanced optimization mode. Basically the problem is that the Google Closure compiler is not aware of the node standard library, and therefore it won't preserve the standard library symbol names. Eg the…

How to leverage npm modules in your next node.cljs project

npm, the official node.js package manager, is arguably one of the reasons why node has been so successful. The ability to easily pull in libraries from the internet provides a strictly more awesome developer experience as we know from using Leiningen to manage dependencies for Clojure projects. In your…

Why isn't my node.cljs app working in :advanced mode?

The ClojureScript github repo has two node sample applications. One of them is a trivial Hello World app (nodehello.cljs). The other one is a slightly more complicated app that recursively lists all the files in a given directory (nodels.cljs). The nodels app has this comment on the first…

ClojureScript optimizations on Node - huh?

A key design decision early on in the development of the ClojureScript compiler was to leverage Google's Closure compiler for optimizing the generated JavaScript. The Closure compiler is able to optimize both the size and efficiency of a given JavaScript project by doing whole-program analysis of the source code. The…

Find your node.cljs bugs with source maps

Have you ever gotten a JS stack trace from your CLJS code? They look something like this: $ node hello_world.js hello world .../hello-world/hello_world.js:14006 throw Error("fail!"); ^ Error: fail! at Error (<anonymous>) at hello_world.core.fail (.../hello-world/hello_world.js:14006:9) at…