Skip to content

Instantly share code, notes, and snippets.

(ns demo.core
(:require [clojure.core.typed :as t]))
;; Map vs Vector AST representation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; * Maps
(t/defalias M (t/U '{:op ':if :test M :then M :else M}
'{:op ':do :e1 M :e2 M}
@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@darconeous
darconeous / kidde-interconnect.md
Last active April 1, 2024 03:02
kidde-interconnect

Original "dumb" smoke detector interconnect sounds the siren on all interconnected smoke detectors when a 9-to-12 volt (referenced to neutral/white) direct-current signal is continuously present on the signal wire (red). This still how pretty much all interconnected smoke alarms indicate a fire condition.

However, modern interconnected detectors are capable of detecting carbon monoxide and other conditions. When these conditions are signaled, they must be identified as something other than a smoke alarm by the other detectors. Ideally, any dumb smoke detectors

@ghadishayban
ghadishayban / vendor_asm.sh
Created February 12, 2018 01:46
a script that vendors asm and writes itself as git commit 'transaction data'
#!/bin/bash
# author Ghadi Shayban <gshayban@gmail.com>
set -e
if [ -z ${1+x} ]
then
echo provide an asm git sha / ref
exit 1
fi