Leaking II

Kartik Agaram pointed out that I haven’t mentioned what happens during the assignment of pre-declared variables in scope.

Here are a few scenarios. This first example signals an error, because a has no binding when print a is called:

def foo (b):
   a ← b

foo 15
print a

This example prints 15:

a ← 5
def foo (b):
   a ← b

foo 15
print a

Which seems acceptable —- but this also prints 15:

Read More

Leaking I

I’m designing a programming language called Tainted Oyster.

One thing I have to think about is how to set a variable in the current scope. The easy way is the straightforward way:

a ← 25

This pairs the value 25 with the symbol a, in the scope in which it’s written. (The cheap way to say that is, “Now a is 25.” Unfortunately, I’m kinda slow, and when I’m directly discussing the value bound to the same symbol in different scopes, little lies like “is” often trap me.)

But I want to be able to abstract-ify assignment; for instance, in writing the procedure def. def creates a function and assigns it to a symbol in the current scope:

def fib (val):
    if (val <= 0):
        1
        val + fib (val - 1)

For the moment, though, let me stick to a simpler example. Here’s the skeleton of a function that tries to set a to 5 times a number:

Read More

Programmers think differently than non-programmers.

or

Singers think differently than non-singers

or

Stuffed animal enthusiasts think differently than non-enthusiasts

Jacques Mattehij wrote a post [here] about the way programmers think. He argues that programmers are analytical, but so are scientists; programmers are logical, but so are mathematicians; programmers are obsessive, but so are artists (he says scientists again, but I like this example better). 

Anyone can learn to program, Jacques points out, so programmers are surely not born thinking differently than the rest of the world. I completely agree.

Therefore, he concludes, programmers think no differently than non-programmers. That’s absurd.

Read More

WhiteProxy

I get distracted very easily, and when I am looking up something important, I don’t like spending my willpower avoiding distractions: facebook, my email, comics, youtube, twitter —— all the ten-thousand things. 

What could I do? I wrote a little proxy server that block all content unrelated to the task at hand. It even takes the time to look up related words, so that it won’t block anything important. It also only gives me ten minutes of access —- plenty of time to open some documentation, not enough time to open 50 tabs of vaguely related journal articles.

I don’t recommend using this all the time —- sometimes free association hyperlinking is very valuable —- but when the job needs doing, I don’t need distracting. So I threw together WhiteProxy.

Theme