Lambda the Ultimate

inactiveTopic A Type Theory for Memory Allocation and Data Layout
started 5/12/2004; 10:21:54 AM - last post 5/13/2004; 3:29:19 AM
Mark Evans - A Type Theory for Memory Allocation and Data Layout  blueArrow
5/12/2004; 10:21:54 AM (reads: 9459, responses: 3)
A Type Theory for Memory Allocation and Data Layout

Recent discussions about machine language and the myth of mandatory HLL performance degradation prompted this note. The idea: HLL code can manipulate low-level constructs in a strongly typed regime.

High-level programming languages such as ML and Java allow programmers to program in terms of abstractions such as pairs, records, and objects, which have well-defined semantics but whose realizations in terms of the underlying concrete machine are left unspecified and unobservable. Sometimes, it is necessary to program without these [high-level] abstractions.

Traditionally, [such machine-oriented] needs have been addressed in an un-typed, or a weakly typed fashion. Languages such as C give programmers relatively precise control over data layout and initialization at the expense of type and memory safety. Traditional compilers represent programs internally using un-typed languages, relying on the correctness of the compiler to preserve any safety properties enjoyed by the source program.

An important contribution of this work is ... the possibility ... that even programs requiring detailed control of memory layout could be written in a typed, high-level language.


Posted to theory by Mark Evans on 5/12/04; 10:23:05 AM

Chris Rathman - Re: A Type Theory for Memory Allocation and Data Layout  blueArrow
5/12/2004; 11:44:13 AM (reads: 358, responses: 0)
Wondering if a truly formal solution would require that we not only specify the algorithm, but also the resource constraints (how fast it must be). So other than various Assembly languages which measure things in clock cycles, how many language specifications define time as part of the spec (the C++ template library comes to mind).

Mark Evans - Re: A Type Theory for Memory Allocation and Data Layout  blueArrow
5/12/2004; 1:16:34 PM (reads: 349, responses: 0)
The paper comments about constant-time heap access and such. Beyond that, not even perfectly written C offers such assurances. You need a real-time system.

Andris Birkmanis - Re: A Type Theory for Memory Allocation and Data Layout  blueArrow
5/13/2004; 3:29:19 AM (reads: 249, responses: 0)
an extension of Hoare logic that permits reasoning about low-level imperative programs that use shared mutable data structure. by John Reynolds may be applicable to this discussion as well.