4 ms·
Can you use D without GC? How would it look like? If very restricted, then I don't see it as a viable C++ alternative. I'm ok with GC on a web server, but coreu
by kvark 12y ago
Can you use D without GC? How would it look like? If very restricted, then I don't see it as a viable C++ alternative.
I'm ok with GC on a web server, but coreutils are better without it.
- Shorel 12y agoIt is possible to allocate objects in the stack (objects without polymorphism, defined with the struct keyword). No use of heap and GC in that case at all. It's not that different to using C++ objects in the stack. If by no GC you mean to use heap allocated objects with manually managed destructors, then I think the answer is no.
- kvark 12y agoI'm looking at "http://dlang.org/garbage.html" http://dlang.org/garbage.html" section "D Operations That Involve the Garbage Collector", and there are some pretty interesting things on the list that require GC: all dynamic arrays, associative arrays, closures, asserts. Can you even read a file without these?
- steveklabnik 12y agoIn college, a group of is (mostly my friends) wrote a kernel in D, with no GC: http://xomb.org http://xomb.org It's true that D's stdlib still uses GC, but he D team has been working on eliminating that.
- fithisux 12y agoYou can write the non-GC part in C and call it from D. What is the prercentage of an app that is going to get harmed by GC? I believe it is manageable in C or even FreeBasic or even Freepascal or even Assembly. I used to believe that C++ is the best. Not the last three years.