Programming
Python Standard Library Expansion Debate
The Python community is moving towards expanding its standard library, a notable shift from previous years where such proposals were met with significant controversy. This indicates a potential change in the core development philosophy regarding the inclusion of new modules and functionalities direc…
Emacs Lisp Command Converts CSS-in-JS CamelCase Properties to Standard CSS
This Emacs Lisp function processes a selected region of CSS-in-JS style lines, where properties use camelCase and values may contain quotes or commas. It uncamelcases property names (e.g., 'backgroundColor' to 'background-color'), trims and cleans values by removing quotes and replacing commas with …
Go-Powered Lua REPL with JSON IPC and Unsafe Function Support
Implements a Lua REPL in Go using github.com/aarzilli/golua/lua, communicating via JSON messages over stdin/stdout for commands like 'eval' and 'reset'. Custom print handler captures and formats Lua output as JSON; enables unsafe pcall/xpcall by renaming globals for callback tolerance. Handles expre…
Node.js Fails to Reclaim Unused Heap Memory After Explicit GC
In Node.js v0.12 with --expose-gc, loading and transforming a large Babel browser bundle consumes 430 MB heap, which drops to 19.8 MB immediately after gc(). However, heapTotal remains fixed at 240 MB while heapUsed slowly increases over time without further allocations. This demonstrates V8's heap …
Node.js Manual GC Effectively Reclaims Massive Heap Allocations of Object Arrays
Node.js script allocates 20 million empty objects in a loop, spiking heapUsed from ~3.5 MB to ~782 MB. Explicit gc() call then reclaims nearly all allocated memory, dropping heapUsed back to ~3.4 MB consistently across repeated cycles. Demonstrates V8's garbage collector handles large, short-lived o…
CSP Channels Replace State Machines for Sequential RPC Client Buffering
js-csp channels enable a concise, generator-based implementation of a client that buffers requests to a single-threaded RPC math worker process, avoiding explicit state variables and queues. The core loop awaits ready signals, serializes requests via channels, and dispatches responses without manual…
Ruby Keyword Arguments Are 9x Slower Than Positional Arguments, Hash Arguments 4x Slower
Benchmark by Shopify CTO Tobi Lütke compares Ruby method calls with positional arguments, keyword arguments, and hash arguments over 1 million iterations. Positional arguments complete in 0.176s real time, hash arguments in 0.795s, and keyword arguments in 1.677s. Keyword syntax imposes the highest …
Racket Implementation of Conway's Game of Life with 2htdp Universe Animation
This Racket code implements Conway's Game of Life using 2htdp libraries for a grid-based cellular automaton. It defines cell and board structures, neighbor counting via bounded iteration, and applies standard survival/birth rules: live cells survive with 2-3 neighbors, die otherwise; dead cells birt…
Implementing Lisp cons, car, cdr in JavaScript with Pure Functions
Cons constructs a pair by returning a selector function that applies its argument to the pair's components. Car and cdr extract the first and second elements by passing selector functions that return a or b respectively. The implementation supports nested pairs, demonstrated by cons(1, cons(2, cons(…
Go MySQL Driver Fails to Scan DATETIME into time.Time
Tobi Lütke's 2012 Gist demonstrates a scanning error in Go's database/sql with the go-mysql-driver when querying a MySQL DATETIME column into a time.Time variable. The driver returns []uint8 instead of a scannable time.Time, causing "unsupported Scan pair" error. This highlights early limitations in…
Tobi Lütke's Simple Ruby Class for Graceful Periodic Task Scheduling
Forever is a lightweight Ruby class that schedules recurring tasks via Thread.new loops checking elapsed time against a timespan, executing blocks only when due. It supports multiple independent timers through an array of threads and blocks on all joins in run() until an external INT signal sets $do…
Minimalist Equation Evaluator Using Scoped Eval with Math Context
eq.js provides a tiny function to evaluate mathematical expressions from strings, injecting a vars object and Math namespace via 'with' statements in eval for access to constants like PI and functions like cos, floor. It handles errors by returning NaN and supports direct expressions without vars. T…
JavaScript Utility for Precise Date Range Selectors in Reporting
This CoffeeScript function generates start and end timestamps for common reporting periods like Yesterday, Last 7 days, This Week, Last Week, This Month, and Last Month. It resets the current date to midnight, computes boundaries using millisecond offsets for days, and derives month starts/ends by m…
JavaScript for-loop closures capture shared variable reference, not snapshot values
In JavaScript, functions created inside a for loop share the same lexical scope for the loop variable `c`, so all closures reference its final value rather than individual iterations. This behavior occurs because JavaScript has function-level scope, not block-level, causing unexpected outputs when i…
Minimal JavaScript Test Framework with Inline Execution
Tobi Lütke's Gist presents a compact, self-contained JavaScript test runner that executes in a browser environment. It defines a TestCase constructor that iterates over an object of test functions, invoking assertions like assertEqual and assertNotEqual, which track success and failure counts via co…


