Tomas Petricek's blog

Writing about practical F# coding and programming language research

Miscomputation: Learning to live with errors

If trials of three or four simple cases have been made, and are found to agree with the results given by the engine, it is scarcely possible that there can be any error (...).

Charles Babbage, On the mathematical
powers of the calculating engine (1837)

Anybody who has something to do with modern computers will agree that the above statement made by Charles Babbage about the analytical engine is understatement, to say the least.

Computer programs do not always work as expected. There is a complex taxonomy of errors or miscomputations. The taxonomy of possible errors is itself interesting. Syntax errors like missing semicolons are quite obvious and are easy to catch. Logical errors are harder to find, but at least we know that something went wrong. For example, our algorithm does not correctly sort some lists. There are also issues that may or may not be actual errors. For example an algorithm in online store might suggest slightly suspicious products. Finally, we also have concurrency errors that happen very rarely in some very specific scenario.

If Babbage was right, we would just try three or four simple cases and eradicate all errors from our programs, but eliminating errors is not so easy. In retrospect, it is quite interesting to see how long it took early computer engineers to realise that coding (i.e. translating mathematical algorithm to program code) errors are a problem:

Errors in coding were only gradually recognized to be a signi´Čücant problem: a typical early comment was that of Miller [circa 1949], who wrote that such errors, along with hardware faults, could be "expected, in time, to become infrequent".

Mark Priestley, Science of Operations (2011)

We mostly got rid of hardware faults, but coding errors are still here. Programmers spent over 50 years finding different practical strategies for dealing with them. In this blog post, I want to look at four of the strategies. Quite curiously, there is a very wide range.

Published: Monday, 27 July 2015, 2:15 PM
Tags: philosophy, research, programming languages
Read the complete article

Recent articles from my blog

Visualizing interesting world facts with FsLab

Tuesday, 30 June 2015, 4:07 PM

This blog post combines two interesting FsLab libraries. It uses the World Bank type provider from F# Data to get a number of interesting indicators about different countries of the world and it visualizes them using the XPlot library which makes it easy to build rich HTML5 visualizations using Google Charts and Plotly.

Against the definition of types

Thursday, 14 May 2015, 3:46 PM

What is the definition of type? Having a clear and precise answer to this question would avoid many misunderstandings but it would hurt science, 'hamper the growth of knowledge' and 'deflect the course of investigation into narrow channels of things already understood'.

Announcing FsLab: Data science package for Mono and .NET

Tuesday, 5 May 2015, 3:55 PM

After over a year of working on FsLab and talking about it at conferences, it is finally time for an official announcement. So, today, I'm excited to announce FsLab a cross-platform package for doing data science with .NET and Mono.

Comparing date range handling in C# and F#

Wednesday, 22 April 2015, 4:55 PM

I was recently working on some code for handling data ranges and I wrote initial version in C#. Later, I realized that I needed an F# version, so I went through the process of rewriting a simple function from C# to F#. This blog post compares the two versions.

Find older blog articles here

Welcome!

I'm an open-source developer and computer scientist who enjoys combining theory and practice. On the practical side, I write about F#, run trainings and provide consulting via fsharpWorks. On the theory side, I work on various programming language topics.

Trainings and consulting

I'm a frequent speaker at F# and .NET events, founding member of the F# Foundation author of C# and F# book and a StackOverflow fanatic. I have been Microsoft C# MVP since 2004 and used F# since early Microsoft Research versions.

Have you seen the F# testimonials and are you thinking how your company can also benefit from the safety, correctness, efficiency and faster time-to-market provided by F#?

Research & teaching

I'm interested in a wide range of topics in programming languages, ranging from category theory, comonads, reactive and distributed programming to scientific computing and working with data.

I like working on topics inspired by practical problems. I created a web framework for F# that inspired commercial projects like WebSharper and my experimental F# extensions can be tested live on tryjoinads.org.

When the time permits, I enjoy traveling. The calendar shows a new picture each month. See 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 and the first photos of 2015.