Earlier quoted context omitted.
> It has precisely copied the original API, despite the fact the original API is quite unidiomatic in the new language. STL isn't even idiomatic in C++ ;)
I really wish someone takes the work of ditching the STL as a whole and make an unofficial “version 2” of the same standard library. I mean, IO sucks ass, std::string really sucks, containers like unordered_map are really slow (because of the pointer stability requirements), custom allocators are cumbersome, the regex library is a mess, why are string_view and span different things, yada yada. (And darn those long co…
GoSTL: Algorithm and datastructure library for Go similar to C++ STL
31–40 of 48 posts
Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#32Off topic: is there still no alternative for putting random URLs directly in a source code in order to use some libs?
This is how imports work in go. You make it look like a url, but then can choose in the mod (the module) file if it is local or to keep the url. This makes it quite clean because files have the same import url even as relative paths change, so you can move files all around and the import statements can stay the same. It also has the added advantage that there is no single module repository like in npm. So any url / G…
That only works if no one is using your module as a dependency.
> So any url / GitHub repo works so no module can permanently own a name.
Only if go mod understands the source control mechanism, and only if the HTTP server in front of that speaks the survival go mod protocol. It's a horrible system that the go team doesn't use internally.
Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#33There's a lot of good work put into this. If it is intended as a tool to help port C++ code out of C++ into Go, it looks very useful. If it is intended as a tool to help Go programmers, it has made a common, but regrettably very serious mistake, that programmers make when porting code: It has precisely copied the original API, despite the fact the original API is quite unidiomatic in the new language. I don't want a…
Also, push_back has always been an awkward name choice. Porting would be a good opportunity to rename it to append.
Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#34Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#35Earlier quoted context omitted.
I really wish someone takes the work of ditching the STL as a whole and make an unofficial “version 2” of the same standard library. I mean, IO sucks ass, std::string really sucks, containers like unordered_map are really slow (because of the pointer stability requirements), custom allocators are cumbersome, the regex library is a mess, why are string_view and span different things, yada yada. (And darn those long co…
unordered_map is hash based. It's as fast as any other hash backed data structure. Hash performance is well defined and widely understood.
Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#36Earlier quoted context omitted.
I really wish someone takes the work of ditching the STL as a whole and make an unofficial “version 2” of the same standard library. I mean, IO sucks ass, std::string really sucks, containers like unordered_map are really slow (because of the pointer stability requirements), custom allocators are cumbersome, the regex library is a mess, why are string_view and span different things, yada yada. (And darn those long co…
It was good enough for ATLAS experiments, but what does CERN understand about HPC anyway.
Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#37Earlier quoted context omitted.
> It has precisely copied the original API, despite the fact the original API is quite unidiomatic in the new language. STL isn't even idiomatic in C++ ;)
I really wish someone takes the work of ditching the STL as a whole and make an unofficial “version 2” of the same standard library. I mean, IO sucks ass, std::string really sucks, containers like unordered_map are really slow (because of the pointer stability requirements), custom allocators are cumbersome, the regex library is a mess, why are string_view and span different things, yada yada. (And darn those long co…
Nitpick: the STL (https://en.wikipedia.org/wiki/Standard_Template_Library#Cont...) contains neither of these.
> and make an unofficial “version 2” of the same standard library.
Part of the C++ standard library in some sense _is_ version 2 of the STL.
Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#38The design decision of providing thread safe operations on data structures by default is a pretty poor one. In my experience this is the wrong level of abstraction on which to perform mutual exclusion of certain operations. Normally you want locks around a transaction-like operation that might involve multiple operations on a data structure (or multiple data structures). When just using concurrency safe containers on…
Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#39There's a lot of good work put into this. If it is intended as a tool to help port C++ code out of C++ into Go, it looks very useful. If it is intended as a tool to help Go programmers, it has made a common, but regrettably very serious mistake, that programmers make when porting code: It has precisely copied the original API, despite the fact the original API is quite unidiomatic in the new language. I don't want a…
The whole point of the Standard Template Library was generics. That's the good idea behind the STL, and as I understand it this doesn't support generics, so it's missing this crucial concept. But yes I generally agree with your point. The X language version of a Y language library ought to work the way somebody who has never used the Y language but is familiar with X expects it to work. That's across the board. Go an…
Re: GoSTL: Algorithm and datastructure library for Go similar to C++ STL
#40Someone (I) should fork this and upgrade it to use generics.
STL in Go with generics will be super useful. Can't wait.