Skip to content

Instantly share code, notes, and snippets.

View modernserf's full-sized avatar

Justin Falcone modernserf

View GitHub Profile
@modernserf
modernserf / 1.naive-immutable-record.js
Last active August 23, 2019 22:00
Immutable Records with value equality in JS
const lookupTable = []
export function record (fields) {
for (const storedRecord of lookupTable) {
if (shallowEqual(fields, storedRecord)) {
return storedRecord
}
}
const newRecord = Object.freeze({ ...fields })
lookupTable.push(newRecord)
@modernserf
modernserf / bestiary.md
Last active December 27, 2020 21:54
Syntax bestiary

Simple value literals

Numbers

syntax examples languages
decimal literals -123.45 (most languages)
scientific notation 1.23e-2
prefix hexadecimal 0xDEADBEEF
prefix binary 0b1110
prefix octal 0o777
outfit(Shirt, Pants, Shoes) :-
shirt(Shirt),
pants(Pants),
shoes(Shoes),
formal_coord(Shirt, Pants, Shoes),
texture_coord(Shirt, Pants),
color_coord(Shirt, Pants),
shoe_coord(Pants, Shoes).
formal_coord(Shirt, Pants, Shoes) :-
@modernserf
modernserf / forth.md
Last active May 13, 2018 23:01
Forth

The Forth Freedoms

Abstract

While programmers love talking about the virtues of minimalism and simplicity, each of us depends on a mountain of abstraction and complexity: build systems, package managers, deployment infrastructure, etc. But much like the suburbanite dreaming of a tiny house in the woods, we find ourselves wishing we could give up all the tools and best practices and work "close to the metal." Could we live without garbage collection? Built-in data structures? Variable names?

These are the principles of Forth, a radically minimalist programming language. This talk explores my experiences in the Forth wilderness: how Forth embodies a computational "rugged individualism", and the peculiar freedom that comes from working with so little abstraction. We'll also discuss what drives people away from Forth, and how I have tried to integrate The Forth Way into my work when I returned to the creature comforts of high-level programming languages.

Details

@modernserf
modernserf / hypercard.md
Created April 13, 2016 15:30
The Origin of HyperCard in the Breakdown of the Bicycle for the Mind

The Origin of HyperCard in the Breakdown of the Bicycle for the Mind

Abstract

HyperCard was a programming tool for non-programmers that inspired much of the design of the early Web. However, the spirit of HyperCard -- the blurring of computer "use" and "programming" -- has been lost as the web has become a mainstream consumption-centric medium. This talk imagines an alternate timeline, where our tools have evolved to empower everyone and not just developers.

Details

This talk uses a similar retro-futuristic gimmick to Bret Victor's The Future of Programming, in which I take on the character of a programmer in 1991 speculating about the impact of HyperCard and its successors in 2016. (The slides are even done in HyperCard!)

@modernserf
modernserf / ark.md
Last active April 13, 2016 15:29
ARK and the tension between literalism & magic

ARK and the tension between literalism & magic

Abstract

Randy Smith had a vision for a stranger world: ARK, the Alternate Reality Kit. ARK was a visual, object-oriented programming environment in which objects are tangible: they're manipulated like physical objects, and connections between objects are visible.

TODO: this could be a talk about visual programming & the nature of abstraction, "the map is the territory", computing for children, etc. Maybe even get the Borges stuff in there

@modernserf
modernserf / snobol.md
Last active April 5, 2016 19:37
A SNOBOL's Chance

A SNOBOL's Chance

Abstract

"Now you have two problems." Regular expressions are a handy tool for processing strings, but they have a well-earned reputation for causing confusion. But they're not the only game in town: fifty years ago, SNOBOL offered a pattern-matching language that was both easier to use and more powerful than regular expressions. Its easy to imagine an alternate timeline where SNOBOL and its successor Icon fulfill the ecological niche that Sed and Perl occupy today. However, while SNOBOL and Icon have been relegated to historical footnotes, their visionary model of computation is still accessible in JavaScript with Parsing Expression Grammars and ES2015's generators. In this talk, we'll learn how to apply age-old parsing techniques to contemporary problems, and discover what the forgotten innovations programming past of have to offer.

@modernserf
modernserf / hotdog.md
Last active April 29, 2018 23:00
class HotDog extends Sandwich

class HotDog extends Sandwich

Is a hot dog a kind of sandwich? "Naming things" is one of the two hard problems in computer science, and the hot dog/sandwich argument is just like those we have about class hierarchies and database schemas. This talk explores these arguments through the lens of "prototype theory", a cognitive-linguistic framework that proposes that the categories we use subconsciously are much different than those we use in programming and other formal systems.

In this talk, we'll learn the psychological basis for practices like duck typing and composition over inheritance. We'll learn about additional conceptual models of organization, like radial categories and family resemblance. Finally, we will learn how by embracing fuzziness and context-sensitivity, we can make more humane and inclusive software.

@modernserf
modernserf / 1-talk.md
Last active April 13, 2016 15:27
"fifty points at random"

"fifty points at random"

Abstract

When does process become art? When do tools become collaborators? Let's explore the world of procedural art -- both analog and digital -- through the wall drawing of Sol LeWitt. This talk teaches how to make art in the style of LeWitt's wall drawings with CSS and JavaScript, and along the way provides some insight into the history of procedural art, the nature of randomness, and how tools and algorithms for creating art lead to new forms of collaboration.

Details

The title of this talk comes from a wall drawing made for the school of the Museum of Fine Arts in Boston:

@modernserf
modernserf / critter.md
Created March 6, 2016 22:22
Why is a Guinea Pig Like a Microservice?

Why is a Guinea Pig Like a Microservice?

Abstract

Functional state systems like Redux have made web development easier to reason about -- how can we apply these techniques to complex distributed systems? And what lessons from the distributed world can we bring back to web development? This talk explores concurrency models through the lens of a virtual guinea pig colony, and covers topics including actors, sagas, emergent behavior, and the unexpected virtue of object-oriented programming.

Details

In 2012, Gary Bernhardt was giving a talk called Boundaries, which explored a programming model he refers to as "functional core, imperative shell." Like many design patterns, this has been independently discovered again and again: this pattern is now becoming mainstream in the JavaScript world, particularly in the React ecosystem, and yet it bears a very strong resemblance to the actor model that Erlang has been usi