Live data from Hacker News

Wangle – an asynchronous C++ networking and RPC library

code.facebook.com

71–78 of 78 posts

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

#72

Also, check out crossbar.io and the WAMP protocol, offering transparent, clean and yet simple PUB/SUB & RPC accross languages, including C++, Python, PHP and JS (node and yes, browsers).

WAMP is a protocol, Wangle is a framework that you can use to implement protocols (like WAMP), crossbar is a broker (an application that implements the protocol using a [python] framework. So it's not a direct comparison.

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

#73
post #25

I just tried to compile folly in OSX and it fails to compile with homebrew. https://github.com/facebook/folly/issues/400 Also, Once I manage to compile folly and then wangle, what kind of database drivers can I use in conjunction with this? Would I shoot myself in the foot if I use this with libpq under CPUThreadPoolExecutor? Same with Rust and dlang, I'm not sure how to apply the freedom to have pluggable executor i…

> what kind of database drivers can I use in conjunction with this? Usually synchronous database drivers have to be reimplemented in an asynchronous fashion to work with event loops. It's not very hard though, could be as simple as adding jump tables and context structures into synchronous functions. Emulating asynchronous execution with a thread is ok too. You do that to access filesystem anyway. But if your first t…

MariaDB has an asynchronous C API.

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

#74
post #27

Earlier quoted context omitted.

I'll take a shot in the dark and say they probably value their compile times. Every boost library I've ever used has the tendency to pull in the world from a single header and take forever to compile.

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…

I haven't used the standalone version, but I have used the boost version for build a cross platform RPC library quite intensively. Unfortunately compile times there were really bad, for about 10kLoC C++ I had a compile time of nearly 1 minute (about 5years ago on a medium speed machine back then). I later also built the same library using Qt and the compile times were below 20 seconds. I think the differences came from the fact that asio is heavily templated, you get all in headers and favors directly instantiated objects instead of pointers. In QT you mostly have pointers (and therefore work with forward declarations to the implementations).

Besides that I think asio is a really good library. It gives you LOTS of options how to handle your workload. E.g. much more than libuv, in the sense that you can mix asynchronous and [non-blocking] synchronous IO calls inside your application, do IO calls from different threads, organize work with executors (io_services) and strands, etc. The drawback is that not all of these patters work good, and giving the users this kitchen sink of functionality could lead to worse results than a more focused approach. E.g. it took me a while to realize that calling io_service.run() from multiple threads is not the best idea.

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

#75
post #25

Earlier quoted context omitted.

> what kind of database drivers can I use in conjunction with this? Usually synchronous database drivers have to be reimplemented in an asynchronous fashion to work with event loops. It's not very hard though, could be as simple as adding jump tables and context structures into synchronous functions. Emulating asynchronous execution with a thread is ok too. You do that to access filesystem anyway. But if your first t…

MariaDB has an asynchronous C API.

libpq (Postgres's client library) has an asynchronous interface as well.

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

#76
post #69
post #67

Earlier quoted context omitted.

Although I agree with most of the comments you said, I have to strongly disagree with "First class C++ support of Windows Mobile" when compared to iOS (or even Android). I have an entire non trial stack of C/C++ libraries that I use which I easily bring to Android and iOS using a cross-compiling build system we wrote ( https://github.com/amigocloud/amigomake ). The C/C++ dependencies include : Freetype v. 2.4.10, Ope…

Those C and C++ dependencies are using OS specific APIs. The developers not caring about writing portable code doesn't make it less first class on Windows Phone. I don't see any chapter on ANSI C or ANSI C++ standards about OpenGL. When I learned C and C++, targeting UNIX only didn't meant much, because POSIX wasn't the same thing across all UNIX systems and Windows wasn't the only non-POSIX OS. So we learned to abst…

I have been developing code for 20 years using C/C++ - it sounds like you have been doing this even longer.

I think it is completely unfair that you simply dismiss and blame the libraries "because the developers did not care and wrote it without portability in mind".

I am not sure what your own personal definition of "first class citizen" is, but as such, IMHO it doesnt even make sense to argue it.

All I can tell you is that I can take all these projects and create a Windows 7 build that works - so the work to make it "portable" is there (even with all the nonsense of making sure they are compiled against the exact multithreaded vc runtime version and other windows quirks). MS has specifically chosen to not support other subsystems (e.g. OpenGL) that make portability easy/realistically feasible. To me, having a "hello world" work doesnt make a platform a "first class" system - bringing complex well known libraries and make them work does. That makes a first class citizen. I know we disagree - so we'll just have to agree to disagree :)

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

#77
post #76
post #69

Earlier quoted context omitted.

Those C and C++ dependencies are using OS specific APIs. The developers not caring about writing portable code doesn't make it less first class on Windows Phone. I don't see any chapter on ANSI C or ANSI C++ standards about OpenGL. When I learned C and C++, targeting UNIX only didn't meant much, because POSIX wasn't the same thing across all UNIX systems and Windows wasn't the only non-POSIX OS. So we learned to abst…

I have been developing code for 20 years using C/C++ - it sounds like you have been doing this even longer. I think it is completely unfair that you simply dismiss and blame the libraries "because the developers did not care and wrote it without portability in mind". I am not sure what your own personal definition of "first class citizen" is, but as such, IMHO it doesnt even make sense to argue it. All I can tell you…

I started coding in early 80's.

First class citzen for a programming language means:

1 - It is part of the OS SDK

2 - All the SDK tools support the language, including RAD tooling for UI, Web, database, ....

3 - The OS APIs are written with this language in mind

4 - The OS API documentation uses examples in the programming language.

So C, Swift and Objective-C are first class in iOS and Mac OS X.

JavaScript is first class in the browser

C is first class in UNIX

C#, VB, C++ are first class in Windows

Java is first class on Android.

What open source libraries are supported on a OS don't have anything to do with first class support.

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

#78
post #77
post #76

Earlier quoted context omitted.

I have been developing code for 20 years using C/C++ - it sounds like you have been doing this even longer. I think it is completely unfair that you simply dismiss and blame the libraries "because the developers did not care and wrote it without portability in mind". I am not sure what your own personal definition of "first class citizen" is, but as such, IMHO it doesnt even make sense to argue it. All I can tell you…

I started coding in early 80's. First class citzen for a programming language means: 1 - It is part of the OS SDK 2 - All the SDK tools support the language, including RAD tooling for UI, Web, database, .... 3 - The OS APIs are written with this language in mind 4 - The OS API documentation uses examples in the programming language. So C, Swift and Objective-C are first class in iOS and Mac OS X. JavaScript is first…

> What open source libraries are supported on a OS don't have anything to do with first class support.

Under your definition that is not true. Under mine, the ecosystem of libraries you can use on that platform is a key factor.

Post reply on HN