Google has made available a number of C++ libraries they use internally for many of their projects. Python ones are to follow soon.
Google has developed Abseil over a decade in order to support the needs of their programmers working on various projects including Protocol Buffers, gRPC, or TensorFlow. Google even says that Abseil is:
a collection of libraries drawn from the most fundamental pieces of Google’s internal codebase. These libraries are the nuts-and-bolts that underpin almost everything that Google runs. Bits and pieces of these APIs are embedded in most of our open source projects, and now we have brought them together into one comprehensive project.
Abseil encompasses the most basic building blocks of Google’s codebase: code that is production tested and will be fully maintained for years to come.
Abseil includes abstractions that initially were not part of C++14 or C++17, but some of them ended up being included in the standard. For example, Google had a type called StringPiece.
Later, C++ 17 added a similar type called std::string_view
, and Google has reworked StringPiece
into absl::string_view
to have the same API as the newly C++ 17 type. Under the hood, Abseil’s string_view defaults to the standard implementation if the developer is using C++ 17 or to Google’s implementation if using a previous C++ version.
The benefit of using Abseil is having access to C++ features not existing in the standard yet, with the promise that Google will rework them to default to the standard when included in it. Google encourages developers to adopt Abseil, mentioning that they have over 250M lines of C++ code that uses it and almost every project builds from the head. That means Abseil is very used by Google and constantly maintained to keep up with the needs of their projects.
Abseil includes the following libraries:
base
- initialization and other basic code.algorithm
- additions to the C++<algorithm>
library and container-based versions of such algorithms.container
- additional STL-style containers.debugging
– debugging library used to check for leaks.memory
– includes C++11-compatible versions ofstd::make_unique()
and memory management.meta
– includes C++11-compatible versions of type checks available within C++14 and C++17 versions of the C++<type_traits>
library.numeric
- C++11-compatible 128-bit integers.strings
– various string utilities.synchronization
- concurrency primitives and synchronization abstractions.time
- abstractions for working with absolute points in time, time durations, and time zones.types
- non-container utility types.
The code has been licensed under the Apache license and it is available on GitHub. A Python version of the library is to be made available soon.
Community comments
Looks to me like C++ is becoming a "deprecate language" replaced by Rust
by Enrique Benito,
Re: Looks to me like C++ is becoming a "deprecate language" replaced by Rus
by Eric Francis,
Re: Looks to me like C++ is becoming a "deprecate language" replaced by Rus
by Enrique Benito,
Looks to me like C++ is becoming a "deprecate language" replaced by Rust
by Enrique Benito,
Your message is awaiting moderation. Thank you for participating in the discussion.
Does it make any sense to start new projects in C++?
Anything that C++ provides through a million of different (not always compatible) libraries plus the extremely obfuscated patched-through-the-years C¿++? syntax, Rust provides for free, out of the box in a much cleaner way.
Not to mention the bug-free thread approach of Rust (detect at compile time, not runtime) and the standard cargo package management.
Re: Looks to me like C++ is becoming a "deprecate language" replaced by Rus
by Eric Francis,
Your message is awaiting moderation. Thank you for participating in the discussion.
You might want to be careful making statements about the deprecation of such a foundational language like C++. Rust isn't the first language to try to challenge C++, see (among others) D, Go, Vala (C# and Java, depending on who you ask). Certainly there are newer languages with shinier features but C++ isn't going away any time soon.
Also, the adoption of new libraries isn't restricted to new projects (which there will still be plenty of those, despite Rust being possibly better-suited to anything you'd want to use C++ for). If using a new library simplifies or replaces some of the code you've got in your codebase, especially code that's been giving you trouble, then it makes sense to update your code to incorporate the new library.
Sure it feels a little late-to-the-game to be releasing new base libraries for C++, but similar could be said about releasing updates to a language that's been around for 30 years (see also Fortran (60 years, a new update is planned for next year), Cobol (58 years, latest release/update was in 2014)).
Re: Looks to me like C++ is becoming a "deprecate language" replaced by Rus
by Enrique Benito,
Your message is awaiting moderation. Thank you for participating in the discussion.
C++ challenges itself.
Copy&Paste from "Expert C programming, Deep secrets" (www.amazon.com/Expert-Programming-Peter-van-Lin...):
"If you think C++ is not overly complicated, just what is a protected abstract virtual base pure virtual private destructor, and when was the last time you needed one?"