Behind house

You are behind the white house. Paths lead into the forest to the east and northeast. In one corner of the house is a small window which is slightly ajar.

> examine the window

The window is slightly ajar, but not enough to allow entry.

> open the window

With great effort, you open the window enough to allow entry.

> enter the house

Continue reading

Up a tree

You are ten feet above the ground, nestled among large branches. Beside you on the branch is a small bird’s nest. In the bird’s nest is a large egg encrusted with precious jewels, apparently scavenged by a childless songbird.

> take the egg

Taken.

> go down
> go south
> go east

Continue reading

Like me, on Facebook

Well here’s something I never thought I’d write in Fabulous Adventures in Coding when I started this blog more than ten years ago:

Today is my first day at Facebook.

It still feels weird to say it. But as it turns out, Facebook has a language design team and they have very generously asked me to be a part of it.

Now perhaps it is clear why I have been working frantically to learn OCaml for the last couple of months; several of Facebook’s compilers are written in OCaml, and so I’m going to need to have a working knowledge of that language very quickly. I figured that writing a Z-machine interpreter (and, spoiler alert, a debugger) in OCaml might be a good way to get some practice in while waiting to start on the real thing! And I figured that learning F# and then having to un-learn all the ways in which F# differs from OCaml would not serve my interests.

It is still not entirely clear what exact aspects of developer tools I’ll be working on. Facebook has a lengthy and intensive “boot camp” process to get new hires up to speed, so I’ll be heads-down on that for the next eight weeks or so – which is another reason why I wanted to have a lengthy blog series already queued up.

Odds are pretty good that I’ll be working on the Hack compiler first; Hack is a gradually typed extension to PHP that looks remarkably like C#. I’ll post more – lots more! – once I have my feet under me here.

Another fabulous adventure! I can’t hardly wait!

West of house

You are standing in an open field west of a white house, with a boarded front door. You could circle the house to the north or south. There is a small mailbox here.

> open the mailbox

Opening the small mailbox reveals a leaflet.

> read the leaflet

[Taken]

“WELCOME TO ZORK, a game of adventure, danger, and low cunning. No computer should be without one!”


Continue reading

Space oddity

Many years ago I awoke in the dead of night in a cold sweat, with the certain knowledge that a close relative had suddenly died. […] In fact, the relative is alive and well […]. However, suppose the relative had in fact died that night. You would have had a difficult time convincing me that it was merely coincidence. But it is easy to calculate that if each American has such a premonitory experience a few times in his lifetime, the actuarial statistics alone will produce a few apparent precognitive events somewhere in America each year. We can calculate that this must occur fairly frequently, but to the rare person who dreams of disaster, followed rapidly by its realization, it is uncanny and awesome. Such a coincidence must happen to someone every few months, but those who experience a correct precognition understandably resist its explanation by coincidence.

After my experience I did not write a letter to an institute of parapsychology relating a compelling predictive dream which was not borne out by reality. That is not a memorable letter. But had the death I dreamt actually occurred, such a letter would have been marked down as evidence for precognition. The hits are recorded, the misses are not.

Thus Carl Sagan in his 1979 book Broca’s Brain. Continue reading

Functional programming for beginners

Happy New Year everyone; I hope you had a pleasant and relaxing festive holiday season. I sure did.

I’m starting the new year off by giving a short — an hour long or so — talk on how you can use ideas from functional programming languages in C#. It will broadcast this coming Wednesday, the 13th of January, at 10AM Pacific, 1PM Eastern.

The talk will be aimed straight at beginners who have some experience with OOP style in C# but no experience with functional languages. I’ll cover ways to avoid mutating variables and data structures, passing functions as data, how LINQ is functional, and some speculation on future features for C# 7.

There may also be funny pictures downloaded from the internet.

Probably it will be too basic for the majority of readers of this blog, but perhaps you have a friend or colleague interested in this topic.

Thanks once again to the nice people at InformIT who are sponsoring this talk. You can get all the details at their page:

http://www.informit.com/promotions/webcast-a-beginners-guide-to-functional-programming-141067

In related news, I am putting together what will be a very, very long indeed series of blog articles on functional programming, but not in C#. Comme c’est bizarre!

Foreshadowing: your sign of a quality blog. I’ll start posting… soon.