HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Is the memory usage of total languages deterministic?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
totalthelanguagesusagedeterministicmemory

Problem

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.

Solution

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:

  • "https://en.wikipedia.org/wiki/Complexity_class"



  • "https://en.wikipedia.org/wiki/Computational_complexity_theory"



  • "https://en.wikipedia.org/wiki/Chomsky_hierarchy"

Context

StackExchange Computer Science Q#52696, answer score: 2

Revisions (0)

No revisions yet.