Sunday, February 27, 2011

Almost Literate Syntax Trees

Suppose you're translating a lambda calculus expression like:
λxyz.xyz
into a Lisp-like syntax tree:
  (fun 'x
(fun 'y
(fun 'z
(apply
(apply (sym 'x) (sym 'y))
(sym 'z)
)
)
)
)
where sym expresses a reference to a symbol that is (or should be) bound in the current context.

If you replace fun with givenA and sym with the, the result looks like:
  (givenA 'x
(givenA 'y
(givenA 'z
(apply
(apply (the 'x) (the 'y))
(the 'z)
)
)
)
)
This exploits an English speaker's understanding that “a” introduces a term, and “the” refers to an occurrence of that term in the same context.

The second example reads better to me, but I haven't been able to come up with an everyday-English equivalent for apply. Maybe it's just not an everyday concept.

Saturday, February 19, 2011

God Lizard

When designing something new, nothing seems to matter more than getting the terminology right. If you don't name things precisely—one concept, one word—you're likely to confuse yourself. And if you don't name them concisely, people won't bother to use your terms, and they'll confuse themselves when they try to talk about what you've built.

The API designer's most important tool is the thesaurus. Which, contrary to what you might think, does not come from the Greek words for “god lizard”, but from the word for “treasure”.