[concurrency-interest] Programming language-independent memory models

Andrew Haley aph at redhat.com
Fri Aug 4 13:18:43 EDT 2017


Do such things exist?  Java and C++ have their own, which are mostly
compatible but not quite.  Any language implemented in C++ will
necessarily implement the C++ memory model, which (perhaps)
unfortunately implies that if it executes any data races the whole
program becomes undefined.  A programming language interpreter written
in C++ could get around that by using atomic types for everything, but
that's rather unpleasant.  The Java memory model is somewhat more sane
than that, and might provide a better base.

Defining a memory model is a substantial task.  It would be nice, from
a blue sky point of view, to be able to pull a memory model off the
shelf and say "Language X uses the Y memory model" and leave it at
that, pausing only to describe Programming Languages X's mapping from
its own operators to those of the Y memory model.  I'll grant that
this is difficult, because programming language semantics play a large
part in the way a language uses memory.  However, that's surely easier
than starting with nothing.

I'm wondering if, in the wonderful world of polyglot systems and
applications, there has been any work in this area.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the Concurrency-interest mailing list