boost VS GSL

Compare boost vs GSL and see what are their differences.

boost

My personal boost mirror to be submoduled by my projects (by darwin)

GSL

Guidelines Support Library (by microsoft)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
boost GSL
17 22
1 5,944
- 1.5%
10.0 6.2
over 13 years ago 28 days ago
C++ C++
Boost Software License 1.0 GNU General Public License v3.0 or later
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.

boost

Posts with mentions or reviews of boost. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-18.
  • Inside boost::unordered_flat_map
    11 projects | /r/cpp | 18 Nov 2022
  • coost v3.0.0 released - A tiny boost library in C++11
    2 projects | /r/cpp | 8 Sep 2022
    coost is a cross-platform C++ basic library with both performance and ease of use. It is like boost, but much smaller, the static library built on linux and mac is only about 1MB in size. Although small, it provides enough powerful features:
  • Ask HN: Is ease in getting started the key for Python's success?
    2 projects | news.ycombinator.com | 9 Aug 2022
    Not so much ease, as flexibility.

    In the end, the thing that matters the most for software is being able to get logic into code as efficiently as possible. This includes being able to write concise code, being able to execute it and see results, debug it efficiently, use libraries easily, and deploy it to production. Python has all of this.

    The rest of the stuff, like strong typing, memory safety, e.t.c are at best academic. The supposed advantages of those just don't hold up once you start to look into the real world. Linux, which runs on most devices that support an os hardware wise, is written purely in C. Python is used as a backend for very big projects like Youtube, Instagram, Spotify, e.t.c. Its also used to run Openpilot (https://github.com/commaai/openpilot), which has performance on par with Teslas autopilot.

    Meanwhile in Java world, with strict typing, you have egregious vulnerabilities like log4shell, amongst others (https://java-0day.com/).

    Language evolution is also a thing to look at with this stuff. The more "strict" you try to make a language, the worse its going to become as people are necessarily going to find hacks around it. With java, type safety strict features like having getters and setters get abstracted away behind an annotation processor that hacks the AST (Lombok), and thats not only considered ok, but is encouraged to be used. With C++, template metaprogramming got extremely out of hand with https://www.boost.org/, where the error messages for one thing used to be pages long. Rust manage to sneak this under the radar with the unsafe clause, which is going to see standard use in many codebases, thus negating any of its advantages.

    In the end, good code comes from good developers, full stop. Every codebase will necessarily have tests for production deployment, and anything that language features don't catch during compilation or static checking can be checked with testing if you have developers that understand what they are doing and can write appropriate testing frameworks.

    And based on that, its pretty attractive to use Python especially when you consider developer time. And the flexibility means you can write your code in different forms to suit your use case, where it be OOP with MyPy type checking, functional, imperative, or super complex if you want.

  • Compile-Time Hash in Plain C (Not Only C++) is Now Possible!
    2 projects | dev.to | 9 Aug 2022
    For those who didn't know what is Boost, it's a C++ library that helps to prevent re-inventing the wheel while trying to program something quite complex as example looping only with macro, Boost Preprocessor. Fortunately, Boost Preprocessor Repeat also works with plain C, not only C++. So, my OrangePi board can calculate hash at compile-time. Unfortunately, my SIX Hash algorithm requires sizeof(input) and Boost... won't... work... with it. Hours of workarounds, no luck.
  • How do I connect a REST API with C++?
    3 projects | /r/cpp_questions | 31 Jul 2022
    If you have the ability to use third-party libraries (though if you can't this project is going to be a nightmare, lol...) I would recommend using the Beast library from the Boost collection of libraries. It's a little bit more verbose than some options, but not that much more, and it's better maintained. REST webservices are built on top of the HTTP framework, so it's just a matter of sending a HTTP GET request to a server (or POST/UPDATE/DELETE, depending on how exactly the api on the other end is implemented) and reading the response you get back. This is a very basic sample of a client sending a GET request to a server. If you need to change this to do a POST (or some other kind of request), there's only two real changes that need to be made:
  • Can anyone explain the differences of Conda vs Pip?
    2 projects | /r/Python | 22 Jul 2022
    The person you replied to used slightly confusing terminology. Conda deals with non-python packages. As in if you wanted to install boost for C++.
  • Looking to download/use Boost
    1 project | /r/cpp_questions | 6 Jul 2022
    I'm not sure if its just me but I'm finding I can't access any of the download links on the Boost Website.
  • Resources for experienced C programmer for C++20/17/13
    4 projects | /r/cpp | 29 Jun 2022
  • How to write reflection for C++
    8 projects | dev.to | 22 Jun 2022
    rich standard library and Boost;
  • Where to read about modern C++ features which you should use?
    2 projects | /r/Cplusplus | 17 Jun 2022
    Boost is also another ubiquitous library. Lots of code that doesn't make it into the standard kind of ends up here. Lots of code that gets into the standard starts here. Boost.Asio might end up being our network API in 23.

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 2023-05-24.
  • 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.
  • I wanna go back to work at a car assembly plant
    1 project | /r/ProgrammerHumor | 8 Aug 2022
    I instead use the GSL and the Core Guidelines, where

What are some alternatives?

When comparing boost and GSL you can also consider the following projects:

jackson-databind - General data-binding package for Jackson (2.x): works on streaming API (core) implementation(s)

CppCoreGuidelines - The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++

coost - A tiny boost library in C++11.

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

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

simdjson - Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks

cpp-core-guidelines-cheatsheet - Cheatsheet for the C++ core guidelines, including a set of tried-and-true guidelines, rules, and best practices about coding in C++.

restclient-cpp - C++ client for making HTTP/REST requests

C-Golang-like-Defer - Cursed defer() method in C++ achieves similar results as Go's defer keyword.

flat_hash_map - A very fast hashtable

score-simple-api-2