Lambda functions timeline

I did a talk at work about lambda functions (anonymous functions), and something possessed me to make a timeline of when they were introduced into various languages. Some languages were born with them, and some grew them later – in the latter case I give the language version and date in which they were introduced.

It’s probably entirely wrong, but here it is:

Dates when lambda functions were introduced into various programming languages

Note that C# had varying levels of support for lambda functions in different versions. I used the version (3.0) in which Wikipedia describes its support as “full”.

Goodness in programming languages, part 3 – not doing the same thing more than once

Posts in this series: Syntax, Deployment, Metaprogramming, Ownership

I’m going to use a word here – don’t stop reading: Metaprogramming. Does the language provide what you need to avoid repeating yourself?

Repeating boilerplate code, algorithms and most importantly ideas, slows you down, makes maintenance difficult, and allows all kinds of mistakes to creep in. If a language provides the ability to abstract, name and re-use all the different types of structure it contains, you can avoid harmful repetition.

Here are some things I like:

  • Python, JavaScript and Scheme’s ability to treat functions like any other object. A massive step towards sharing code is being allowed to pass around something that can be called without worrying about what it is.
  • Scheme’s ability to define an algorithm independently of types. In Scheme, there is never a need to write another version of the same function because it deals with different types of thing.
  • Python’s ability to read and modify classes just like any other object. Want a class just like your current one, except it logs every method call? Write a function that copies and modifies the class definition.
  • Scheme’s ability write code about code. In Scheme, code is just some nested lists. It’s trivial to build and modify code without stepping out of the language.
  • C++’s ability to write code that runs at compile time. If you can stand the syntax and (lack of) debugging, C++ template metaprogramming allows you to build C++ code at compile time without stepping out of the compiler environment.
  • Scheme and C’s macro systems. Both Scheme and C (and C++) allow you to write macros that build commonly-repeated code. Scheme’s syntax for this is much easier to work with.

Until you’ve experienced the freedom of totally generic code in a language like Scheme it’s hard to explain why the “Generics” features of some languages are so lacking. Of course, static typed languages work under different constraints. Would it be possible to write a language with very strong generic programming features, but which still allows static typing and compiling to native, non-generic code? I think so.

Tail Call Optimisation in C++ – lightning talk video

You can watch the Tail Call Optimisation in C++ lightning talk video, which I gave at the ACCU 2012 conference in April.

You can also read the (clearer and more correct) writeup I did later: Tail Call Optimisation in C++ or the subsequent article published in Overload 109.

Cool Raspberry Pi Projects

Someone claimed that everyone who has a Raspberry Pi has done what I did with it: try it out then file it in a drawer marked “must play with later”. To try and debunk this claim, here are some cool projects I have seen.

Update: I made some videos on how to write your first ever game on your Raspberry Pi!

Raspberry Pi Accessories You Already Have!

This guy uses an old PSOne as a screen+audio, a phone battery for power, and a hard drive or mp3 player for storage.

Raspberry Pi Robot Test!

A robot carrying a RPi on its back, controllable via the Internet. It runs a node.js web server, and receives HTTP requests to control it.

Raspberry Pi – Quake 3 demo

A playable Quake 3.

RaspberryPi: XBMC Android Remote Control Demo

A video player, with a mobile phone as the remote control.

PIE1 -– Raspberry Pi Sends Live Images from Near Space

Story | Photos of launch | Photos from space

Balloon flying up to 40km taking photos using a USB webcam and saving them to an SD card.

VNC Viewer on Raspberry Pi

A VNC viewer allowing you to create a thin client/terminal in other rooms of your house.

Also see the Raspberry Pi Thin Client project, for a small distro containing VMWare, Remote Desktop, Citrix Receiver & a browser.

Raspberry Pi running the Fuse ZX Spectrum Emulator

A ZX Spectrum Emulator, taking the nostalgia to the max.

Make A Raspberry Pi Web Server

Make your own £25 web server.

Voice Controlled Robot using a Raspberry Pi

A voice-controlled robot arm.

Pi Plays Poppins

A Pi playing the Glockenspeil.

Pi Plays Poppins from Mike Cook on Vimeo.

Raspberry Tank – First Day Out

A tank, currently directly controlled by typing into ssh. They are working on an autonomous version.

Learn how to program

My own tutorial on how to write computer programs in Python on your Pi. You will make a very simple game.

Not-yet-implemented ideas

There are lots of people talking about ideas for projects. Here are some I’d like to see come off:

  • Voice-activated wall-mounted screen
  • Advanced alarm clock
  • Motion-activated lights and/or camera
  • Internet radio
  • Coffee machine
  • Phone system
  • Web browser on your TV
  • Autonomous boat

Scheme 7: Macros video

Series: Feel the cool, Basics, Closures, Recursion, Quotation, Lambda, Macros.

Continuing the series on Scheme, this video explains the ultimate alternative – when nothing else is flexible enough, we can create our own bits of lanugage using macros.

Slides for Scheme 7: Macros