Skip to content

Instantly share code, notes, and snippets.

View wildermuthn's full-sized avatar

Nate Wildermuth wildermuthn

View GitHub Profile
@wildermuthn
wildermuthn / my-clojure-post-mortem.md
Last active January 19, 2021 03:39
My Clojure Port-Mortem

This title is tongue-in-cheek, in that Clojure is obviously not dead, and among some sectors it is thriving. Yet overall, few people or companies I've introduced to Clojure are still using it, and although I spent 3 years using Clojure full-time, I haven't written a line of it in the last few years. And in the 2020 State of Clojure reports that use is shifting from small companies toward larger corporations. What we clearly see is that for all its core power and elegance, Clojure has not built up a correspondingly powerful ecosystem. Why?

After my most recent internal debate about "Why the hell am I not using Clojure again?", I had a clarification of thought: Clojure is not, as it describes itself, practical.

To explain why, I want to share two quotes that provide a sharp contrast: Rich Hickey's "Open Source is Not About You", and Russ Cox's keynote from GopherCon 2015

Russ Cox:

A language needs large, broad communities. >

@wildermuthn
wildermuthn / gist:651e0147168a82e7ce0c5bc8e0389f0d
Created January 6, 2018 20:28
Blockstack Browser verification
Verifying my Blockstack ID is secured with the address 1KnSXw1QrR1ZSzDq6pjPLy21iPEDuetqfH https://explorer.blockstack.org/address/1KnSXw1QrR1ZSzDq6pjPLy21iPEDuetqfH
@wildermuthn
wildermuthn / log.cljs
Created July 8, 2017 19:10
using ganymede with reagent
(ns client.tool-defs.log.core
(:require [client.tool-defs.log.elements :as el]
[client.widgets.form.core :refer [fdiv row pair header hr label
icon]]
[reagent.core :as r])
(:require-macros [ganymede.macros :refer [div]]))
(defn log-item
[opened-items data odd-i?]
(let [{:keys [nmsp msg line uuid level timestamp]} data
@wildermuthn
wildermuthn / elements.cljs
Created July 8, 2017 19:08
sample elements file using ganymede
(ns client.tool-defs.log.elements
(:require [client.widgets.button :as btn])
(:require-macros [ganymede.macros :refer [div]]))
(div container
:display :flex
:flex-direction :column
:align-items :stretch
:min-width 0
:flex "1 0 0"
@wildermuthn
wildermuthn / reagent-interop.clj
Created February 17, 2017 15:46
Reagent interop, the worst!
;; Interop is, holy hell, the worst. See below for a deep dive into r interop. If ever there was a case for Om.Next...
(comment
(def r-create-class-r-render
(r/create-class
{:r-render
@wildermuthn
wildermuthn / rotating-box.js
Last active March 26, 2016 18:19 — forked from nakosung/rotating-box.js
unreal.js rotating box
// Loads into Unreal, renders accordingly.
GWorld.GetAllActorsOfClass(Light).OutActors.map(l => l.DestroyActor())
function light(color) {
let actor = new PointLight(GWorld)
actor.LightComponent.SetMobility('Movable')
actor.LightComponent.Intensity = 1000
actor.LightComponent.SetLightColor(color)
return actor
;;; Should run datascript instance on main process (nodejs)
@wildermuthn
wildermuthn / macro.clj
Last active November 22, 2015 08:52
Define locally scoped functions with fewer parens
(defn anon-fn
"Should just use whatever #() uses. Limited at this point"
[body]
(let [arg1 (gensym)
arg2 (gensym)
body (cw/postwalk-replace {(symbol "%") arg1
(symbol "%1") arg1
(symbol "%2") arg2} body)]
`(fn [& [~arg1 ~arg2]] ~body)))
@wildermuthn
wildermuthn / command-pattern.cljs
Last active October 15, 2015 15:52
Porting OOP command-pattern in JavaScript to FP in ClojureScript
(defn calculator [init-value]
(let [current-value (atom [init-value])
ch (chan)
get-value #(-> @current-value
peek)
undo #(swap! current-value pop)]
(go-loop [{:keys [op data]} (<! ch)]
(let [f (case op
:add +
:sub -
@wildermuthn
wildermuthn / ganymede-preview.clj
Last active October 9, 2015 03:13
ClojureScript CSS Experiment — Replacing SASS/LESS
;;; Common Styles
(def modal-header-common
(css
:flex* [:center :center :row]
:overflow "hidden"
:font* [vars/bold vars/bold-size vars/white]))
;;; Elements