Sunday, November 06, 2005

Currently On Pause

This blog hasn't been updated for months because I'm too busy running a much more successful blog. Click on Teh Blogfather image ---------->

Wednesday, September 14, 2005

Syntax Is Religion: Convert Or Die

Amongst all the things you can do wrong when designing a programming language, choosing poor syntax is probably the most fatal. Syntax is what programmers first notice when they come across a language, it is what they keep noticing as they write code, it is what they must verbalise when discussing code...it is holy.

I've spent (or a cynic might say, wasted) the last 3 years of my life designing a programming language because I was sick and tired of using languages that sucked, but didn't suck my way. Apart from being an extremely lonely, and very mentally taxing exercise, it has taught me tons of things, including majestic phrases like parametric polymorphism, which make sound more intelligent than I really am.

The biggest lesson of all however, is that designing good syntax is hard. So hard in fact, that there only two major categories of syntax that all major languages fall into: in the red corner, weighing six hundred and ninety pounds, Curlyyyyyyyyy Braceeeeeeees!!...and in the blue corner, weighing two hundred and thirty pounds, Begin EeeeeeeeX End EeeeeeeX!! (and the crowd goes wild). The red corner has languages like C, C++, Java and C#. The blue corner has languages like Ada, Lua, Python and VB.

So what is good syntax? Programmers from the two corners have been duking it out ever since dinosaurs could order KFC for lunch. Because people are people, there is no clear answer to that question. However, if you are going to design a new language, you must remember the most holy of truths: syntax is religion - either convert to the red/blue corner or die in obscurity.

Thursday, September 01, 2005

The Answers In The Machine: Part 6

[Read Part 5]

Suzanne: But why did you do it? I was helping him!

She kept on talking in order to draw DOM7's attention away from the fact that she wanted to make a run for it. The door handle turned but the door wouldn't open. She needed to enter the combination on the keypad.

DOM7: He was a rogue...had no assigned role, so he had to be...like I said - put out of commission.

Suzanne fumbled along the keypad, trying to enter what little part of the number her panicky mind could remember, and speaking loudly to mask the responsive "beeps" that came with each key press.

Suzanne: Why? Why not just assign him a role? He is after all programable, no?

DOM7: Protocol, lady, protocol. He could have been owned before I got to him, and protocol says we don't take any risks.

Suzanne: Owned?

DOM7: Hacked and cycle-washed. The digital equivalent of being brain washed and subjected to mind control.

DOM7 was pacing around the room, occasionally looking out of the window as if he was waiting for someone or something to show up. The rain had turned to a light drizzle now.

Suzanne: Don't you feel any remorse over this?

He suddenly stopped and sharply turned his face towards her. Suzanne's throat quickly went dry as a jolt of fear flowed up her spine. After a long pause, DOM7 spoke.

DOM7: Some machines are programmed with that emotion - I am not one of them. When they tell me to annihilate? I ask two questions: how many and how fast.

He said it with a perverse pleasure. At 6 feet tall, with acid-stained reconfigurable armour plating and a wrist-mounted tripple-barrel cannon, DOM7 had definitely been created to do nothing but destroy.

Suzanne: I suppose you are going to ki-...put me out of commission too, huh?

DOM7: Kill you?...

He went and looked out of the window again. Suzanne had only managed to get to the fifth number of her thirteen digit combination.

DOM7:...No lady, I'm the calvary. And besides, where would the fun be? You wouldn't stand a chance!

Suzanne temporarily forgot her fear and her blood boiled. If she had her yellow pad, she would have scribbled in "cocky" right next to "cheeky" for this client.

DOM7: I mean take a look at your buddy DDX5 there. You saw how I sang him a lullaby then put him to sleep - permanently.

DOM7 was clearly enjoying himself, more than his rather rigid face plating would allow him to express. If ever an ego could be encoded in binary, then whoever wrote DOM7's Human Interaction Code had certainly cracked it.

Suzanne: Oooooh, I am soooo impressed, big man!

She tried to conceal her disgust as she keyed in the tenth digit of the combination. Three more and she would be able to leave the literally nauseating atmosphere created by DOM7's presence in the room.

DOM7: Aaah, sarcasm. That I am definitely programmed to handle.

Suzanne: You had to be good at something, otherwise you would be an awful waste of metal.

DOM7: Ouch! You know, for a moment there, I thought you liked me. Oh, by the way - had any luck with that door lock yet?

Suzanne went ice-cold and her eyes blared open. Adrenalin sent her body into over-drive. She quickly keyed in the last 3 digits of the combination, opened the door and made a run for it.

...to be continued...