Egg Language

last modified: August 29, 2006

An anonymous language devised by EwDijkstra for the examples in his book A Discipline of Computer Programming. Dijkstra did not implement its language. The term egg refers to a recent Java implementation which is available at http://www.andrewcooke.free-online.co.uk/jara/egg/ .

Here is EuclidOfAlexandria's GCD algorithm, taken from the distribution:

begin privar X, Y, x, y ;
 X vir int, Y vir int := 12345 * 9876, 12345 * 6789 ;
 if X > 0 and Y > 0 ->
  x vir int, y vir int := X, Y ;
  do x > y -> x := x - y | y > x -> y := y - x od ;
  print( x ) { for 12345 * 9876, 12345 * 6789 answer is 37035 },
 fi
end 

According to the LanguageList Dijkstra "later (1972) referred to this language as DOVPA (Dijkstra's Own Version of Pidgin Algol)".


Loading...