4 ms·
Wow, I'm surprised I never ran across this excellent essay before. I also liked the use of the term "memory model" in this case to mean conceptual model, becau
by gumby 5y ago
Wow, I'm surprised I never ran across this excellent essay before.
I also liked the use of the term "memory model" in this case to mean conceptual model, because the metaphors and affordances of a language are what give (or restrict) its expressive power and the level of abstraction you can bring to bear. A mixed blessing.
- kragen 5y agoThanks, that means a lot! I think it kind of falls short of some of its initial promises, and clearly needs revision, but there are some good nuggets in there. As one example of what needs revision, I drew the diagrams after I wrote the text, and I realized that what I was describing in the text was far more complicated than what I really wanted to draw... but then never went back and revised the text. If this is the kind of thing you like, you might find more things to your taste in http://canonical.org/~kragen/dercuano http://canonical.org/~kragen/dercuano, which touches on, among other things, the bizarre memory model of the Zork Z-machine.
- zestyping 5y agoHi, Kragen! Is Dercuano available as individual HTML pages that can be clicked around (and indexed by search engines)? So far I've only found it as a giant blob (PDF or tar) and I'm wondering why that seems to be its primary presentation.
- kragen 5y agoHi Ping! I miss you a lot! The primary representation of Dercuano is a giant blob both to improve the chances that copies of it will survive after I'm dead and to more clearly establish a publication date for purposes of patent prior art. The PDF isn't very good (I hacked together a PDF-rendering script with reportlab in five days before the deadline, and even the CSS for the HTML version is pretty amateurish) but there are a variety of places that can view or archive PDFs but not tarballs of HTML. There's also an online mirror at https://dercuano.github.io/ https://dercuano.github.io/, which allows linking to pages like https://dercuano.github.io/topics/memory-models.html https://dercuano.github.io/topics/memory-models.html, but of course that depends on Microsoft's pleasure. See also http://canonical.org/~kragen/derctuo/ http://canonical.org/~kragen/derctuo/ for the sequel.
- silentsea90 5y agoNo offense but I do agree that the text is hard to read and understand and simpler sentences would be nicer.
- kragen 5y agoI have that problem a lot.
- danielmarkbruce 5y agoThis book is (imo) hilariously good and explains thing well for engineering type folks: https://www.amazon.com/Sense-Style-Thinking-Persons-Writing-ebook/dp/B00INIYG74 https://www.amazon.com/Sense-Style-Thinking-Persons-Writing-...
- fjfaase 5y agoHi Kragen, for a long time, I have been pondenring about a high-level 'programming' languages about structured data. It is by far finished, but I am attempting to deal with the problem of different memory models from the other end: starting with an ideal model trying to abstract from implementations. I have not address the problem of transactions and cooperation yet. Often the problem with implementation of data models start becoming 'interesting' when several actors at the same time are querying and changing it, especially when the dimension of distribution is added. https://github.com/FransFaase/DataLang https://github.com/FransFaase/DataLang
- kragen 5y agoThis is fascinating! It looks like it's inspired by linear (or affine?) typing, but isn't quite the same thing? It's definitely true that concurrency is a common source of such complications. Serialization is another one.
- Cybotron5000 5y agoI’m only about half way through, but I’m finding it extremely helpful, clear and well-written (some of the terminology/ideas I’m not familiar with/are over my head, but I plan on going back over it again later and looking stuff up :) - Thanks so much!
- kragen 5y agoMaybe the stuff that seems over your head is just stuff I wrote poorly!
- tekknolagi 5y agoThis is a great teaching attitude. Thank you.
- kragen 5y agoMaybe if I keep trying I'll get good at teaching some day! So far my results have not been inspiring.
- Cybotron5000 5y agoNot at all! I’m obviously not qualified to say, but it seems to me to be a great overview of a very complicated topic - clear, concise, comprehensive and not patronising. Stuff I don’t understand off the bat I can always look up, but it gives me a framework to begin to hang stuff on/explore from. Even if you had written several tome-like textbooks you couldn’t have compensated for my ignorance of the basic principles of computer science/informatics/programming etc.! :)
- jcranmer 5y agoAs a compiler writer, when I hear the term "memory model", I immediately assume it's referring to a multithreaded memory model, and is going to discuss when writes are guaranteed to be made visible to other threads. A better term for what's discussed here would be the "object model"--you're effectively describing how you would represent a conceptual object in different memory organization schemes.
- kragen 5y agoYeah, "memory model" is a terribly overloaded term (myself, I think small, compact, medium, large, huge), and "object model" has the same problem. Maybe I should just generate a random neologism.
- gumby 5y agoIn this case I liked this particular overloading of the term because it caused me to reset certain assumptions.
- Animats 5y agoYes. But we mostly have one memory model today - one big flat memory space, because C. There are other approaches, but most of the clever ones died off. x86-32 has lots of interesting things you can do with segments. Nobody used that stuff, so amd64 has flat memory. Burroughs once had a memory system that worked like pathnames. Think of an address as being "job/program/module/function/variable[n]", not a number. User programs could not see the physical memory address. This allowed the OS to do swapping and compaction underneath the program. The hardware would catch subscripting out of range. Worked fine, never caught on. Today we do that with collection classes, rather than at the OS/hardware level. Memory models are making a comeback, as we hit the limits of caches. Machines with some memory shared, some memory unshared, and some slower if shared have appeared.
- kaba0 5y agoThis topic is outside the realm of my knowledge, but at the language level, we do have that (compacting GCs), and I think we do have it at the OS level as well due to virtual memory (but hardware accelerated TLB).