On the immiscibility of higher order functions and unboxed invocation in Clojure

Recently, Tim McIver and I set out to bring clojure.contrib.import-static into the modern world. This is lib that looks on the surface to be quite handy: (import-static java.lang.Math sqrt PI) allows you to write (sqrt PI) instead of (Math/sqrt Math/PI). The huge downside is that sqrt is a macro, so it can't be passed around as in (map sqrt (range 10)). (This does allow (with appropriate hinting) primitive invocation (non-boxed passing of primitive JVM types such as long and double) and reflection at compile-time instead of runtime.) Our idea was to replace import-static with def-statics, a macro that could produce prim-invocable functions instead of macros.

Summary: You can't actually do that. HOFs in a dynamically-typed language are not compatible with unboxed primitive invocation.

Read more

How to move personal publishing to the desktop

You can do everything "in the cloud" these days, from blogging to posting photos to running servers. Most impressively, you can now also lose control of your files and personal information with unprecedented ease, or simply lose it, period. This is exactly the worst possible feature for the personal publishing use-cases of cloud computing. Possibly the most distressing aspect of cloud-based publishing is that it firmly designates the intangible network as the primary resting place of one's data. (I will note here that this aspect is itself what I am using to define "cloud computing" for the purposes of this blog post.) If the first place you put your creations is some hosted service on the great wide interwebs, you're playing with fire.

Read more

Emacs quick start: One n00b to another.

I recently got started using Emacs, and I was surprised to see just how bad most of the quick-start guides are. Most lacked the basic commands and definitions that beginners really need. This is my attempt to do better. I'm a n00b myself, so there won't be much explanation, just a basic overview, some useful starter commands, and links to proper tutorials.

Read more