6 ms·
He's not writing the C++ standard library from scratch. He's writing his own library, in a different namespace, with some similar functionality. It's easy to wr
by bregma 2y ago
He's not writing the C++ standard library from scratch. He's writing his own library, in a different namespace, with some similar functionality. It's easy to write a non-standard library that only satisfies your limited subset of needs. People do it all the time. It's not special.
The ABI stability boast is based on having no legacy to support. It will work fine as long as everything is shipped only as code and the whole world needs to be rebuilt from scratch every time and even then, you never change any code ever even for a major bugfix. That's hardly practical in the real world where one tiny misstep on the ABI front can result in billion-dollar multinationals threatening suit (ask me how I know). It's a facile claim.
The C++ standard library hasn't been known as "the STL" for almost 30 years, ever since part of the STL was modified and adopted into the C++ standard library. Most of the features he's providing implementations for were never a part of the STL (file I/O, strings, hash maps, UTF-8).
I maintain an implementation of the C++ standard library for a living. It's a full-time job. It's a huge library (note to the committee: please stop) and it's really easy to mess something up. But if you want to write your own library that doesn't do what the standard library does or meet any of its requirements and implementation constraints or serve its real-world purpose, go right ahead. Just don't claim you're writing your own C++ standard library. You're not.
- jb1991 2y agoI agree, and every time I see someone refer to the standard library as the STL, I know I’m interacting with someone who doesn’t actually know the language very well.
- Longhanks 2y agoYet, Microsoft's own implementation was open sourced in 2019 in the repo "microsoft/STL" and in the second line of the readme claims the C++ standard library be also known as STL and the readme continues to use the term STL to refer to the C++ standard library. (https://github.com/microsoft/STL https://github.com/microsoft/STL, https://github.com/microsoft/STL/commit/219514876ea86491de191ceaa88632616bbc0f19 https://github.com/microsoft/STL/commit/219514876ea86491de19..., https://github.com/microsoft/STL/blame/main/README.md#L3 https://github.com/microsoft/STL/blame/main/README.md#L3)
- germandiago 2y agoSTL is actually a subset of the full C++ standard library, which includes, for example, C headers. The STL is the algorithms + data structures + utilities, which are templates.
- Longhanks 2y agoFrom a dogmatic point of view, this might've been correct at some point in time. But, as the links from above clearly point out, most people use "STL" and "C++ standard library" interchangeably (including the very maintainers of one of the most populous C++ standard library implementations), without excluding certain parts of one or the other.
- deleted 2y ago[deleted]
- zabzonk 2y ago> the readme continues to use the term STL to refer to the C++ standard library. Would not be the first time Microsoft were wrong about a standard.
- caspper69 2y agoInteresting that their implementation is Apache 2.0 licensed, yet includes exceptions for LLVM and for GPLv2 licensed code/projects wrt patents. Does anyone know if the library's quality is on par with the GNU or Clang libraries? Google has their own too, if memory serves. Is there an implementation deemed "the best"?
- Longhanks 2y agoThe license was explicitly chosen to enable code sharing with LLVM's libc++ (https://devblogs.microsoft.com/cppblog/open-sourcing-msvcs-stl/ https://devblogs.microsoft.com/cppblog/open-sourcing-msvcs-s...). The MSVC STL's quality is good enough for thousands of pieces of Windows software (including Windows itself & Microsoft's software such as Office) to depend and rely on. It delivers excellent performance for a broad range of use cases. It is actively developed in the open, delivering cutting-edge (C++23 & C++26) features, accepting Pull Requests and wonderfully documented on GitHub. It can be consumed using MSVC and LLVM clang-cl (which the MSVC STL maintainers test with CI infrastructure). The maintainers are actively working on "hardening" features to enable more secure C++ (https://github.com/microsoft/STL/wiki/STL-Hardening https://github.com/microsoft/STL/wiki/STL-Hardening). Unless you specify what "best" or "a library's quality" means to you, MSVC STL is excellent and because of that, the default choice on & for Windows. Google chooses to only support libc++ for Chrome/Chromium (https://chromium.googlesource.com/chromium/src/+/main/docs/toolchain_support.md https://chromium.googlesource.com/chromium/src/+/main/docs/t...). libc++ is not a Google-owned project.
- whobre 2y agoMeh - many simply use STL for the STandard Library. Few people even remember Stepanov’s Standard Template Library.
- pjmlp 2y agoThe SGI documentation for it was quite nice though.
- werdnapk 2y agoSo I haven't been a C++ programmer for almost 20 years now (I would have considered myself very experienced with it at the time) and STL was the Standard Template Library for me back then. Is the Standard Template Library no longer in (widespread) use? Would any modern C++ programmer use it anymore?
- injidup 2y agoA modern c++ programmer uses Rust so no.
- stonemetal12 2y agoThe STL was standardized and made part of the standard library in 1998. So no it hasn't been a thing in more than 20 years. It was around 2003 when I noticed people start to take issue with calling the standard library templates the STL. IDK why. Used yes, referred to as the STL not unless you like hostility from the language lawyers on stack overflow.
- pjmlp 2y agoI use C++ since 1993 and still refer to the standard library as STL, as do many WG21 members in many of their conference talks, do they don't know C++ very well? It is a matter of habit and none of us are going to change, only because some folks think otherwise on the Internet.
- badsectoracula 2y agoPretty much every C++ developer i've ever interacted with the last 25 years -informally- refers to the standard library as 'STL'. I do not think anyone with even a small amount of C++ experience will be confused when 'STL' is referenced in the context of C++. Of course it might be that every C++ developer i've interacted with doesn't really know the language very well. But considering the popular axiom that says something along the lines of 'people who claim they know C++ do not really know C++ while people who know C++ do not claim they know C++' what you wrote might actually be true :-P.
- ryandrake 2y agoWell, a lot of people in general use words incorrectly when speaking informally, that doesn't make that usage correct. Irregardless, for all intensive purposes, I could care less how people say STL.
- billforsternz 2y agoI see what you did there, well played sir.
- messe 2y ago> that doesn't make that usage correct Eventually it does. That's how language evolves. Prescriptivism is pointless pedantry.
- EnergyAmy 2y agoI think you missed that the OP was demonstrating that statement false in the latter portion of their comment.
- ryandrake 2y agoYes, language evolves over long periods of time, but not all incorrect spelling and usage is language evolving in front of our eyes. Sometimes, it's just poor English knowledge.
- wholinator2 2y ago
- dataflow 2y ago> I agree, and every time I see someone refer to the standard library as the STL, I know I’m interacting with someone who doesn’t actually know the language very well. I would put away the judgment. I and many others still call it the STL despite knowing the language and history of the term. Because that ship sailed and it's what many people call it nowadays. Because writing out "the standard library" every damn time gets really tiring really fast. It works in the reverse direction too, btw. The people who constantly nitpick on this are usually the ones who are more focused on being pedantic than being helpful. So that's the signal you send when you do that. Ask me how I know.
- qznc 2y agoHow do you know about a billion-dollar multinationals threatening suit?
- serial_dev 2y agoI mean, I think you have unreasonable expectations for a 1K word blog post. Or maybe I have very low standards and no matter how disappointing a post is, I accept it... could be. However, if I read a blog post on "Rewrite React from Scratch", I'm expecting to see some reactivity and that's it. As a reader, after I see I barely need to scroll to the end of the article (and the repo isn't very big either), I immediately understood that they aren't rewriting C++ standard library from scratch. Of course they can't give all the answers on how to maintain backwards compatibility with decades of legacy stuff with probably billions of devices and exotic use cases..
- munificent 2y agoThis is an unnecessarily combative comment. The author doesn't claim to be implementing the C++ standard library. They clearly say they are implementing a C++ standard library. It's obvious from the context that they mean a hobby-scale set of basic datatype and algorithm libraries. It would take an uncharatible reading to not realize that they mean a lowercase "standard library", not "conforming implementation of the ISO C++ Standard Library". The article literally says "It's my time, and I'll waste it if I want to!" and uses "pystd" as the namespace.
- franzb 2y agoWhat makes his library “standard”?
- munificent 2y agoI think the author pretty clearly means "standard" in the sense of "providing functionality at the same level as the C++ standard library". For example, if I were to say "I'm going to write my own Dune", you'd probably understand that to mean my own broadly-interpreted sci-fi epic, and not literally a clone of Dune with Paul Atreides, the Bene Gesserit, etc.
- bsoles 2y ago> I maintain an implementation of the C++ standard library for a living. I have always wondered: does the standard library have a huge test suite? For that matter, how is the language implementation itself tested against regressions, etc. If anybody has some knowledge about this...