The Boost libraries
I’ve been hacking on a personal project to make it easier to expose HTTP based devices that are behind a restrictive NAT or firewall. The code needs to run on a OpenWrt based MIPS board1 which limits my language choice – Python3 is out as it’s too big, and Go on MIPS32 via gccgo on OpenWrt is… tricky2.
I ended up writing the app in C++ and I’ve been quite impressed with C++14 and the Boost libraries. Especially:
boost::optionalfor covering the optional results without having to use tricks like err == -1 or result == nullptr.
boost::algorithm::stringfor string splitting and trimming.
boost::asiofor all of your event or blocking based network programming needs.
boost::program_optionsfor command line option parsing and validation.
boost::asio::coroutinefor a very readable implementation of Duff device based coroutines.
std::unique_ptr / std::shared_ptrfor sane memory management.
usingkeep the code reasonably terse as well.
1 I also have two of the $12.90 LinkIt Smart 7688 boards on their way. A good price for a 580 MHz Linux CPU on a DIP carrier with Wifi, RAM, and 32 MiB of flash.
2 gccgo enables libffi, which assumes floating point registers, but the OpenWrt kernel turns off FP emulation by default and enforces it through binutils flags.