On 11-03-11 12:25 PM, Brendan Eich wrote:
Marijn asked why we are not using STL in the runtime C++.

It's a good question. In Mozilla C++, we have avoided STL because we cannot 
take the code size and runtime costs of exceptions on all platforms.

https://bugzilla.mozilla.org/show_bug.cgi?id=200505

is worth a read if you are so inclined.

Once we gave up on STL for want of failure propagation via return value, we 
went in different directions on other, particular design points (raw buffer 
access, single-allocation hashtable [double hashing with entries as interior 
allocations]).

The high cost of exceptions with MSVC looks like it will endure, alas. Even 
with zero-cost exceptions in GCC, the RTTI hit was costly last time we checked 
(a while ago).

I hope this helps. I'm curious to hear from people who see a better way to go 
cross-platform with Rust's C++. It is 2011, after all!

I answered briefly in the pull request, but I'll elaborate here: we're not using STL due to 1 part history and 1 part restraint.

The history is that librustrt was C for the first several years, and we've only been C++-ifying it since about this time last year. Andreas insisted on it.

The restraint part is that we have no story for handling or propagating C++ exceptions into rust failures yet. We could do it with try/catch blocks on all upcalls and native calls, possibly, but it'd take some care and a degree of certainty that it's the right approach that I don't yet have. So there are no exceptions used in librustrt for now.

-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to