3

I'm interested in the memory usage of various programming languages when implemented on actual hardware.

I believe that a Turing-complete programming language has, in general, unknowable memory usage since object lifetimes are not statically analyzable [1]. It also seems like a regular expression language (in the deterministic finite automata) has statically known memory use.

What is the most complex programming language for which that is true? And where do total languages [2] fall in relation to that?

[1] Given the caveat that we're implementing that programming language on a physical computer with all its requisite limitations.

[2] A total language is, for the purposes of this question, a language where all programs written in it are guaranteed to terminate.

Raphael
  • 73,212
  • 30
  • 182
  • 400
oconnor0
  • 403
  • 2
  • 8

1 Answers1

2

Because total programs cannot run forever they cannot use infinite memory. You can know maximum, and best case cost from looking at what algorithm is implemented. Checkout these wikipedia pages to see the relationship between different grammars, algorithms, and machines:

44701
  • 469
  • 2
  • 10