RIP John McCarthy, the LISP creator who sorted out memory mismanagement

Filed Under: Uncategorized

"Uncle John" McCarthy, the creator of the functional programming language LISP, died earlier this week in California at the age of 84.

McCarthy will probably best be remembered for being decades ahead of his time, working out how to make LISP manage entirely automatically the memory needs of programs running inside it.

Whilst explicitly requesting and releasing memory can make for well-thought out and efficient programs, even the slightest mismatch in your malloc()s and your free()s can lead to havoc. Crashes are almost inevitable - and that's the best outcome. The worst is that memory mismanagement can lead to remotely exploitable vulnerabilities in your software.

These days, therefore, languages which manage memory for you are commonplace. Take Lua, for example. If you concatenate two text strings to build up an error message, you don't need to worry if you've preallocated enough RAM to store the combined string. The language runtime will sort that out for you.

And when you've printed the error message, you don't need to remember to return its RAM to the system. Again, the runtime will work out when the memory it loaned you is no longer needed, and take it back for later.

McCarthy not only pioneered this approach back in the late 1950s, he even came up with the name by which it is generally known these days: garbage collection.

But as McCarthy wryly footnotes in the 1995 online version of his seminal 1960 paper Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I (there isn't a Part II), he didn't get to introduce the name back then:

We already called this process "garbage collection", but I guess I chickened out of using it in the paper — or else the Research Laboratory of Electronics grammar ladies wouldn't let me.

Like household garbage collection, automated memory management in programming languages doesn't magically make you an environmental greenie. (It's still easy to use too much memory, or to create data structures which the system can't later recognise as surplus to requirements.)

Garbage collection does, however, assist enormously with reliability, safety and security, and generally leads to much more elegant and maintainable code.

Thanks, Uncle John, and farewell.

, , , , , , , ,

You might like

One Response to RIP John McCarthy, the LISP creator who sorted out memory mismanagement

  1. Danny · 1056 days ago

    RIP. WE WILL ALL JOIN YOU SOON!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

About the author

Paul Ducklin is a passionate security proselytiser. (That's like an evangelist, but more so!) He lives and breathes computer security, and would be happy for you to do so, too. Paul won the inaugural AusCERT Director's Award for Individual Excellence in Computer Security in 2009. Follow him on Twitter: @duckblog