Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming languages complexity

Is there an objective measure of a programming language's complexity in terms of syntax and semantics, not how complex the language is to use ?

I've read many subjective comments but little rigorous analysis.

like image 674
Suugaku Avatar asked Jul 22 '09 21:07

Suugaku


2 Answers

Language's BNF is a rough measure - just for a taste :-)

A few examples,

  • C++
  • Scheme
  • Lua
  • Ada
  • Haskell
like image 84
Nick Dandoulakis Avatar answered Oct 21 '22 04:10

Nick Dandoulakis


It's not clear to me that complexity is even a well-defined term when applied to a programming language.

If by "objective" you mean "quantitative", you could ask such questions as

  • How big is an unambiguous grammar?

  • How big is a working yacc grammar?

Since almost no language has a formal semantics, it's hard to do any quantitative studies. But you could ask

  • How big is the simplest interpreter for the language, relative to interpreters for other languages that use the same metalanguage (language in which the interpreter is written)? This measure is somewhat related to Kolmogorov complexity.

Except as a matter of curiosity, it's not clear to me that this question is worth asking—it's hard to imagine useful answers.

like image 28
Norman Ramsey Avatar answered Oct 21 '22 05:10

Norman Ramsey