Settings

Theme

SDSL – Succinct Data Structure Library for C++

github.com

79 points by vsbuffalo 10 years ago · 40 comments

Reader

lorenzhs 10 years ago

The SDSL is very easy to use, and its versatility is quite amazing. It's also rather interesting to look at the list of papers that cite it: https://scholar.google.com/scholar?cites=6772708594529960585 and https://scholar.google.com/scholar?q=SDSL-lite

jbandela1 10 years ago

Cool library. Any thoughts on getting it to work with Visual C++ 2015. It now has pretty decent C++11 support, you already use CMake, and this library seems like something that is inherently OS neutral.

Even when I am ultimately deploying on Linux, I will often develop and debug my os-independent logic using Visual C++ on Windows and then when that is working well, recompile using g++ or clang++.

  • matt4711 10 years ago

    We are working on VS support. Last time we tried to port to VS some of the constexpr stuff we use was not available yet. The next release (in 1-2 month) should have full VS2015 support.

olistovell 10 years ago

Very nice! Why did you choose GPLv3 instead of LGPLv3?

  • matt4711 10 years ago

    The library is very template heavy and thus most of the code is in the header files so I guess it wouldn't change much in this case?

    Additionally, we (the main authors) have lots of contributions from other researchers which we would ask for permission to the change the license (I think?).

    • vog 10 years ago

      Also, using GPL for a library is often the better choice!

      Many people believe that GPL is for programs and LGPL for libraries - as if the "L" would stand for "Library". But that's wrong! This was never the intention. The "L" stands for "Lesser" and means less protection than GPL, for very special circumstances.

      According to FSF, you should use LGPL only for libraries that are competing with widely accepted proprietary libraries. For anything new and original, you should use GPL - to promote Free Software.

      "Why you shouldn't use the Lesser GPL for your next library"

      https://www.gnu.org/licenses/why-not-lgpl.en.html

      (I disagree with that article in one point: If you compete with pervasive software, use a simple license like ISC/MIT/BSD rather than LGPL, to promote their usage even more.)

      • UK-AL 10 years ago

        It makes the library unusable for anyone, but open source software.

        If you write any sort of software, and link against this library, boom all the code needs to be GPL'ed.

        I don't think that's a good thing for promoting a library's use. Most people will just not use the library, and leave a bad taste in there mouth rather than spread the use of GPL.

        If you want your library to popular don't use GPL.

        What happens is that someone else comes a long and creates a MIT version. Eventually it gets replaced with the MIT version.

        • vog 10 years ago

          > It makes the library unusable for anyone, but open source software.

          Well, the author is free to dual-license it to propriertary software for some fee - if they want.

          > I don't think that's a good thing for promoting a library's use

          But it's a good thing for promoting Open Source!

          That's the tactic question here: Do you want to promote your name and your library, or do you want to encourage more people to open source their stuff? In general you achieve both, but the question is: Which aspect is more important to you?

          > If you want your library to popular don't use GPL. What happens is that someone else comes a long and creates a MIT version.

          See https://news.ycombinator.com/item?id=10158535

          • belorn 10 years ago

            I have a very different question when I chose license for my software. I ask if my software might end up being used in a product where someone could get sued for sharing software online.

            I would personally be fine with a new license that simply said "Be nice or don't use my software. You can't sue people who use or share this software. You can't apply for patents and sue people who are being creative and code. You can't stop people from understanding the software that they run on their own machine.". However I doubt many companies would prefer that over GPLv3 so it easier to just use a commonly understood license which Linux distributions understand and find legally acceptable.

            • vog 10 years ago

              > Be nice or don't use my software. You can't sue people who use or share this software

              Would such a rule even be enforcable? If so, what's the penalty if a company sues users anyway?

              I like how the GPL(v3) makes such rules enforcable by trackling them "from behind". For example, the patent protection does not work by saying "you must not sue people with your patents", which one would naively write into one's license. Rather, they say (roughly) "if you distribute the software, this includes a free patent license to all receivers." And this is just one example. There is very clever legal stuff in the GPL, especially v3.

              So I guess that the GPLv3 already does exactly what you want. It just doesn't express this as directly as you would, but more "from behind". However, this is for very good reasons, as it is necessary to do it that way, to make all this stuff enforcable within the legal framework of copyright law.

              • belorn 10 years ago

                I doubt such rule would work in US courts as the legal tradition there put emphasis on exact wordings and would look for precedents which could direct the court into an interpretation.

                The courts where I live (Sweden) would look more into what the author intended rather than the exact wording, so it will accepts much lesser precise wording than other systems. The downside is that you are basically asking what one judge and 3 politicians (lowest court instance) think is the authors intention, common sense in this context, and if the distributor acted with malice or not.

          • jheriko 10 years ago

            i don't buy the rhetoric at face value and i don't think it helps promote open source at all.

            at best its promoting one flavour of open source methodologies in an authoritarian way. not open source software in general... it does little itself to teach us why open source is good, but its easy to learn why GPL is bad and tar all of open source with the same brush.

            the MIT and BSD style licenses are open source, but not militant about it. they are doing much better work to promote open source software imo since people will actually use software that is distributed under them in large commercial projects without fear, meaning that open source libraries do actually get used a lot, which lets people learn their advantages first hand...

            i like your quote about this. that someone will come along and make an MIT version... :)

        • dragonwriter 10 years ago

          > It makes the library unusable for anyone, but open source software.

          Using the GPLv3 is more restrictive than that -- it makes it unusable except for GPLv3 software. Even a preference for open source -- even copyleft -- software doesn't mean a preference for the use-based discrimination in the GPLv3's so-called anti-Tivoization provisions.

          > If you want your library to popular don't use GPL.

          Lots of GPL libraries are popular, though perhaps in some cases less so than they would be if they were not GPL.

          > What happens is that someone else comes a long and creates a MIT version. Eventually it gets replaced with the MIT version.

          IF you do permissive (MIT/BSD/etc) and a sizable fraction of the people interested in your library are also GPL partisans, the reverse happens (and potentially much more quickly) -- some relicenses your library as GPL, and the active community ends up there. So, making decisions on that basis can go either way.

          Use GPLv3 if you want to control what downstream users do and you prefer the particular controls in the GPLv3. Use a different copyleft license if you want to control downstream users and don't prefer the controls in the GPLv3. Use a permissive license if you don't feel the need to control downstream users.

          • batbomb 10 years ago

            I don't think can't just go about relicensing a project willy-nilly, even if it is BSD, without the approval of the copyright holders or a contributor license agreement which the copyright holders agreed to which expressly grants the project the ability to do so.

            • dragonwriter 10 years ago

              > I don't think can't just go about relicensing a project willy-nilly, even if it is BSD

              The whole distinction between permissive and copyleft license is that the former allows downstream relicensing on substantially different terms with very little restriction (typically, something like requiring retaining the original copyright and disclaimers.)

              It probably legally requires enough new creative work for the downstream version to be an original derivative work and not a mere copy that wouldn't be eligible for a distinct copyright, but that's still a lot less than a copyleft -> permissive replacement, which requires reimplementation rather than derivation.

        • pjmlp 10 years ago

          > If you want your library to popular don't use GPL.

          Like GNU/Linux?

      • brlcad 10 years ago

        Wow, this is just wrong. The L originally did stand for Library but FSF/Stallman wanted to discourage its use, so it was renamed it to Lesser.

        LGPL was created to appease authors that didn't want license terms to propagate like GPL, exceptionally common with library and embedded codes. Alas, ignorant authors were also choosing LGPL simply because they were creating a library and FSF didn't like that trend. It was a completely political move to fit their agenda.

        See https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_Lice...

        • vog 10 years ago

          Indeed, the "L" originally stood for "Library", but the FSF declared this to be a mistake as it didn't express their intent. So I think it is fair to say that "L" was never intended to stand for "Library", although it accidentally did for some time.

      • jheriko 10 years ago

        > very special circumstances.

        my experience is that these 'special' circumstances are pretty much "you need to use it in a proprietary production environment" and "you don't want to stop people using your software". this is close to what the FSF say so I don't think i'm far off the mark...

        the problem with GPL imo is that it is manifestly not free. you must abide by severe restrictions to use the code, which for a lot of software development would incur impractical costs.

        even if i want people to use my code for free I never use the full GPL license. i don't see any good reason to becasue i never want to dictate what other people can or can't do with their own software by virtue of having helped them out with mine. i really don't understand the sentiment...

        for example, the choice of GPL here means that nowhere i have ever worked would touch this officially. i can tell you that most of those places are also not thorough enough to stop some random wannabe hotshot programmer from stealing large swathes of code from this repo and using them anyway... (i do not endorse this practice - but i am perhaps a little bitter because i am usually the one who spots these things and has to deal with them).

        • belorn 10 years ago

          If you want to define free as "do what you want" then feel free to do so but don't expect everyone to agree with it. I for example live in a free country but I am far from free to do what ever I want. The word "free" has in that single sentence two different definitions, which is why the word liberty is better.

          But to address one aspect, I do agree that I really don't understand the sentiment to dictate what other people can or can't do with their own software. Suing people for sharing software is wrong, and having EULA's that prevent people from understanding how their software operates is also wrong. The argument that you have to add proprietary licenses in order to earn a living is illogical and only create a world where people don't trust each other.

          • jheriko 10 years ago

            i think you have conflated some political rhetoric with reality there.

            free means free. its an abstract ideal...

            you do not live in a country where people are free, 'free country' and 'liberty' are politically charged terms which evoke particular ideals, which don't directly map to the meaning of the word 'freedom'.

            a big part of society is that we willingly give up certain freedoms for the greater good - this is what law is all about.

            in this particular case i think its clear cut. the GPL stops software from being free compared to an MIT or BSD style license...

            • belorn 10 years ago

              GPL only prevent people from adding restrictions which would stop the software from being free. If everyone agreed to only use MIT/BSD licenses, we would not need GPL.

              It is a clear cut that many who argue MIT/BSD over GPL do so with the intention to add proprietary restrictions, while being dishonest in never talking about that aspect. Adding proprietary restrictions does not make something more free, and it attempts to frame the discussion to be about the word "free" rather than what licenses should be about: The intention of the author. If an author want to allow or not allow people to add proprietary restrictions, they are free to make that decision.

      • matt4711 10 years ago

        Thanks for clarifying this.

    • brlcad 10 years ago

      It would absolutely change. GPL defines any incorporation or usage of a GPL work as a derivative work, thus effectively only permitting other GPL codes to use this library. That means any software in the Apache, Eclipse, or BSD-style ecosystems (among many others) cannot use this.

      As for multiple authors, in theory you were required to have their permission to release it under the GPL (or any other open source license) in the first place. Given your uncertainty, it's possible that permission wasn't obtained and you could already be on unstable legal ground. I would reach out to all contributors and ask them for permission to release under a more flexible license like BSD/MIT or Apache2 to encourage more widespread use.

    • justin66 10 years ago

      >The library is very template heavy and thus most of the code is in the header files so I guess it wouldn't change much in this case?

      Pretty sure the end user is still required to gpl their project if they use your header files.

      edit: the more I think about this, the sadder I get. You prevented the majority of people from including your software and it doesn't sound like you meant to do it. Might be worth a rethink in the next version.

      • amelius 10 years ago

        In spite of its good intentions, a restrictive license such as the GPL is always a weakness and a flaw. I would like to pose the conjecture that any library with a GPL license will eventually be replaced by a library with a more liberal license; the reason is simply because it has one feature extra, which is the more liberal license.

        • vog 10 years ago

          > any library with a GPL license will eventually be replaced with a library with a more liberal license

          That's probably true, but it is not an argument against using the GPL.

          If your GPL library is original and useful, the cost of reimplementing it will probably higher than the cost of making some depending piece of software Open Source.

          So during the time until somebody else wrote that ISC/MIT/BSD version (which may be decades, think of GCC versus clang!), lots of other software may have been made Free Software that would otherwise have been proprietary.

          • brlcad 10 years ago

            I love open source and appreciate free software tenants, but think this is absolutely an argument against using the GPL for library-style codes.

            Your point is an ancillary benefit. Most authors don't publish libraries to encourage the greater FSF-ecosystem or free software agenda -- they publish to make it available to others and see it get put to use. Picking a license that limits prevalence of use is contrary to that objective, plain and simple.

            It also does not necessarily follow that proprietary would have been the alternative to free software. Published as ISC/MIT/BSD, lots of additional open source software would have been able to make use of the library, advanced more quickly, more easily permitted additional open source and free software derivatives, etc.

            More power to authors that choose to use GPL on a library code, as they are certainly entitled to do so, but it is a substantially limiting factor in the near and long term. We do not have to agree on these points. ;)

          • jeffreyrogers 10 years ago

            gcc vs. clang is probably a special case. Code compiled with gcc doesn't become GPL, which is part of why it is so popular.

      • jheriko 10 years ago

        yeah, projects under LGPL (e.g. Qt) include a special modification allowing use of header files so that people can actually use them as pre-built libraries due to the famously confusing 'static linking' statements in the licenses.

        from what I understand even LGPL doesn't allow you to use header files in non (L)GPL code in order to interoperate with an LGPL library.

  • ioquatix 10 years ago

    Why not the MIT or BSD license? It would be more useful for other developers.

    • vog 10 years ago

      I beg to differ. I'm always happy to use external GPL libraries as an excuse for making stuff Open Source. Whenever I talked to unsure customers or managers, this was the single most convincing argument.

      Of course, this only works if people aren't strictly against creating Free Software, but in that case you have lost anyway.

      • qznc 10 years ago

        So you actively use the viral aspect of the GPL to make more stuff Open Source. Probably what Stallman intended. :)

        • vog 10 years ago

          > Probably what Stallman intended.

          Probably? Is is exactly what he intended and what he asks the community to do. :-)

    • KqAmJQ7 10 years ago

      Quiet, Richard Stallman might hear you!

jheriko 10 years ago

this looks very cool but it is a shame about the license and a shame about the code style.

STL is a poor exemplar to follow - its a real wasteland of a library and very deficient compared to libraries for other modern languages.

however i will now go and learn these things and reinvent some wheels to make myself a better programmer.

thanks. :)

amelius 10 years ago

How does it compare in terms of memory and speed, to the GNU implementation of STL?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection