On Tables and Relations

The best tool we have in computing is the relation. We have exactly two ways of representing a relation. One is a function. The other is a table. What could be more clear than this: Table 1: Cats NameMarkingsDisposition Abbyblack and whiteskittish Happyblack and whitetalkative Cookiecalicowarm Benblackpaternal The programming language Prolog is explicitly relational. We would represent the preceeding table in Prolog explicitly with the following code: »

Daniel K Lyons

Daily Programmer Intermediate #125 - “Halt” Simulator in Prolog

This is an implementation of Intermediate Challenge #125, “Halt! It’s simulation time!” The crux of the problem comes down to a table of virtual machine instructions like this: Instruction Description AND a b M[a] = M[a] bit-wise and M[b] SET a c M[a] = c JZ x a Start executing instructions at index x if M[a] == 0 I came up with the virtual machine abstraction, a 5-tuple machine with values for code, instruction pointer, instruction count, register values and whether or not the machine is halted. »

Daniel K Lyons

The Great Emacsification of 2013

First, Some Backstory When I first started getting serious about Unix around the turn of the century I got really hard into Vim. In 2003 I had already had my first glimpse of RSI so I switched to the Dvorak keyboard layout and bought myself a beautiful Kinesis Ergo keyboard. For some reason I decided this would be a good time to switch to Emacs, so I did. I never really achieved the fluence I had with Vim after switching from Emacs (though I did lose what I had with Vim). »

Daniel K Lyons

Why ORM Divides Us

The old ORM chestnut is back and we’re seeing the usual mixture of defenders and aggressors. But why is there such a divide? The argument is fundamentally about choosing what’s in charge of your system, the system being composed of your databases, your applications, and your supporting infrastructure (your scripts, your migrations, etc.) To relational database folk such as myself, the central authority is the database, and our principal interests are what ACID exists to provide: concurrent, isolated, atomic transactions that cannot be lost, on top of a well-defined schema with strong data validity guarantees. »

Daniel K Lyons

Statement on Sexism in the Workplace

The cat’s out of the bag; the reason why there are fewer women in computer science has finally gotten out. And what a predictable reason: rampant, uncontrolled, pervasive sexism. The only thing surprising to me about this is the sheer number of episodes. Something like four incidents leading to news stories on high-profile sites like Reddit and Hacker News. Pleasantly, there have been a lot of people saying the right things. »

Daniel K Lyons

Free your technical aesthetic from the 2010s: A rejection of the rejection of the 1970s

James Hague wrote a wonderful, vaguely controversial essay “Free your technical aesthetic from the 1970s.” I’m refusing to comply, for two reasons: Those who forget the past are doomed to repeat it I hate unnecessary optimism I think James would agree with the notion that it is too easy to get complacent. Computing, after all, did not emerge from Babbage’s garage with an Aqua look ‘n feel. The road leading to today had a lot of bends, twists, blind drops and dead alleys. »

Daniel K Lyons

A Heretical Calculus

If you took calculus in school, you probably remember it as a blurry mismash of baffling equations, difficult algebra, many seemingly irrelevant “real-world” examples and overall confusion. The blame for this is usually left squarely on the academic establishment, who are certainly at fault, but there is more to it than that. What is calculus? The word “calculus” is actually a generic word for a mathematical system. There are lots of other calculii; computer science has lambda, pi and join calculii. »

Daniel K Lyons

Good for Whom?

The very first item in Dan Ingall’s esteemed Smalltalk introduction “Design Principles Behind Smalltalk” is this: Personal Mastery: If a system is to serve the creative spirit, it must be entirely comprehensible to a single individual. Most of the other points Dan makes in this essay are well-served by modern Smalltalks, and apart from a few glaring outliers, even by other modern systems that are not remotely connected to Smalltalk, but this one item in particular stands out to me as the most criminally absent. »

Daniel K Lyons

Juxtaposition in Programming Languages

Juxtaposition is an interesting operator. I’m aware of no language in which this operator can be redefined by the user. I’m referring to simple placement of two tokens next to each other, such as “x y.” In the vast majority of languages, this operation has no meaning at all. For example, in Python: >>> 2 + 3 5 >>> 2 3 File "<stdin>", line 1 2 3 ^ SyntaxError: invalid syntax In a few languages, strings juxtaposed are conjoined. »

Daniel K Lyons

A Short Program in J

Inspired by James Hague and waiting for a new release of Cuis I thought I might sit down and noodle with J. See if I get any further than I did last time. So, I recently wrote a trivial Markov chain algorithm for Smalltalk. The code is pretty short, so I’ve included it at the bottom of the post. Rub your eyes on it after we talk about the J code. »

Daniel K Lyons