372 points · by AlexeyBrin · 7y ago · 150 comments
It’s surprising to see it Apache licensed if that is the case. It seems Plauger is still selling it to other specialized compiler vendors.
Wonderful work
It seems only a little while ago that I heard stories of a friend’s high school programming teacher, who received threats from Microsoft’s legal department for emailing them a patch to fix a crash in Windows 95.
It's still the same Microsoft.
> This is the official repository for Microsoft's implementation of the C++ Standard Library (also known as the STL)
and appears to use the two terms interchangeably. Is this the C++ Standard Library or the STL?
But if you look at the repo you see the C headers like cmath, etc. that have nothing to do with the STL and are just part of the standard library.
The cmath header here just forwards to math.h and has no real content of its own.
So, what that read me says is correct, it is also called the STL. If you want to be precise you should probably only call it the std library though. There are still implementations of the original STL around separate from the std library, so keeping the distinction is probably still wise.
Also to complicate things, some people use the term STL to refer to the specific parts of the std library that are from the original STL. Those pieces are containers, algorithms, functions, and iterators I think.
tl;dr it's all a mess and people say the two meaning different things all the time.
As far as I am aware, those libraries are defunct and unused (e.g. STLPort), so I disagree that there is an important distinction to preserve. The most widely used C++ Standard Library implementations by far are GCC’s libstdc++, Clang/LLVM’s libc++, and MSVC’s STL. Being bundled with compilers means that there is no reason to want an implementation of the historical ancestor library.
There's also the issue of credit. The STL is a work by Alexander Stepanov and Meng Lee. Conflating it with the C++ standard library of which it has become a part—or, worse, with a particular company's implementation thereof—has the distasteful flavor of plagiarism.
I really wish MS hadn't called the repo stl, it just adds to the confusion.
Scott Meyers wrote a book called “Effective STL”, and there’s a somewhat-similar-interface library named https://github.com/electronicarts/EASTL - neither of these lead to confusion.
How are backreferences implemented here?
1: https://github.com/microsoft/STL/blob/master/stl/inc/regex
We regularly recommend customers use Boost if you need an API compatible version, or something like RE2 if you just need a fast regex engine.
The handling of repetition is more revealing, it doesn't appear to have "states" at all but rather is just the usual backtracking: https://github.com/microsoft/STL/blob/master/stl/inc/regex#L...
So the "NFA" is really an AST for the regex rather than an automaton based on Thompson's algorithm or similar.
PCRE's docs continue this confusion. For example, they expose a DFA API... But it's not actually a DFA!
One might say this is similar to how "regex" doesn't necessarily imply "regular," which is true. That's definitely a battle that has been lost long ago. But NFA and DFA are even more specific jargon terms, and the way in which they have been redefined by the Friedls of the world has led to exactly your confusion over and over again.
Also, backreferences stand a chance of turning an NFA into NIA. Turns out it's not possible to programmatically determine which backreference-containing regexes will halt or not.
--- LLVM Exceptions to the Apache 2.0 License ----
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into an Object form of such source code, you
may redistribute such embedded portions in such Object form without complying
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
In addition, if you combine or link compiled forms of this Software with
software that is licensed under the GPLv2 ("Combined Software") and if a
court of competent jurisdiction determines that the patent provision (Section
3), the indemnity provision (Section 9) or other Section of the License
conflicts with the conditions of the GPLv2, you may retroactively and
prospectively choose to deem waived or otherwise exclude such Section(s) of
the License, but only in their entirety and only with respect to the Combined
Software.> Non-goal: Porting to other platforms.
Last I heard, the maintainer of MinGW was one of those: never booted Windows, and tested only on Wine. (That was 20 years ago.) Someday Microsoft will be among their august number.
Clang is a great compiler! We think it’s extra great with our STL. We added Clang/LLVM to the VS installer to make using it easier.
Last time I had to resort to copying the files from an installation on a Windows machine (which is not very convenient).
Did Microsoft do this?
A quick Google search turns up nothing.
Or were you using artistic license, equating announcing that they’re open-sourcing something with leasing physical billboard space?
You can read why here - https://github.com/tensorflow/swift/blob/master/docs/WhySwif...
Apple also open sourced their kernel for iOS/MacOS
While Im not a fan of the corporation, its strategy and most of the policies, some dilligence is due here. They are known to release low level stuff.
In reality, I don't bother to do that and whenever I teach C++, I ignore MSVC and its STL. I'm willing to teach but Nooo, it's MS who prohibit me to do so.
Now I can't use that excuse anymore.
(Yes I know it can be found in the SDK, but having it as a repo on GitHub would just be so much more convenient.)
#pragma warning(disable : 4786)
?[1] The "new MS" seems to delight a lot of people, but IMHO it's not all great; I'd much rather they not be "shedding" all this open-source stuff and kept selling software, if it meant they wouldn't stuff telemetry in everything they touch.
Just in case you/any other reader didn't know: That's just because they don't consider the ucrt compiler-version-specific anymore, it's distribution (binaries and source) moved into the windows SDK, E.g. Windows Kits\10\Source\10.0.17763.0\ucrt. The vcruntime is still with MSVC.
But this source never included the STL.
I'll concede I'm probably missing some obvious gotcha.
You mean things like vector, map, etc. ? The source for those is already in the header files.
An example would be if any performance enhancements can be ported to other C++ implementations.
Please file an issue if you encounter macros that don’t appear to be necessary.
CRT source really should also be also in an easy to find place instead of tucked away in the Windows SDK. But I've given up expecting any kind of actual developer consideration from the new Microsoft.
This also doesn't actually appear to have any commits corresponding to any released compiler versions- commit history only goes back a couple of weeks. I suspect they'll show up once an actual release has shipped out of this repository.
Unfortunately, we will not be making the history prior to the GitHub “Initial commit” public. It would be a huge amount of work, would bloat the git repo, and would be of little utility. (We occasionally have to perform programmer-archaeology, but rarely more than a year, and usually it’s only something that the developer who made the change can do due to personal memories.)
Consider this a fresh start. We will figure out a way to tag commits corresponding to shipped releases.
Of course, but my point about the new Microsoft was in relation to UCRT source, which used to be part of the standard VC runtime library and distributed with the compiler.
This new release of the c++ stdlib is fine and I'd actually be fine with the entire C/C++ runtime (including UCRT) being on github. At least there'd be just one place to look for it.
(re "We're working on a CMake build system... Until that's done, we're keeping our legacy build system around in the stl/msbuild subdirectory. (We're keeping those files in this repo, even though they're unusable outside of Microsoft, because they need to be updated whenever source files are added/renamed/deleted. ")
It's also fairly well documented: https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuil...
No, flipping, thanks.
Surely microsoft can, you know, pay you for the copyright if they want own it when they decide to merge your work? Or just take it on the same license. And as far as providing legal guarantees for microsoft? Yeah that's gonna be a no from any sane individual. Perhaps a big company like google might agree to those terms but also, perhaps not.
So no they don't want you to contribute, at all, or they'd do it right.
This looks quite disappointing. But as noted elsewhere you can read some source, or fork and refuse to contribute back I guess... But why?
No, you don't. You have to provide Microsoft (and anyone else, for that matter) a license to use your contribution per the CLA, but you still own your work. See section 5(a), https://opensource.microsoft.com/pdf/microsoft-contribution-....
All open-source licenses effectively require this; otherwise, by default, nobody would have a right to copy or use your contribution.
> give them a guarantee in case anyone sues microsoft over your work
I don't see an indemnification clause in the CLA. Which language are you referring to?
> (People sue without merit literally all the time and legal fees are bankruptcy material for any individual)
If they had even a shred of plausible belief, the estate of Elvis Presley could sue you tomorrow for defecating on a sofa at Graceland and potentially bankrupt you, even if you've never visited. What's your point?
"a. Copyright License. You grant Microsoft, and those who receive the Submission directly or indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license in the Submission to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute the Submission and such derivative works, and to sublicense any or all of the foregoing rights to third parties. "
The project has a license, just use it.