8 ms·
Abseil: C++ Common Libraries
- ingve 9y agoSome more information is available: https://abseil.io/ https://abseil.io/ https://opensource.googleblog.com/2017/09/introducing-abseil-new-common-libraries.html https://opensource.googleblog.com/2017/09/introducing-abseil... Almost live coverage of Titus Winters's CppCon keynote where this was unveiled: https://twitter.com/CppCon/status/912742896905863168 https://twitter.com/CppCon/status/912742896905863168
- werelord 9y agoHis plenary talk at CppCon is well worth it; when its posted online I highly suggest viewing, regardless on whether one uses Abseil or not..
- polskibus 9y agoCan anyone say what's the significance/unique value prop of this library when compared to things like boost, bde, etc.?
- packetslave 9y agoThe "Why Adopt Abseil" page does a pretty good job of laying out the value proposition: http://abseil.io/about/philosophy http://abseil.io/about/philosophy
- tudelo 9y agoThe text is so faint on this web page I hardly want to get through it...
- dom0 9y agoReader view to the rescue
- aaroninsf 9y agoIt's a sad commentary that this is now the de facto correct answer. Optics => default to _Designer view_. Superflat everything; no affordances. Pretty! Clean! Broken.
- evmar 9y agoI noticed that too, so I filed a bug in their repo: https://github.com/abseil/abseil.github.io/issues/46 https://github.com/abseil/abseil.github.io/issues/46
- hydrogen18 9y agoReadable text is overrated in 2017.
- andrewf 9y agoI'm having trouble reading your post, too!
- tudelo 9y agoI wonder why? HN has very readable text.
- fish_fan 9y agoTo take from javascript, this is a mix of underscore (utility) and, uhh, babel(?) for essentially polyfilling certain runtime features slated for future (hypothetical) approval.
- vvanders 9y agoCan't speak to Abseil but I won't let boost within 10,000 feet of any codebase I control. I value my compile times more than anything it provides.
- ubadair 9y agoBoost contains over 120 libraries and counting, with over 70 authors and maintainers. There are many parts of Boost that I will never use (e.g. most of the pre c++11 libs), but the pros of having it available when you need it far outweigh the cons. If a particular library is costing you more in compile time than it's worth in convenience, just rm -rf it from your Boost install -- better yet, write a script to prepend `static_assert(false, "this header is banned by decree of vvanders");` to the top of the banned headers. There's plenty in Boost to love -- don't let a few rotten apples spoil the bunch. Full disclosure: I'm a Boost developer
- vvanders 9y agoSo I should hack apart my install just to get to some basic level of compiler performance? Last time I looked at boost pulling in any header would pull in all of them, that's why it takes so long to compile. In this day with any modern C++0x11 compiler I don't really see the need for boost.
- Layuso 9y agoI value my developing times more than anything. Boost is one library which is developed and tested on almost every c++ target platform, providing us with stable, tested, and performing common utilities to speed up your developments and run anywhere. Reasons not to use boost: - My code is one monolithic spaghetti and I do not use unit tests. - I do not want to learn Boost. - I don't trust template hippies. Not using Boost is an irrational decision and you know it.
- 7197ghr918hf 9y agoA couple of my favorite types and functions in absl: - Span For when you want to take an array or a vector. - string_view Avoids string copies. Makes your program faster. Its creation was a reaction to situations like https://news.ycombinator.com/item?id=8704318 https://news.ycombinator.com/item?id=8704318. (It predates that revelation, but internally the plague of string copies has been known for some time.) - Mutex A better mutex with deadlock detection. - Substitute A string formatting function between 5 and 1000s of times faster than snprintf. Profile your code some time. If it's anything like mine, you might be surprised at how much this matters. - base::Time and base::Duration Excellent wall time utilities, similar to Go's wall clock time libraries.
- roel_v 9y ago"- Span For when you want to take an array or a vector." How's this different from taking a pair of iterators? "string_view" After having read all those articles about c++17's string_view, I still don't really get the real differences. OK, when parsing (i.e. using many substrings) it makes sense (but then you'd usually work with char* anyway); and maybe some people interact with C libraries that only take char* a lot (and in cases where they have to 'cross the boundary' often). So maybe in text-heavy applications (like I imagine C++ application for the web would be) it makes some sense, but I fail to understand why it's causing this much excitement. "Substitute" There are so many fast formatting libraries already - what does this one offer over those? Because it's generally a trade off between completeness/type safety on the one hand, and speed on the other. I use boost::format which is quite slow in benchmarks, but again I don't do much string processing. "base::Time and base::Duration" In what way are these different from boost::date_time and std::chrono? Here again the documentation (for Abseil) seem to be missing. I mean, I'm all for batteries-included libraries - but this just seems to be a few loosely-related classes slapped together and the only reason it's even on here is because it's from Google. There are dozens of similar libraries languishing on sourceforge and github. Compare it to e.g. POCO - this is not even in the same league.
- int_19h 9y ago> I fail to understand why it's causing this much excitement. C++ guys just like zero-overhead abstractions. The more we can get, the better. Passing std::string around has always been a sore point, and occasionally prompted misguided optimizations (like refcounting copy-on-write in g++).
- yegle 9y agoA hidden perk of this project is the open source of "C++ Tips of the Week" (TotW internally). The plan, according to the page, is to post the revised and vetted TotW docs to the public. https://abseil.io/tips/ https://abseil.io/tips/
- erik_seaberg 9y agoAlso: https://news.ycombinator.com/item?id=15339564 https://news.ycombinator.com/item?id=15339564
- RcouF1uZ4gsC 9y agoI think one of the biggest issues for adoption will be the Bazel build system. The C++ world seems to be slowly standardizing on CMake. Having to use another build system to incorporate this library will give people second thoughts about incorporating this library.
- 0xbear 9y agoBazel is not just a build system though. It’s also dependency management system, parallel test system, cross language build system, cross platform build system, and a bunch of other things, with build file syntax a 10 year old could learn in an hour. Some of those things you could plausibly do with CMake, but a lot more effort. Once you learn how to use it (which doesn’t take long) Bazel is pretty darn nice.
- mikepurvis 9y agoNonetheless, Bazel is very much set up for Google's mentality of building giant static binaries from head and shipping them off to a server somewhere, where they'll be replaced in two weeks with the next release, and then never thought of again. There's some software out here in the world that works like that, but most of it doesn't. In any case, CMake is _also_ a dependency management system, but works with libraries in the way that they are shipped on a typical Linux distribution. It lets you find common stuff easily, and has multiple extension points in terms of adding support for new libraries. CMake itself can ship your find module, the library you're linking against can ship it, or you can ship it yourself.
- justicezyx 9y agoTrend wise, applications are expanding more and more into controlling its whole life-cycle from binary to deployment. Repeatable build Containers VM Unikernels Standardized libraries There are other means to share build artifacts or code across language boundary, not necessarily through availability from OS distros. For example, Docker registry solves this issue with container images and overlay FS. I think one way or another, Google's model has been proven to work for large-scale (probably the largest C++ code base on earth) c++ code base. In that I have my full confidence of adopting Google's proven approach. disclaimer: Work at google, but not the c++ team
- ezoe 9y agoIt looks like most of the libraries are C++11 implementation of some of the C++14/17 standard libraries.
- katzdm 9y agoI wouldn't say "most", though this is definitely a slice of what is offered. Some of this is also laying the groundwork for the release of further APIs, as well as making it easier for Google to release/support higher-level libraries (eg. Protobuf, TF, etc).
- geofft 9y agoFor distro packagers, is the idea that this should have SONAME libabseil.so.0 and remain at libabseil.so.0 forever? (I know Google's preferred option is that we all realize that concepts like "distros" and "shared libraries" and "SONAMEs" are so last century, and tbh they are, but we'll have them for a long time yet, and it's helpful for upstream libraries to declare what their preferred SONAME is so that you can use the same dynamically-linked compiled binary on multiple distros.)
- jlebar 9y agoSince abseil doesn't promise ABI compatibility over time, I think the notion is you don't ship libabseil.so.0 as part of a distro. (I'm a Googler, but this is not my project.)
- geofft 9y agoUgh, I missed that they promise indefinite API compatibility but not ABI compatibility. Distros aren't going to like "statically link it, and recompile all the reverse-dependencies when there's a CVE" at all, but I totally understand why that's a sensible approach for something that Google releases.
- fish_fan 9y agoIt’s hard to see the value here of dynamic linking vs static linking, especially when it seems like a lot of the value is compile-time selection of implementations and lightweight utility code—not exactly a huge attack vector you’d want to be able to upgrade independently. And of course it introduces dependency hell, which seems like a poor fit for a library without a consistent ABI.
- jonstewart 9y agoWhatever happened to the B-Tree library? Will it be included in Abseil's container lib some day?
- trimbo 9y agoIt's still available in the Google Code archive: https://code.google.com/archive/p/cpp-btree/ https://code.google.com/archive/p/cpp-btree/
- ggchappell 9y agoIs there any documentation? This looks like it might be good, but I don't know how to tell whether it is. The "Codemap" is just links to repo directories. The "Abseil Introduction" link leads to basically to another version of the README. It does have an "Abseil C++ Quickstart" link, which tells you how to get the package, but doesn't tell you what's in it. I see things about design philosophy, compatibility, etc. But what about: what functions can I call, what do they do, and how do I call them? Is there any way to find out what's in this thing, other than reading source files? ------------------ EDIT. Style guidelines, exceptions policy, leaking checking, platforms guide, linking your code, feature check macros, yadda yadda yadda .... WHAT FUNCTIONS CAN I CALL, WHAT DO THEY DO, AND HOW DO I CALL THEM? (Sorry. I'll go calm down now.)
- katzdm 9y agohttps://abseil.io/docs/cpp/guides/ https://abseil.io/docs/cpp/guides/ This provides partial coverage, for some of the most useful bits. I believe additional docs are in the works.
- ggchappell 9y agoVery partial, yes. But thanks.