GSL VS abseil-cpp

Compare GSL vs abseil-cpp and see what are their differences.

GSL

Guidelines Support Library (by microsoft)

abseil-cpp

Abseil Common Libraries (C++) (by abseil)
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
GSL abseil-cpp
23 60
6,346 15,603
0.9% 1.6%
7.7 9.6
22 days ago 7 days ago
C++ C++
GNU General Public License v3.0 or later Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

GSL

Posts with mentions or reviews of GSL. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2025-02-05.
  • 21st Century C++
    3 projects | news.ycombinator.com | 5 Feb 2025
    I haven't read much from Bjarne but this is refreshingly self-aware and paints a hopeful path to standardize around "the good parts" of C++.

    As a C++ newbie I just don't understand the recommended path I'm supposed to follow, though. It seems to be a mix of "a book of guidelines" and "a package that shows you how you should be using those guidelines via implementation of their principles".

    After some digging it looks like the guidebook is the "C++ Core Guidelines":

    https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines

    And that I should read it and then:

    > use parts of the standard library and add a tiny library to make use of the guidelines convenient and efficient (the Guidelines Support Library, GSL).

    Which seems to be this (at least Microsoft's implementation):

    https://github.com/microsoft/GSL

    And I'm left wondering, is this just how C++ is? Can't the language provide tooling for me to better adhere to its guidelines, bake in "blessed" features and deprecate what Bjarne calls, "the use of low-level, inefficient, and error-prone features"?

  • 60 terrible tips for a C++ developer
    1 project | /r/cpp | 27 Jun 2023
    Already showed you how to use ranges and such above, gsl::final_action is here
  • Backward compatible implementations of newer standards constructs?
    5 projects | /r/cpp_questions | 24 May 2023
    For span I would recommend the guideline support library - gsl::span
  • Hey Rustaceans! Got a question? Ask here (20/2023)!
    4 projects | /r/rust | 15 May 2023
    Not sure how things are at this point so you might want to look up with those keywords, but a few years back clang-tidy was one of the suggested tools, or enabling the core guidelines checker in visual studio if you're using that. Maybe using GSL or something similar as well.
  • Hardening C++ with Bjarne Stroustrup
    2 projects | /r/cpp | 30 Mar 2023
    When I want safety guarantees, I use the original and run-time checked gsl::span, rather than std::span. https://github.com/microsoft/GSL .
  • I love building a startup in Rust. I wouldn't pick it again.
    6 projects | /r/programming | 18 Feb 2023
    Another solution: use std::span (or some alternative implementations if the codebase doesn't use C++20).
  • C++23 “Pandemic Edition” is complete
    5 projects | news.ycombinator.com | 14 Feb 2023
    If you ask me, the GSL [1] alone is a fairly radical departure from C++ that delivers a lot of safety. I don't know if it's gotten much popularity, though. Probably because it introduces a similar disruption like you might find from a brand new programming language.

    [1] https://github.com/microsoft/GSL

  • Using Rust at a startup: A cautionary tale
    4 projects | news.ycombinator.com | 3 Dec 2022
    > With Rust, though, one needs to learn entirely new ideas — things like lifetimes, ownership, and the borrow checker. These are not familiar concepts to most people working in other common languages ... Some of those “new” ideas are, of course, present in other languages — especially functional ones.

    With C++, lifetime and ownership are just about as important but unfortunately no one's got your back. You can ignore lifetimes and ownership but you do so at your own peril. And the compiler won't tell you you're doing it wrong because the language wasn't designed for it to do so.

    If you want a taste of rust's "mindset" (with respect to limitations imposed by some types) without jumping ship to a new language, try C++'s Guidelines Support Library [1]. It introduces some of the same benefits/friction as switching to rust but without a new language. Opting-in to some of these guidelines might be a gentler way to get some of the benefits of Rust. But it comes with a similarly higher bar.

    [1] https://github.com/microsoft/GSL

  • Passing a std:: array as a function parameter
    3 projects | /r/cpp | 16 Sep 2022
  • I created a memory leak using smart pointers
    1 project | /r/cpp_questions | 27 Aug 2022
    It's also far more verbose than T* or T& (probably intentionally). If you really want a non-nullable pointer, gsl::not_null from the GSL is a good option. Writing your own version is also trivial, if you don't want to add a dependency.

abseil-cpp

Posts with mentions or reviews of abseil-cpp. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-08-05.
  • Don't "optimize" conditional moves in shaders with mix()+step()
    1 project | news.ycombinator.com | 9 Feb 2025
    Maybe you’d like ABSL_PREDICT macros?

    https://github.com/abseil/abseil-cpp/blob/master/absl/base/o...

  • C++'s `Noexcept` Can (Sometimes) Help (Or Hurt) Performance
    6 projects | news.ycombinator.com | 5 Aug 2024
    Their justification is here https://github.com/abseil/abseil-cpp/issues/720

    However, I personally disagree with them since I think it's really important to have _some_ basic reproducibility for things like reproducing the results of a randomized test. In that case, I'm going to avoid changing as much as possible anyways.

  • Open Source C++ Stack
    10 projects | dev.to | 16 Jul 2024
    abseil.io
  • B-Trees Require Fewer Comparisons Than Balanced Binary Search Trees
    3 projects | news.ycombinator.com | 24 Jun 2024
    From the looks of it Rust [1] uses a constant branching factor based on number of items whereas ABSEIL generally uses a target of 256 bytes for branching and fits however many elements fit within that. Rust’s approach seems to be more primitive as ABSEIL is optimizing for cache line usage (not sure why it’s several multiples of a cache line - maybe to help the prefetcher or to minimize cache line bouncing?)

    [1] https://github.com/rust-lang/rust/blob/master/library/alloc/...

    [2] https://github.com/abseil/abseil-cpp/blob/74f8c1eae915f90724...

    [3] https://github.com/abseil/abseil-cpp/blob/74f8c1eae915f90724...

  • AI in Software Engineering at Google
    1 project | news.ycombinator.com | 6 Jun 2024
    From the screencast:

    > implement also for Days

    This fails to recognize that this is a bad feature that the Abseil library would explicitly reject (hence the existence of absl::CivilDay) [0], and instead perpetuates the oversimplification that 1 day is exactly 24 hours (which breaks at least twice every year due to DST).

    Which is to say: it'll tell you how to do the thing you ask it to do, but will not tell you that it's a bad idea.

    And, of course, that assumes that it even makes the change correctly in the first place (which is nowhere near guaranteed, in my experience). I have seen (and bug-reported!) cases where it incorrectly inverts conditionals, introduces inefficient or outright unsafe code, causes unintended side effects, perpetuates legacy (discouraged) patterns, and more.

    It turns out that ML-generated code is only as good as its training data, and a lot of google3 does not adhere to current best practices (in part due to new library developments and adoption of new language versions, but there are also many corners of the codebase with, um, looser standards for code quality).

    [0] https://github.com/abseil/abseil-cpp/blob/bde089f/absl/time/...

  • Sane C++ Libraries
    7 projects | news.ycombinator.com | 27 Jan 2024
  • Open source collection of Google's C++ libraries
    1 project | news.ycombinator.com | 5 Jan 2024
  • Is Ada safer than Rust?
    2 projects | news.ycombinator.com | 2 Dec 2023
  • Appending to an std:string character-by-character: how does the capacity grow?
    2 projects | news.ycombinator.com | 26 Oct 2023
    Yeah, it's nice! And Abseil does it, IFF you use LLVM libc++.

    https://github.com/abseil/abseil-cpp/blob/master/absl/string...

    The standard adopted it as resize_and_overwrite. Which I think is a little clunky.

  • Shaving 40% Off Google’s B-Tree Implementation with Go Generics
    3 projects | news.ycombinator.com | 19 Sep 2023
    This may be confusing to those familiar with Google's libraries. The baseline is the Go BTree, which I personally never heard of until just now, not the C++ absl::btree_set. The benchmarks aren't directly comparable, but the C++ version also comes with good microbenchmark coverage.

    https://github.com/google/btree

    https://github.com/abseil/abseil-cpp/blob/master/absl/contai...

What are some alternatives?

When comparing GSL and abseil-cpp you can also consider the following projects:

cppinsights - C++ Insights - See your source code with the eyes of a compiler

Folly - An open-source C++ library developed and used at Facebook.

span-lite - span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library

Boost - Super-project for modularized Boost

sentry-native - Sentry SDK for C, C++ and native applications.

EASTL - Obsolete repo, please go to: https://github.com/electronicarts/EASTL

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured