BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Google Open Sources Abseil, a Collection of C++ and Python Utilities

| by Abel Avram Follow 4 Followers on Sep 28, 2017. Estimated reading time: 2 minutes |

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 of std::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.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Looks to me like C++ is becoming a "deprecate language" replaced by Rust by Enrique Benito

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

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)).

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT