3 ms·
What exactly is "oddball" about BDW GC?
by dfox 7y ago
What exactly is "oddball" about BDW GC?
- antonvs 7y agoWhat isn't oddball about it? It's designed to work as a garbage-collected replacement for C's malloc. That alone is enough to establish its oddballness. Any large system that makes the mistake of using it soon discovers its limitations. Not that it's a bad system per se - it achieves its design goals, it's just that its design goals are, to put it mildly, oddball. Basically, it's designed to allow systems that really should be written in a garbage-collected language, to kinda-sorta get away without that - up to a point.
- dfox 7y agoYou should not think of it as malloc replacement but as an GC that can work with native code that does not use fixed stack and register layout. That you can use such a thing for code generated by C compiler is side effect of that. In fact, there are various garbage collected runtimes with bespoke GC's that use similar implementation strategies. Edit: and one notable thing on BDW GC is its non-oddballness when it comes to building and/or packaging it. Also it is almost completely written in portable-ish C (it expects sane memory layout and relies on bunch of technically unspecified, but expected behaviors).
- antonvs 7y agoThe point is that it's designed to work with native code in a language that wasn't designed to use garbage collection. That's going to result in a semantic gap no matter what, and it invariably does. Every system I've ever seen using Boehm GC has issues as a result, except in certain special circumstances where the limitations are mitigated by the nature of the system. That's not an indictment of the GC itself, it's simply a consequence of trying to shoehorn automatic GC into a language that doesn't support it.
- int_19h 7y agoIt also allows language implementations to get a GC that, while not perfect, is "good enough" in many cases - and can get them through the early growth period. The library has APIs to manually manage roots etc for this purpose. I remember that Mono used it early on. Not really surprising that Guile does, as well. Nor is it surprising that they haven't switched to a better hand-rolled GC - given the relative obscurity of Guile, I would imagine that its maintainers have more important things to work on.
- nrclark 7y agoThe license is a little weird, for one. It's also strange because I think it's the only non-GNU dependency in the whole chain. I guess I'd also have expected a GC scheme to be baked into the core Guile source-code instead of relying on an external GC library. It's also not fully portable C code. I'm sure the library works great - it has a long history, and I'm definitely not knocking it. But it's a little bit of an unexpected dependency for sure.