5 ms·
In my opinion it is a computer architecture that has a memory model, not Java or C++. For some strange reasons nginx - a mere C program - works for millions. S
by dschiptsov 14y ago
In my opinion it is a computer architecture that has a memory model, not Java or C++.
For some strange reasons nginx - a mere C program - works for millions. So does postgresql or redis or whatever.
- tonyarkles 14y agoI half agree. C++ directly exposes the underlying computer architecture's memory model. Java abstracts it reasonably well and essentially results in a different model with different advantages and disadvantages (e.g. garbage collection and garbage collection :))
- colanderman 14y agoIn my opinion it is a computer architecture that has a memory model, not Java or C++. Unfortunately that opinion is by definition incompatible with portable computer languages.
- dschiptsov 14y agoWhat is wrong with Schemes or Lisps?) Well, even Python (cpython) is more portable than Java. All it needs is working C compiler. It is ported to Plan9 and Android.)
- lmm 14y agoPython has a memory model. It's just too bad that so much of the python ecosystem relies on bindings to C libraries, so you go to resize an image and then you get a segfault that brings down your whole program (real example).
- colanderman 14y agoSchemes and Lisps have memory model, it's just one that's radically different enough from processor memory models that no-one realizes it's a memory model and thus no-one gripes about it being different from processor X's memory model. If you're wondering what the memory model is, you should ask yourself: What happens when I mutate a cell? are those changes visible in references to that cell? are those changes visible across thread boundaries? What happens when I dereference a cell? Does it continue to take up memory or is it garbage-collected? What if it's part of a cycle? But I digress; your point was actually about languages that don't talk about memory, such as the lambda calculus. A degenerate memory model is still a memory model, and an inherently portable one at that. My point is, for languages which do talk about memory, it's necessary that they specify how that memory works in order to be a portable language.