Live data from Hacker News

Wangle – an asynchronous C++ networking and RPC library

code.facebook.com

51–60 of 78 posts

Re: Wangle – an asynchronous C++ networking and RPC library

#51

Earlier quoted context omitted.

Does that mean that one can use system threads as frivolously as goroutines (e.g. spawning new thread for each incoming request)? Conventional C++ wisdom advices against it. But then it may be informed by some old and bad pthreads implementations.

> Does that mean that one can use system threads as frivolously as goroutines (e.g. spawning new thread for each incoming request)? Yes. In fact, under Linux oftentimes spawning a thread and then running a system call can be faster than just running a system call. > Conventional C++ wisdom advices against it. With 32 bit CPU's you might run out of virtual memory quickly, since each thread allocates virtual memory for…

> Yes. In fact, under Linux oftentimes spawning a thread and then running a system call can be faster than just running a system call.

Interesting, do you have any further info (references, cites) on this?

Re: Wangle – an asynchronous C++ networking and RPC library

#52
post #41

After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. A lot of people like the to say that [x] is superior to C or C++ - often ignoring that their favorite language's libraries/runtime/compilers/vm is most likely implemented in the very same languages they are putting down.

> After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. Sadly there are many more compilers out there than just gcc, clang, icc and msvc++.

Many of those aren't still C++11 compliant, specially in mainframes, classical commercial UNIXes, embedded real time OS and certified compilers.

But it is true, thanks to the productivity of latest standards, there has been an increase in C++ visibility, specially thanks to Microsoft.

People like to bash their C++'s compliance, but they are the commercial vendor with the more up to date support, even than icc last time I checked.

Also they were the main sponsors for Back to native conferences and eventually making it together with CppCon.

https://blogs.msdn.microsoft.com/vcblog/2014/04/03/cppcon-th...

Also Windows Phone is the only mobile OS where C++ is a first class language.

>. A lot of people like the to say that [x] is superior to C or C++ - often ignoring that their favorite language's libraries/runtime/compilers/vm is most likely implemented in the very same languages they are putting down.

A lot of people like to point out that fact, ignoring that many compiler writers tend to use C or C++ out of convenience for existing tools instead of bootraping the full eco-system around a new programming language.

Many use the same route as Go, using one of those languages and when the toolchain gets mature, those parts get re-writen.

All in all, I do like the language, now if we could get rid of those C underpinnings...

Re: Wangle – an asynchronous C++ networking and RPC library

#53
post #52
post #41

After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. A lot of people like the to say that [x] is superior to C or C++ - often ignoring that their favorite language's libraries/runtime/compilers/vm is most likely implemented in the very same languages they are putting down.

> After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. Sadly there are many more compilers out there than just gcc, clang, icc and msvc++. Many of those aren't still C++11 compliant, specially in mainframes, classical commercial UNIXes, embedded real time OS and certified compilers. But it is true, thanks to…

Intel's C++11 support continues to be quite buggy. I'm still running into with issues with Intel's support for auto type deduction and for uniform initialization in non-obscure use scenarios.

Re: Wangle – an asynchronous C++ networking and RPC library

#54
post #49
post #41

After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. A lot of people like the to say that [x] is superior to C or C++ - often ignoring that their favorite language's libraries/runtime/compilers/vm is most likely implemented in the very same languages they are putting down.

> often ignoring that their favorite language's libraries/runtime/compilers/vm is most likely implemented in the very same languages they are putting down I don't see how that's an argument against a language being "superior to C or C++". You can't create a self-hosting compiler for your language without having already created a non-self-hosting compiler for your language. That means every language is going to have t…

> Rust is one of those languages—and it does indeed look like things are going in the direction of new languages getting prototyped/bootstrapped with a Rust compiler/runtime/vm instead.

I'm curious what examples you have in mind here? LLVM seems to be the default go-to compiler infrastructure, at the moment.

Re: Wangle – an asynchronous C++ networking and RPC library

#55
post #52

Earlier quoted context omitted.

> After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. Sadly there are many more compilers out there than just gcc, clang, icc and msvc++. Many of those aren't still C++11 compliant, specially in mainframes, classical commercial UNIXes, embedded real time OS and certified compilers. But it is true, thanks to…

Intel's C++11 support continues to be quite buggy. I'm still running into with issues with Intel's support for auto type deduction and for uniform initialization in non-obscure use scenarios.

Sorry I was updating the comment as you replied.

I never used it, but last time this discussion came up and I searched for their support page many C++11 features were either TBD or GNU/Linux only.

Thanks for the feeback.

Re: Wangle – an asynchronous C++ networking and RPC library

#56
post #3

Had to look up the meaning of wangle. "obtain (something that is desired) by persuading others to comply or by manipulating events." Does anyone know where facebook is coming up with all these words - folly/wangle?

https://www.urbandictionary.com/define.php?term=Wangle

There are many meanings, including:

> A combination of the words wang + angle. > Noun: A curved/bent/crooked penis.

Re: Wangle – an asynchronous C++ networking and RPC library

#57
post #52
post #41

After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. A lot of people like the to say that [x] is superior to C or C++ - often ignoring that their favorite language's libraries/runtime/compilers/vm is most likely implemented in the very same languages they are putting down.

> After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. Sadly there are many more compilers out there than just gcc, clang, icc and msvc++. Many of those aren't still C++11 compliant, specially in mainframes, classical commercial UNIXes, embedded real time OS and certified compilers. But it is true, thanks to…

Windows phone, first class C++?

Man the times have changed. I remember when they made native code verboten in the Windows Mobile -> Windows Phone transition. Killed off a whole product line I was working on at the time.

Re: Wangle – an asynchronous C++ networking and RPC library

#58

Earlier quoted context omitted.

> Does that mean that one can use system threads as frivolously as goroutines (e.g. spawning new thread for each incoming request)? Yes. In fact, under Linux oftentimes spawning a thread and then running a system call can be faster than just running a system call. > Conventional C++ wisdom advices against it. With 32 bit CPU's you might run out of virtual memory quickly, since each thread allocates virtual memory for…

> Yes. In fact, under Linux oftentimes spawning a thread and then running a system call can be faster than just running a system call. Interesting, do you have any further info (references, cites) on this?

Sign me up for wanting more info as well. I'm curious how that could work out, since spawning a thread is a system call.

Re: Wangle – an asynchronous C++ networking and RPC library

#59
post #52

Earlier quoted context omitted.

> After most compilers started properly supporting the newer C++ standards, it seems there has been an increase in the amount of love that C++ libraries are getting. Sadly there are many more compilers out there than just gcc, clang, icc and msvc++. Many of those aren't still C++11 compliant, specially in mainframes, classical commercial UNIXes, embedded real time OS and certified compilers. But it is true, thanks to…

Windows phone, first class C++? Man the times have changed. I remember when they made native code verboten in the Windows Mobile -> Windows Phone transition. Killed off a whole product line I was working on at the time.

Yes, you can either use C++ plus the C++/CX extension, which although look like C++/CLI are actually native.

Making Visual C++ GUI developer experience finally comparable to what C++ Builder was offering in the mid-90's.

Or if C++/CX extensions is something one hates, there is the Windows Runtime Library, a template based library similar to ATL.

Finally Kenny Kerr has created a C++ projection based in pure modern C++ ans has been eventually hired by Microsoft to carry on his work.

https://kennykerr.ca/2015/10/02/microsoft/

iOS comes second in terms of C++ support in mobile OS, where Objective-C++ plays the same role as C++/CX on WP.

Just Android forces developers to enjoy the wonders of JNI, with APIs like Skia only exposed through it.

I know that there are a few other mobile OSes that do support C++, but their market share coupled together is even worse than WP.

Re: Wangle – an asynchronous C++ networking and RPC library

#60
post #50
post #27

Earlier quoted context omitted.

ASIO can be used standalone with any C++11 compiler and the compile times are quite good. If I should make a guess then I'd say that the original author of that part of the library either started before ASIO was standalone and/or simply has a hatred for boost (which would be unwarranted), or he/she was simply more experienced with libevent... IMHO it's quite sad that they didn't use ASIO though as it's far more exten…

And interestingly, Chris Kohlhoff (asio author) is currently working on an executors library / c++ standard proposal. Other question: how would wangle compare to Cap'n Proto (as the post mentions that wangle is an RPC framework, and is zero-copy)

Zero-copy in capnproto docs and in this blog post actually mean different things (the first means that serialized and in-memory representations of capnproto messages are the same and the second means the absence of copying between user space and kernel space when sending a file over the network).
Post reply on HN