Abseil - let the savior come?

15

Click here to load reader

Transcript of Abseil - let the savior come?

Page 1: Abseil - let the savior come?

ABSEIL - LET THE SAVIOR COME

IGOR SADCHENKO

[email protected]

Page 2: Abseil - let the savior come?
Page 3: Abseil - let the savior come?

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

Why Adopt Abseil?

Or: Why the world has room for another collection of C++ utility libraries

There are a few main reasons we recommend Abseil as your first choice for utility code when starting a new C++ project:

Compatibility with current and future C++ standards, and planned evolution over time

Compatibility with Google OSS projects - these are the foundational types for things like Protocol Buffers, gRPC, and TensorFlow

Upgrade Support - make it easy to live at head

Production Experience - These are the interfaces that we are using in Google production

Interest in a different set of design priorities than the C++ standard

Page 4: Abseil - let the savior come?

3

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

CodemapThe Abseil codebase consists of the following C++ library components:

base Abseil Fundamentals

The base library contains initialization code and other code which all other Abseil code depends on. Code within base may not depend on any other code (other than the C++ standard library).

algorithm

The algorithm library contains additions to the C++ <algorithm> library and container-based versions of such algorithms.

container

The container library contains additional STL-style containers.

debugging

The debugging library contains code useful for enabling leak checks. Future updates will add stacktrace and symbolization utilities.

memory

The memory library contains C++11-compatible versions of std::make_unique() and related memory management facilities.

Page 5: Abseil - let the savior come?

4

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

CodemapThe Abseil codebase consists of the following C++ library components:

meta

The meta library contains C++11-compatible versions of type checks available within C++14 and C++17 versions of the C++ <type_traits> library.

numeric

The numeric library contains C++11-compatible 128-bit integers.

strings

The strings library contains a variety of strings routines and utilities, including a C++11-compatible version of the C++17 std::string_view type.

synchronization

The synchronization library contains concurrency primitives (Abseil’s absl::Mutex class, an alternative to std::mutex) and a variety of synchronization abstractions.

time

The time library contains abstractions for computing with absolute points in time, durations of time, and formatting and parsingtime within time zones.

types

The types library contains non-container utility types, like a C++11-compatible version of absl::optional.

Page 6: Abseil - let the savior come?

5

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

C++11 and Above

Linux:

gcc, clang: -std=c++11

gcc, clang: -std=c++14

clang < 5.0: -std=c++1z

gcc, clang 5.0+: -std=c++17

Page 7: Abseil - let the savior come?

6

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

C++11 and Above

Mac OS X:

gcc, clang: -std=c++11

gcc, clang: -std=c++14

clang < 5.0: -std=c++1z

gcc, clang 5.0+: -std=c++17

Page 8: Abseil - let the savior come?

7

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

C++11 and Above

Windows:

msvc /std:c++14

msvc /std:c++latest

Page 9: Abseil - let the savior come?

8

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

Supported Platforms

Page 10: Abseil - let the savior come?

9

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

Supported Platforms

Page 11: Abseil - let the savior come?

10

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

Supported Platforms

Page 12: Abseil - let the savior come?

11

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

Supported Platforms

Page 13: Abseil - let the savior come?

12

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

LINKS

Abseil

https://abseil.io

CppCon 2017: Titus Winters “C++ as a "Live at Head" Language”

https://www.youtube.com/watch?v=tISy7EJQPzI

Page 14: Abseil - let the savior come?

13

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

GET STARTED!

Page 15: Abseil - let the savior come?

14

C++ COREHARD AUTUMN 2017

IGOR SADCHENKO // C++ COREHARD // 14.10.17

THANKS!