Hraness
Theme
Appearance

saved

Small Programs and Languages

by Dave Gauerratfactorpublished

Hraness wrote this summary from a saved copy of the source. Quotations are taken word for word from the source.

gist

Dave Gauer argues that tiny programs and small languages matter because a miniature proves a whole concept can fit in your head. His examples run from a 46-byte Forth to a 436-byte Lisp with garbage collection. Forth, Lisp, and Tcl pack great power into tiny cores, but he sides with David Ungar that simplicity trumps expressiveness, and ties the appeal to our love of miniatures.

ideas

  • Small code invites reading. Luke Jackson's 25-line ijk DOM library, Philippe Brochard's 46-byte Forth, Arthur Whitney's 122-line J interpreter fragment, and William Byrd's Lisp evaluator in Lisp all feel learnable because of their size.
  • Golfed programs record minimum complexity. Gauer ties code golf to Kolmogorov complexity: a business-card ray tracer or Justine Tunney's 436-byte Lisp proves how small the idea can be, so a readable version is worth studying.
  • Small languages usually trade away expressiveness. Assembly and SNOBOL are small but rigid; Forth, Lisp, and Tcl fit their syntactic core on an index card yet demand a shift in thinking, while Lua's language section runs 27 pages.
  • Simplicity beats expressiveness. He cites Ungar's regret over multiple inheritance in Self, and applies the same size trade-off to libraries such as Ramda and to microworlds with bundled docs and beginner-friendly errors.
  • Miniatures answer a need for order. Quoting Stephanie Langin-Hooper and Simon Garfield, he links tiny code to miniatures in general: a scaled-down world, like an offline computer, feels controllable and fully knowable.

quotes

“If I see that something is 200 lines of code, I’m much more likely to read it than if it’s 2,000 or 20,000 lines.”

Dave Gauer, on why tiny programs are approachable.

“That’s an actual fact about the minimum complexity of ray tracers.”

Dave Gauer, on a ray tracer that fits on a business card.

“So, simplicity trumps expressiveness.”

David Ungar, in his talk Self and Self: Whys and Wherefores, as quoted by Gauer.