(There are points in here that are in response to several different
emails; I sometimes wish threads were directed graphs rather than trees.
the post this is actually a reply to is somewhat arbitrary).
Quoting Hongwei Xi:
Say an execution spends 20% on GC. Say Bohem-GC takes 2 times
the time taken by your favorite GC. Everything else being the
same, the ATS version is only 20% slower.
Do you have a basis for these numbers? I did a bit of searching and
wasn’t able to find credible benchmarks.
I am actually quite optimistic about getting back this 20% loss by
using flat types.
So we’ve drifted from this point in the conversation a bit, but part of
what I meant by “embracing” garbage collection was incorporating its
existence into the execution model – small objects are often times
easier to think about, so if you have a memory system that permits
making lots of them, it can make programming easier.
The JVM doesn’t actually support flat/unboxed types at all – you simply
cannot do that. Your point makes some sense when talking about a
native code environment with a GC, but in the context of the earlier
discussion it would not. The designers of the go programming language
would agree with you I think.
Quoting Raoul Duke:
The conservativeness is a concern. I wish that ATS could also
spit out something that was a “safe” language/AST where
pointers/refs were really typed, so that we could more easily
plug into precise collectors when the chance rears its head. 
Quoting Hongwei Xi:
By the way, I would like to add that I see conservativeness as a
blessing.
Could you explain your reasoning? I’ve only really heard arguments from
the perspective of ease of implementation and, of course, the fact that
with a language like C, precise garbage collection is impossible
(determining if something “is a pointer” is undecidable).
There was a real, somewhat serious bug in the go language runtime for a
while where the conservative garbage collector wasn’t always collecting
garbage – they’ve since moved to a precise collector.
Quoting Barry Schwartz:
Both GNU Guile and Embedded Common Lisp use Boehm GC just fine for
languages that are quintessentially ‘garbage collected’. ATS thus is
on the same level as Scheme and Common Lisp, when it comes to garbage
collection.
ATS is also a language targeted at use cases that are highly
performance sensitive. Lisps are not, and tend to be pretty slow for
reasons completely orthogonal to their garbage collectors. There are
fast implementations, but the ones I know of that have a reputation
for their speed are not using Boehm. Chicken Scheme comes to mind,
which has a very neat implementation of call/cc that plays well with
its generational copying garbage collector.
signature.asc (819 Bytes)