5 ms·
The people have spoken and the people like GC.
by recursive 3y ago
The people have spoken and the people like GC.
- CyberDildonics 3y agoThe people who use software have spoken and they don't like GC.
- jdiff 3y agoReally? Because I myself asked the people who used software about Garbage Collection and they said "I mean, it's a job." The people who use software have absolutely no idea or opinion on the topic.
- CyberDildonics 3y agoThe people who use software have absolutely no idea or opinion on the topic. I asked 'the people who use software' and they don't like excessive memory usage or stuttering from bulk collection. Also libraries written in a garbage collected language are only going to be usable in the same language. Lots of people only think about the language they want to program in, then rationalize it being fine. That's how we got stuff like electron. When people think about what someone actually wants to receive that stuff goes away.
- lispm 3y ago> I asked 'the people who use software' and they don't like excessive memory usage or stuttering from bulk collection. Two of the most widely programming languages are implemented on top of garbage collected runtimes: JavaScript and Java. There are many applications where garbage collection works just fine. > Also libraries written in a garbage collected language are only going to be usable in the same language. See .net and the JVM. Those are nowadays runtimes with garbage collection and multiple languages. https://en.wikipedia.org/wiki/List_of_JVM_languages https://en.wikipedia.org/wiki/List_of_JVM_languages https://en.wikipedia.org/wiki/List_of_CLI_languages https://en.wikipedia.org/wiki/List_of_CLI_languages
- CyberDildonics 3y agoTwo of the most widely programming languages Widely used? This is the point. The programs that people use directly are written in C++. Programmers try to get away with garbage collection because it's what they want, not what people using software want. Those are nowadays runtimes with garbage collection and multiple languages. That's like saying typescript can be used in javascript, it's all the same underneath. It isn't the same as something native that can be used and consumed anywhere else. Software in non native languages keeps getting re-written over and over and not widely reused. Once someone does something natively and does it well like sqlite, image libraries, etc. it stays done.
- lispm 3y ago> The programs that people use directly are written in C++. There is a lot C/C++ around and they are widely used to implement runtimes for other languages, incl. garbage collection. Lot's of software people use directly or indirectly is written not in C++. > That's like saying typescript can be used in javascript That's another option how to integrate languages: TypeScript is transpiled to JavaScript. C can also be transpiled to JavaScript. Emscripten can compile LLVM instructions to JavaScript and Webassembly. JavaScript/Webassembly then gets compiled to native instructions. low-level infrastructures like the JVM create native code from Java (and other languages using the JVM), by compiling to machine code. > It isn't the same as something native that can be used and consumed anywhere else. Programs with garbage collection also run "native". The garbage collector is a native part of the program. > Once someone does something natively and does it well like sqlite sqllite is not written in C++, it's written in C. As the first three letters tell us, it implements a language called SQL. sqllite also comes with its own dynamic memory management system: https://www.sqlite.org/malloc.html https://www.sqlite.org/malloc.html sqllite is an excellent example, where C is used to implement a higher-level language (here SQL) and a complex memory management for it. Btw., I'm typing this now on a iPad, where the user side of software is mostly implemented in Swift or Objective C, which use "reference counting" for memory management. The browser I'm typing to uses a system provided JavaScript engine with garbage collection. The site I'm using (Hackernews) is written in Arc (which is a Lisp dialect), which runs on top of a variant of Scheme, which is another Lisp dialect, which provides a garbage collector.
- xigoi 3y agoHow did you get from “garbage collection” to “excessive memory usage”?
- angiosperm 3y agoYet, it is what we experience. One GC program on a machine may perform well. Two are a problem.
- xigoi 3y agoYou didn’t answer my question. Why, in general, wouid a garbage-collected language consume more memory?
- angiosperm 3y agoGC systems delay collecting garbage because it is unproductive overhead. For each object constructed, it is quicker to claim fresh memory than to clean up garbage and reclaim its memory. Thus, garbage accumulates, amounting to memory claimed by the process, but not storing anything useful to the program. In practice, much of the memory claimed by a GC program, most of the time, is such garbage.
- xigoi 3y agoYou’re making a lot of assumptions about the specific GC algorithm used. Those based on reference counting clean up immediately when possible.
- angiosperm 3y agoWe have lots of those. But memory is only one resource to manage. What does it offer for the rest?
- recursive 3y agoGC is explicitly about memory. There are other features for others, like context managers in python.