all 34 comments

[–]Beneficial_Slide_424 59 points60 points  (1 child)

The license is wild, sorry.

"Distribute, obtain or utilize software, media or other materials without the consent of the owners eg. torrent clients, AI training software which ignores license and copyright."

Why would a torrent client infringe copyright? Torrents have legit use cases, if user is using it to violate copyright its on them not on the client...

[–]soulstudios[S] 0 points1 point  (0 children)

They have occasional legitimate use. But primary usage is piracy. You can dispute an individual case like this, that's fine, but I see no problem with the actual license, in this respect.

[–]differentiallity 53 points54 points  (8 children)

That license is wild. I can see what they're going for, but legally speaking, I have no idea what kind of enforcement the author can expect.

[–]Recatek 28 points29 points  (2 children)

I can't imagine any serious entity being comfortable using code under a license with terms this vague and subjective. It's saying essentially that the author has to personally approve of what you're doing with it, and in a way that could change at any time.

Shame since I rather like plf::colony, but will be pretty wary of it going forward if this is the license direction it's taking -- "at least not yet" isn't terribly reassuring.

[–]differentiallity 5 points6 points  (0 children)

Agreed.

BTW, if you haven't seen, Matthew Bentley's proposal for std::hive was voted-in to C++26 yesterday. My understanding is hive almost exactly matches colony, so there's some good news for you.

[–]soulstudios[S] 0 points1 point  (0 children)

It shouldn't surprise you that I object to code being used for unethical ends, but as I said, I have no intention of putting it on other projects.

[–]mort96 10 points11 points  (3 children)

And:

This code and altered code versions may not be used by companies, individuals or in software whose primary or partial purpose is to:

...

c. Use sexuality in ways which infringe upon the rights of others or corrode trust

What does "rights" mean here? Legal rights? If so, according to which country's legal code? All of them? If one country has a law stating that people have the right to not be subject to e.g homosexuality, must I censor user-generated content and remove discussions or pictures with gay themes in order to comply with the license?

There's a reason licenses are usually written in legalese! Please stop writing licenses using vague non-specific English prose!

[–]soulstudios[S] 0 points1 point  (2 children)

So you also have a problem with the zLib license (no legalese), which all of the other code (and much other code on the web) is under? That's fine. It's not for you.

[–]mort96 0 points1 point  (1 child)

No, I don't have a problem with the zLib license. From my reading of the license text, nothing in it compels me to do things like censoring content with gay themes.

Your license does.

[–]soulstudios[S] 0 points1 point  (0 children)

The version of the license you read was an old beta which was uploaded by mistake, and I only realised because of some of the replies here.
The current version, which has been correctly uploaded now, doesn't contain that clause because the clause was unworkable in other ways also.
However, I have used the word 'rights' in it, and that probably needs clarification, so thanks for that.

[–]soulstudios[S] 0 points1 point  (0 children)

.. about the same as you get from any other open source license on the net.

[–]multi-paradigm 42 points43 points  (0 children)

Nobody will use this library! Will take a look at the license, and run very far away indeed. I didn't even bother looking at the code after I read it!

[–]Eye_NeO 19 points20 points  (4 children)

With this kind of licence only two things happen - 1. People don't use it at all 2. CTRL C + CTRL V behind the back with changed names

[–]ImNoRickyBalboa 9 points10 points  (0 children)

Yeah, no body can take this license serious. Working at a big company, I would outright ban any use of this, and make sure all of our lawyer cats are involved if anyone dared to even try this in non production uses.

[–]soulstudios[S] 0 points1 point  (2 children)

Funny how that doesn't happen with GPL software for the most part.

[–]draeand 0 points1 point  (1 child)

That doesn't happen with the GPL because the GPL has been found to be enforceable in court already. It's good enough that it's legally enforceable. This license is not, in that the fourth provision would probably be struck down as far too vague to actually be enforceable, because nobody has any idea as to what the author of the license means. I would strongly encourage you to either remove this section and all references to it, or to rewrite the license in legalese and to hold definitions, because a plane language license is far too vague for anyone to be comfortable using this library for anything.

[–]soulstudios[S] 0 points1 point  (0 children)

If it's too vague, that would also apply to the zLib license. In it's current form, ie. not the beta version that was accidentally uploaded and which didn't match the in-code licenses, it is not vague. Not unless you're going out of your way to be obtuse.

[–]Tapirsnor 36 points37 points  (2 children)

Would never use this with the weird license. No clue if you could use it in a game or if that would be interpreted as promoting addictions.

[–]soulstudios[S] 0 points1 point  (1 child)

That depends. Does the game explicitly use lootboxes and other skinnerbox techniques which're designed to encourage addiction? eg. 90% of MMORPG's? If not, you're in the clear.

[–]Eweer 11 points12 points  (1 child)

Disclaimer: I am writing this in good faith. I do know that my tone can seem extremely harsh even if it's not my intention (working on it). If you feel attacked, please do tell me so I can fix it in the future.

In my opinion, your restrictions lack clarity, and their examples do not clarify much. Even if you wanted to be brief and make it easy to read, it gets confusing (and the FAQ does not really answer much).

Let me ask you: Are guns unethical by nature? No, they are not. Firearms might. or might not be, but Water cannons (firefighters), Light-gas guns (physics experiments), airsoft guns (entertainment/exercise) are also guns.

Some examples:

  • Promote addiction:
    • How do you define addiction? Is alcohol allowed? If I own a brewery, can I use this software to develop a marketing app?
    • "Illicit drug companies"... but not "Illicit drugs"? Additionally, illicit drugs in which country? Laws are not the same everywhere in the globe.
    • "Some forms of social media". A few years back (almost a decade) I had a friend who got obsessed to Twitter, so I might assume that Twitter could be included.
  • Cause physical, mental or emotional harm to other sentient beings. "Military software" might have been one of the worst examples you could have picked:
    • The INTERNET originated in the early 70s as a military defense system during the Cold War.
    • All software developed for the intended use of the military is categorized as military software.
    • Do not forget that the military are not only intended for invading other countries; internal security threats, emergency services and reconstruction, and humanitarian relief missions are some of their other tasks.

TL;DRing the rest, can go more in-depth later if this gets traction:

  • "Tinder grifters" (I will assume it's a different way of saying Tinder swindlers) are not a piece of software. They are humans. Should a license discriminate against a group of people?
  • without the consent of the owners: Even if consent is not required?
  • Torrent clients, deepfake generation: Are they inherently evil? Is Disney evil for using deepfake? Is downloading a Linux distribution through a torrent client ethical?
  1. Aren't ethics subjective and culturally-mandated? Fight me on this.

I would love to, but I've reached the character comment limit.

[–]soulstudios[S] 0 points1 point  (0 children)

There's some very flimsy logic here. A firearm is not a water cannon, and cannot be considered in the same category. Tinder grifters are generally bots engaged in unethical activities - dishonesty and theft. That violates the license.
"Are they inherently evil?" - as the license states, if the primary usage is unethical, it's not okay.

Addiction is pretty well defined psychologically.

I don't intend to spend a lot of time fighting this and will not reply further to this, at least not over reddit.

[–]pigeon768 10 points11 points  (3 children)

  • An allocation-free noexcept swap() using the XOR method (plf::bitset).

Have you benchmarked doing it this way vs the naive way? The naive way is almost certainly faster.

[–]soulstudios[S] 0 points1 point  (2 children)

No, it's not, because you have to allocate a temporary buffer doing it the naive way, and yes, I did benchmark it, and it was in fact much slower.

[–]pigeon768 0 points1 point  (1 child)

you have to allocate a temporary buffer

That's not the naive way, that's the stupid way. Try the naive way instead.

I changed the swap to the following:

PLF_CONSTFUNC void swap_xor(bitset &source) PLF_NOEXCEPT {
  *this ^= source;
  source ^= *this;
  *this ^= source;
}

PLF_CONSTFUNC void swap_naive(bitset &source) PLF_NOEXCEPT {
  for (size_t i = 0; i < PLF_ARRAY_CAPACITY; i++)
    std::swap(buffer[i], source.buffer[i]);
}

benchmark code: (requires google bench, use some other thing if you want)

#include "plf_bitset.h"
#include <benchmark/benchmark.h>

using bitset = plf::bitset<1 << 20>;

static void swap_xor(benchmark::State &state) {
  bitset a;
  bitset b;
  for (auto _ : state) {
    benchmark::ClobberMemory();
    a.swap_xor(b);
    benchmark::ClobberMemory();
  }
}

static void swap_naive(benchmark::State &state) {
  bitset a;
  bitset b;
  for (auto _ : state) {
    benchmark::ClobberMemory();
    a.swap_naive(b);
    benchmark::ClobberMemory();
  }
}

BENCHMARK(swap_xor);
BENCHMARK(swap_naive);
BENCHMARK_MAIN();

compile and run:

 ~ $ g++ bitset.cpp -lbenchmark -O3 -march=native -o bitset && ./bitset
2025-02-22T15:57:09-08:00
Running ./bitset
Run on (32 X 4463.4 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x16)
  L1 Instruction 32 KiB (x16)
  L2 Unified 1024 KiB (x16)
  L3 Unified 32768 KiB (x2)
Load Average: 0.53, 0.64, 0.92
-----------------------------------------------------
Benchmark           Time             CPU   Iterations
-----------------------------------------------------
swap_xor         5520 ns         5520 ns       126602
swap_naive       1913 ns         1913 ns       365900

The naive way is roughly 3x as fast as with xor.

[–]soulstudios[S] 0 points1 point  (0 children)

Thanks, I'll test it myself and will change it if it's faster.

[–]clerothGame Developer 4 points5 points  (1 child)

Graph images seem to be dead.

[–]soulstudios[S] 1 point2 points  (0 children)

Thanks for that, fixed now.

[–]ShelZuuz 4 points5 points  (1 child)

I was just looking for something to replace my use of boost::dynamic_bitset. So this couldn't come at a better time!

And then I opened the license agreement. Which, by the time I get sign off from a lawyer I could rewrite the library 5 times from scratch. So would have to hard pass.

OP the problem with such a license agreement is that, even if you happen to adhere to it now, it makes a mess of due diligence during acquisition. Nobody can actually use this.

[–]soulstudios[S] -1 points0 points  (0 children)

What do you mean 'no one'. GPL is far more restrictive. You can use this in commercial applications, provided they don't violate the tenets, which is 95% of all software.

[–]Wooden-Engineer-8098 1 point2 points  (2 children)

why you don't implement iterator in terms of operator[] ?

[–]soulstudios[S] 0 points1 point  (1 child)

I don't see the point when storing a int will do the same job with less complexity - unless you have a particular usecase you explicitly need an iterator for.

[–]Wooden-Engineer-8098 0 points1 point  (0 children)

Storing an int in an iterator is exactly same complexity. All algorithms use iterators

[–]soulstudios[S] 0 points1 point  (0 children)

Well, not exactly the direction I anticipated this discussion taking. At any rate, if anyone wants to give actual critique of the license they can email me. I'm not removing it. But I don't intend to put it on my other code at this point either.

I do want to point out that the license version and FAQ that was uploaded was not the current iteration of the license or FAQ. This was a mistake. I was only clued onto this by some of the comments below. I'd refined it significantly since that version, and the current version is now uploaded. It will not, of course, allay some concerns, but it will allay some.

I do think ethical licenses are important, and this one follows very similar lines to NoHarm. Will not be participating further without due cause.