April 22nd, 2004

  • evan

some thoughts on familiarity

I did a bunch more hacking on my toy programming language last night, but I'm not going to say anything more about it because it's totally vaporware. But it's fun to think about!

D has a few interesting ideas (I actually have some similar ones) but I can't help but think that language designers don't look at other languages much. Or maybe they just don't like them? It's hard to escape liking what you're familiar with, which makes innovation difficult.

Do you know the rules for C++ const? What's the difference between const char * and char * const? The answer is that the latter prevents you from modifying the pointer and the former prevents you from modifying the pointee (the char[s]); C++ reads from right to left. Why? You read pointers from right to left, too¹: char *p is a pointer to a char, not a "char pointer" (though we're comfortable with that phrase because we've used it so much). D's "easier declaration syntax" is still exactly backwards from the way you read it in English.

I keep thinking back to a post I wrote about currying a few months ago. I realize now that I completely missed the point. I know I was "smart" and capable about thinking hard back then, but somehow that just wasn't enough. I hadn't really realized how much working with OCaml so much has given me a new outlook on things.

1 This was probably motivated by the parser: the first token is a keyword, not a star.
  • evan


I just wrote this to the class list about fold. I'm never sure which parts are clear and which aren't, but the few students I've talked to seemed to understand things better once they saw the picture.

Collapse )