• 0 Posts
  • 13 Comments
Joined 1 year ago
cake
Cake day: June 17th, 2023

help-circle
  • Avoid clone() options _

    I don’t really like that as general advice. A lot of the time a clone is perfectly valid and fine thing to do. More often then not I will read for a clone rather then an Rc or Arc. Its fine, you dont need to be afraid of it. And it misses the more important advice - avoid allocating in tight loops.

    There are lots of ways you can allocate data. Clone being only one and not even all clones will allocate data. So it is a poor thing to get hung up on. If you have an Rc or Arc then clones are cheap. Stack only data is also cheap to clone (and is often copy). Some structs internally use Arc or Rc or are just simple wrappers around copyable types. And it misses other forms of allocations, creating Strings or Vecs, boxing data etc. All of these things including cloning are fine most of the time. But should be avoided in tight loops and performance sensitive parts. And when learning it quite often does not matter that much to avoid them at all.

    I have seen quite a few people make things way harder for themselves by trying to avoid clone at all costs in all situations and IMO articles like this add to that as they never explain the main nuances of allocations and when you want to avoid them or when they are actually fine to use.



  • Because of that prototypes should be small - no more than a week or so worth of effort. Anything larger means it will take even longer to rewrite it from scratch which management will never like and is overall just a waste of time. Most of the time you don’t actually want a prototype - you want a MVP written in the language of the final project as it will become the final product.

    Really the only time I would write a prototype in a different language then the final product is when you don’t yet know the language you want to (or more likely, need to) use or you know another language vastly more than the target language. The time saved by the language is often just not worth it overall when you are reasonably competent in both languages.





  • And that is what it comes down to - binaries vs libraries. For a binary GPL is not that much of a problem for corporations, they can still work with it without giving up their propriety code they ship with it. But for a library, that would force them to give up everything which is a step too far for most corporations. If a language used GPL licences for the majority of their library code then it would basically discourage corporations from using those libraries - and without libraries how much use is a general purpose language?

    then we’ll forever be stuck in a world of companies actively blocking the spread of knowledge, selling us software filled with DRM and proprietary software, making insane profits

    I don’t think we would. Remember, rust and go are both languages written by corporations, with a large number of libraries written by people working for those corporations with most of the libraries still being open source under permissive licences. If the GPL did not exist would that change anything here? And the same goes for NPM, and python packages and a lot of other popular languages. Corporations do give back to these projects, quite a lot, much more than pure volunteers at any rate. Yet they don’t need to given the MIT/BSD licences, they still do.

    Now, some companies do leach far more then they give back. But that does not diminish the amount that companies overall have given to the OSS world.

    I don’t think it’s fair and GPL may not be solution for all the problems, but what else it to be done?

    There are instances where it is unfair. And those instances the GPL does not actually help as much as you think. Like the amazon profiting off offering elastic search as a service without giving much back to the project. If they have not made any major changes to the code base they are well within their rights to sell it as a service under the GPL. Hell, they don’t even need to share changes they do make unless they start distributing the binaries - which does not happen when offering it as a hosted service.

    And you wont stop behaviour like this from the greedy corporations with some copyleft licence IMO - if what you make is popular and has a licence that stops them from using it then they have the resources and reach to create a competitor that out classes your solution. Licences wont solve that problem at all, that is just an inherit flaw with the capitalistic world we live in. Copyleft licences are just a band aid over that real problem so there is only so much they can really do, and which is further weakened by the cost of trying to enforce the license. Without the FSF which is another corporation fighting on the behalf of individuals, the GPL would not be worth anything, a licence is only as valuable as your ability to enforce it.

    So really, the whole system is just broken. But even in this broken system, permissive licences don’t get abused nearly as much as they could be. Corporations have realised there is some value in having multiple others maintain common tools and libraries they use to build things. And so they continue to invest in OSS projects (more and more in recent years compared to the earlier days).



  • However, it’s still definitely not proportionate to the value that the community contributes back and basically gives to the corporations for free with most of them packaging these libraries and binaries and selling their software for much higher profit without ever contributing anything back.

    I think you massively underestimate how much corporations contribute to OSS technology. Even the linux kernel has over 80% of contributions being from people paid to do so:

    The number of paid developers is on the rise, as companies aggressively recruit top Linux talent. More than 80 percent of kernel development is done by developers who are being paid for their work. Volunteer developers tend not to stay that way for long.

    https://www.linuxfoundation.org/press/press-release/the-linux-foundation-releases-linux-development-report

    If you removed all that support, and everything RedHat, Canonical etc have done then the Linux land scape would be baron today. Hell even Debian is basically backed by corporate sponsors to fund their work.

    And after all of that, if corporations did not use Linux or any OSS projects at all then there would be far fewer people getting introduced to it at work, then wanting to contribute back in their spare time.

    So even if companies take far more then they give back, they also give back far more than people doing it for the love of the software. And while some companies might be much more of a leach off what OSS provides, overall corporations give a lot back to the OSS movement.

    the MIT and Apache 2.0 licenses became the de facto standard, and that was without much pressure from the big corporations, though rust has its origins under the umbrella of Mozilla so it’s not that surprising given this context.

    There is actually a big pressure here, libraries under the GPL are very toxic to companies (binaries, like the kernel, much less so). If you base an entire core of a languages library under the GPL then no major company would ever touch that language. This would basically doom the language to a forever niche language. All major languages have a huge amount contributed to them via companies - most having been created by companies to begin with. Most of the popular libraries are written by people who are hired to write in that language and write these things if not while they are being paid to do so then because they might want to use the libraries during their jobs.

    The LGPL might have mitigated this a bit, but companies are still wary of it. And every barrier put up would stunt the languages growth.

    We live in a world dominated by corporations and what they do - volunteer effort (while still valuable) is just a drop in the ocean. A software license wont change this, but can have dramatic consequences on your product depending on what it is you are developing. And the GPL is not always the right choice for a project, especially a library.



  • Does anyone else see this or am I just too paranoid ?

    IMO you are being paranoid. Corporations don’t care about these utilities. They can build stuff using coreutils under the GPL without major issue. Unless they modify the source of the coreutils its self they don’t have to share anything. So it does not really matter what license it is under. And really these tools are extremely basic - not exactly hard to rewrite any of them from scratch if required (as prof of all the different implementations out there, like this and busybox to name two).

    I highly doubt these are sponsored by any big corp, just hobbyists/students that think it is interesting project to undertake that don’t care as much about the GPL as much as they care about doing something interesting to them.



  • I do wonder how it would hold up on court to basically clone something by rewriting it in a different programming language and then relicense it.

    I believe that the US court has already rules that programming APIs are not copyrightable - only the implementation is. So a rewrite of something does not infringe on the original. Though proving you have not copied source from the original is harder - a clean room rewrite is generally preferred for such things (where the authors have not seen the original implementation ever before). I believe the google vs oracle lawsuits over java/openjdk was where the precedence was set. Though I am not a lawyer and could have gotten this wrong.