The Memory Models That Underlie Programming Languages
<i>I’m calling these six conceptualizations “memory models”, even though that term used to mean a specific thing that is related to 8086 addressing modes in C but not really related to this. (I’d love to have a better term for this.)</i><p>I would just call them &quot;data models&quot;.  The relational model is clearly a data model; it&#x27;s based on tables with homogeneous columns.  C++ uses the data model of typed memory; Python and Java use the object graph data model, etc.<p>&quot;Memory model&quot; made me think of concurrency: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Java_memory_model" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Java_memory_model</a><p>Another possible name would be &quot;meta-object model&quot;.  (That term shouldn&#x27;t require &quot;classes&quot;)<p>Although I&#x27;m not sure that they all go together.  The first 3 are definitely related (records, object graph, parallel arrays), and the last 2 are (relational vs hierachical file system).<p>I don&#x27;t see how pipes really fit in (and I&#x27;m writing a shell [1]).  A pipe is a fixed-size buffer inside the kernel, outside the address space of any process.  That distinction is orthogonal to how you actually organize your memory within a process, which is what the first 3 things are about.<p>And I think that persistence is an orthogonal concern as well.  It applies to all of them except pipes.  SQL and hierarchical file systems are persisted in practice, and you will have no problem with COBOL-style records or parallel arrays.<p>Object graphs have the problem with serialization that he mentions: JSON and Protocol Buffers can&#x27;t represent cyclic data structures; they represent trees.<p>I wrote about three domain-specific languages for persisting different data models here:   <a href="http:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2016&#x2F;12&#x2F;16.html" rel="nofollow">http:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2016&#x2F;12&#x2F;16.html</a><p>The analogy is that Zephyr ASDL is to ML as protocol buffers are to C++ (although protobufs now have unions which could be represented as sum types I think).<p>[1] <a href="http:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;</a>