Live data from Hacker News

ABI – Now or Never [pdf]

open-std.org

31–37 of 37 posts

Re: ABI – Now or Never [pdf]

#31

Am I wrong in thinking that this mild form of schizophrenia ( no official ABI but dont break the ABI) is part of the reason why we now live in a world where all applications talk to each-other through sockets, incurring huge overheads?

You can use shmem instead of sockets, which is pretty fast. Not as fast as a direct call, but pretty good; good enough for most purposes.

shmem = shared memory?

Re: ABI – Now or Never [pdf]

#32

Am I wrong in thinking that this mild form of schizophrenia ( no official ABI but dont break the ABI) is part of the reason why we now live in a world where all applications talk to each-other through sockets, incurring huge overheads?

You can use shmem instead of sockets, which is pretty fast. Not as fast as a direct call, but pretty good; good enough for most purposes.

Have you actually measured? The overhead isn't the socket, but the marshaling and unmarshaling, and you need these things for sockets, shared memory, or any other IPC.

Re: ABI – Now or Never [pdf]

#33
post #20
post #17

Earlier quoted context omitted.

On the contrary one of the reason of COM is to not depend on the C++ ABI, which is not stable at all under Windows (it has been de-facto stable for the three last version of MSVC, but was broken each time before, and the recent stable stride is not an indication this ABI compat will continue - actually it is well known that MS internally maintains an ABI incompat version of the STL that will be very probably used in…

In regards to COM I was specially thinking about how virtual functions and methods are layed out. This cannot change without breaking a lot of code. Already this causes issues in non-C++ languages (e.g. the difference with thiscall in C++).

The vtable layout is much smaller and much more stable than C++ as a whole. COM has a ton of value.

Re: ABI – Now or Never [pdf]

#34

Earlier quoted context omitted.

You can use shmem instead of sockets, which is pretty fast. Not as fast as a direct call, but pretty good; good enough for most purposes.

Have you actually measured? The overhead isn't the socket, but the marshaling and unmarshaling, and you need these things for sockets, shared memory, or any other IPC.

You don't need to (un)marshal necessarily; stuff like strings, or arrays of integers, can go straight across. And if you have to pass large amounts of data, they'll probably take a form that's something like that.

Re: ABI – Now or Never [pdf]

#36
post #16

Earlier quoted context omitted.

Makes me wonder why anybody takes them by value, and not by rvalue-reference. But unique_ptr in public interfaces feels like code smell. I have done it, but not proudly.

Quite a few times, I've made C++ library APIs like this: struct iface { virtual ~iface(){ } virtual void doSomething() = 0; static std::unique_ptr create(); } I don't know good ways to replace unique_ptr here. Requiring library users to #include the concrete implementation is not good: inflates compilation time, pollutes namespaces, pollutes IDE's autocompletion DB. Can go C-style i.e. pass double pointer argument to…

Returning them by value is fine. *RVO avoids inefficiencies.

But it would often be better to make a move-only value type, and return that instead.

Re: ABI – Now or Never [pdf]

#37
post #20

Earlier quoted context omitted.

In regards to COM I was specially thinking about how virtual functions and methods are layed out. This cannot change without breaking a lot of code. Already this causes issues in non-C++ languages (e.g. the difference with thiscall in C++).

The vtable layout is much smaller and much more stable than C++ as a whole. COM has a ton of value.

And it got even better with the UWP changes.
Post reply on HN