I was wondering the same myself. I think there would be a lot of negative side effects to using alternate memory model other than GC (non-gc could introduce leaks, on stack has potential to be overwritten). For that reason, I think the only choices that make sense are that either @nogc functions are also nothrow, or that phobos has a set of preallocated immutable exceptions that can can thrown.

I personally think that @nogc should be relaxed to exclude allocating exceptions since there would be no gc allocation other than for exceptional situations. I suspect that having code that relies on exception for main case logic is far worse for performance than any gc overhead anyway and is a pattern everyone knows to avoid.

Reply via email to