Tuesday, March 28, 2017

Programming Languages by Spec Size

I was curious which programming language has the smallest specification.  Which one has the largest?  For each language, I printed the spec to a PDF and counted the pages.  Self 2017.1 is the smallest.  C++ is the largest.

This is a very rough estimate of language complexity since each specification varies in style and purpose.  I tried to count only the language specification. For example, I didn't count Annex A in the Prolog spec since it's only informative.  For Haskell 2010, I didn't count Part II - Libraries which defines the standard library, not the language.  Anyway, here's the list:

If you'd like me to add other languages, comment with a link to the spec and I'll update this post.

11 comments:

Travis Hendricks said...

C# please.

https://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf

mndrix said...

Thanks. I've added C#. It's similar in size to JavaScript.

Jeff Joshua Rollin said...

Common Lisp (even although I'm pretty sure it'll be the largest). Some may say it's irrelevant, but is Scheme anymore relevant?

mndrix said...

I'd be glad to add Common Lisp, but I've had no luck finding a PDF (or otherwise printable) copy of the spec. If you can point me towards one, I'll include it here. Thanks.

mndrix said...

I've added Lua 5.0 (the most recent spec for which I could find a PDF) and shell command language (/bin/sh). Lua's spec is smaller than Go's, so I updated the text accordingly.

mndrix said...

I added F# 4.1

mndrix said...

I added Standard ML and OCaml

mndrix said...

I added C 2011

mndrix said...

I added Ada 2012

mndrix said...

I added Nim 0.19

mndrix said...

I added Self 2017.1, Newspeak, and Smalltalk-80. I also adjusted Prolog and Haskell by omitting lengthy appendices that don't really define the language.