Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Instead of writing an endless reply, I suggest you read the EASTL white paper: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n227...

Essentially, listing all the hoops EA went through to have a useable STL for games. (And for programming purposes, AAA console games and OS kernels are pretty close)



And also what Bloomberg saw C++ lacking:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n185...

I'd still like to see how both these papers influenced last C++ standard at the end (I admit I didn't try to follow) -- is there finally a "standard" way to do all that?


Notice the dates on these papers though. 2005 and 2007 are a long time ago in C++ compiler land. I'm using the STL in very low latency DSP code with zero problems. You have to make sure you don't allocate memory in realtime callbacks but that's just as true of malloc.


Dates are irrelevant if you really want to control where something gets allocated. Last time I've checked there weren't the level of control described in the linked articles in "standard" C++. If you know how I can achieve it, please write, but please don't dismiss my need with "you wouldn't notice everything is fast enough it's 2012."


Can you name any language that does give you that level of control in its standard collection classes? At least C++ gives you the power to define your own if you really need to.


"C++ gives you the power" exactly because there's full C underneath -- once you avoid "standard" containers, "OOP," "STL," "boost" and "best C++ practices" you can still malloc and place structs where you want. Sometimes you really need that level of control, and you get it from C. AFAIK, Google's Go simply just says "we don't give you that level of control." That's why C won't be fully replaced with Go. And that's also what "omg I need C++" people don't understand. I don't blame them for not knowing, they didn't have to work on such problems.

But I blame them when they insist that what they do is enough for everybody. It isn't.


D give you the same control that C, and same time you have a lot of funny things that have other high level languages at same time that is'nt a kraken like c++


In standard-land, not so long ago. The process is slow.

As for the Lakos allocator model, two issues come up:

(1) You get an allocator pointer in everything.

(2) Each allocator still doesn't get to be simple: if the container passes the allocator down to its elements, the allocator has to worry about very differently-sized allocations. E.g. rb-tree nodes and the contained types.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: