52 comments

[ 2.6 ms ] story [ 99.3 ms ] thread
(comment deleted)
Can it switch between emacs and vi mode (like Deadline)?
No, it has a fixed key binding.
So it'll be of no use to those of us who use the vi mode.
Was that a typo? I've never heard of deadline and that's a pretty un-google-able word. GNU Readline has Emacs & Vi mode.
Or maybe meant as a pun?
While replying to this thread, my browser keeps autocorrecting "readline" to "deadline". So a case where technology makes us write correctly spelled nonsense :).
Phone "helping" me! I meant Readline.
All of this to get around the GPL. Boo!
Yes, it is a shame that there are so many programs out there, that do not provide good line support because of the GPL issue.
Perhaps they should use the GPL.
Why? I assume there are good reasons for not being GPL. Redis for example is BSD. But it cannot use readline because of it is not LGPL.
GNU Readline is GPL on purpose. It's not the GNU project's fault that Redis cannot use Readline. The Redis maintainer isn't interested in protecting user freedom with copyleft, which means that Redis has to live without Readline.
Why is GPL better than BSD for example. I have the full source code of Redis and I can do any change I like. Why is copyleft per se a better solution?
"Better" is subjective. The virility of the GPL gives it certain properties that a BSD license doesn't, which is important to some [many].
They both give roughly the same rights and benefits when using items under the license for your own purposes. The difference is when you want to redistribute. GPL says that when you redistribute, you cannot remove the freedoms you received in the first place. BSD says you can remove those freedoms.

GNU & GPL really are about freedom as in freedom of speech. They ensure items cannot get less free when redistributed. BSD etc are more about getting out of your way, so you can do almost anything you want on redistribution.

Copyleft matters to those who care about freedom first. The FSF has a good explanation: https://www.gnu.org/philosophy/free-sw.html

Historically RMS has been seen as a bit of an alarmist over software related freedoms. However the passage of time often shows he isn't alarmist enough! Here is a good starter article from almost 20 years ago http://www.gnu.org/philosophy/right-to-read.en.html

You nailed it: I pass my days writing OSS code since 1997 and ship Redis with a license that provides the end user more freedom to do whatever she/he wants, because I'm not interested in protecting the user freedom.
This little haiku by RMS sums it up nicely:

    Using GPL
    is encroaching on our right
    to encroach on yours
The "more" freedom you are speaking of is the freedom to choose to deny others freedom.
Let me preface my comment by saying that the purpose of my comment is to let you know why I, an unconverted heathen, do not find your chain of comments compelling. I do not mean to convince you of my point of view, or to refute your points, but tell you why I'm unmoved.

Repeating the same mantra, more forcefully, does not make it any more convincing or true.

I find RMS's reasoning fundamentally flawed, overly simplistic, and though perhaps good in the short-term (less than a decade), detrimental to his stated goals over longer terms. Every couple years I revisit it, and discuss with true believers like you, and am just as unconvinced.

GPL denies me and all users freedoms, and the inability of GPL supporters to even acknowledge that point tells me that politics has overtaken philosophy. The arguments for the GPL may have had more sway over me back in the 90s, but now with decades of actual data from BSD projects, I'm less than convinced that GPL offers more freedom for anybody. In fact, the exact opposite appears to be true.

Politicking is a way to shut off people's brains long enough that lots of people can move in the same direction. Politicking has it's uses, but it has to stop and be reevaluated in order to make sure that his direction is correct, and that has not seemed to happen in the past few decades.

Exactly, if you do an history check, GPL and similar restrictive licenses were used in the last decade a lot by companies wanting to retain control over the code, while BSD / MIT projects never incurred in the issues GPL-convinced people claimed to be the big risks, but effectively provided more freedom everybody.

However to be fully honest, there is something new in the horizon now. The fact is that AWS and other similar service provides are starting to make it almost impossible for BSD projects to use the old viable business model of selling services. Now that BSD projects are "embedded" into AWS (or other) as a "just use" products where all the problems are solved by the service provider, open source as we traditionally thought at it may be a bit at risk. It's not clear to me what the fix for this is. I'm not ok with removing rights from my OSS code, but I feel there is something wrong if the value generated by OSS code is captured mostly by big players selling services.

My understanding of the freedom for GPL is to guarantee the end user to have the freedom. What freedom does a user of a software have if all the open source code is used by some proprietary software? Of course, this does not guarantee freedom to developers, the users of these free software libraries. As an end user of software I like the concept of the GPL and the freedoms it wants to provide, but as a developer not so much (unless I am going to release it GPL anyways).
> What freedom does a user of a software have if all the open source code is used by some proprietary software?

Exactly the same freedom that the user has if that proprietary software did not use the GPL software. It's unchanged. These two worlds do not differ, either the proprietary product doesn't exist, or it reimplemented whatever code was GPLd. The GPL has had no positive impact, there is no more source code available.

Meanwhile, the GPL has restricted the freedom of users from distributing the code as part of a different project.

The GPL is not about freedom for users, it is about control for the original authors. It is about making sure that nobody benefits from the GPL code without making all the rest of the code GPL. Now you may say, that this control of users and programmers means there is more freedom for users. I don't know how, but presumably because there is now more GPL code out there than if it had been an open source license. THAT'S the assumption and the leap that I do not believe, based on the data at hand. I do not believe that the GPL makes more source code available than BSD.

And further, I take umbrage at the unwillingness to even acknowledge that the GPL denies the freedoms granted by open source licenses, all because "freedom" has been narrowly redefined into one thing only: the "freedom from" somebody else using your code without contributing back the changes. Which is a lot like the "freedom from" somebody else using your code without paying you. "Restrictive" means less "freedom," just using a different word that is not loaded with peculiar definitions.

Compared to something like BSD, the GPL is about freedom for the code authors to restrict use of the source code. That is absolutely 100% fine! Go to town! But don't tell me its about user freedom, that's not OK. It makes no sense at all to me. It comes across to me like War is Peace, Freedom is Slavery, Ignorance is Strength. IMHO, history has proven that the "user freedom" arguments about the GPL are wrong, it's about "programmer freedom." People and companies, including me, use GPL when we want to make code available but still want to control it. It's all about having less freedom for people that use the code.

> I don't know how, but presumably because there is now more GPL code out there than if it had been an open source license. THAT'S the assumption and the leap that I do not believe, based on the data at hand.

One example which disprove you believes and whatever data you refer to is the Objective-C compiler. NeXT wouldn't have released it as Open Source if gcc wouldn't be GPL licensed. Source: https://en.m.wikipedia.org/wiki/Objective-C

Further it sounds like you want to argue that the GPL is not a Open Source license. This is also wrong by all reliable sources, e.g. the Open Source Initiative: https://opensource.org/licenses

It seems that the key part of your source is:

>In order to circumvent the terms of the GPL, NeXT had originally intended to ship the Objective-C frontend separately, allowing the user to link it with GCC to produce the compiler executable. After being initially accepted by Richard M. Stallman, this plan was rejected after Stallman consulted with GNU's lawyers and NeXT agreed to make Objective-C part of GCC.[7]

Given that both NeXT and Stallman changed their minds on this issue, I'm not sure that you can argue that Objective-C would not have eventually been open sourced. Especially given Clang.

I'm not sure why you perceive that I think that GPL is not Open Source. Quite the contrary. I'm basically arguing that "Free" software misses the point of open source software. Which is in counter to these very well known opinions:

http://www.gnu.org/philosophy/open-source-misses-the-point.h...

http://www.gnu.org/philosophy/free-software-for-freedom.en.h...

And primarily I object to Stallman's hijacking of the term "free" where the only thing I see is control.

The FSF defines freedom as the four freedoms. Copyleft is about preserving those four freedoms. Copyleft is still free software in terms of the four freedoms. Sure, you could take freedom as being able to do completely anything (or more things than just the four freedoms), but this is like saying the declaration of human rights is bad because it doesn't give you the freedom to enslave others.

So the question comes down to whether or not you think nonfree software is a bad thing. If you don't think nonfree software is bad, then how does it hold that you're saying you care more about user freedom than those who use copyleft?

To me, those who really like and care about freedom to use, study, modify and share software have no problem with copyleft. The people that seem to have a problem with it seem to just want to deny users that freedom. That's really what it is all about. I don't know how on earth you came across this as being like "War is Peace, Freedom is Slavery, Ignorance is Strength", when not having the four freedoms in the case of nonfree software is the real slavery here. And copyleft prevents such nonfree software.

TLDR haiku by RMS:

    Using GPL
    is encroaching on our right
    to encroach on yours
BTW, the LGPL, GPL and AGPL licenses are all "open source" in the sense that they are approved by the OSI, who are the ones who created and defined the term "open source" in the first place. So saying the GPL is not an "open source" license is technically incorrect and confusing.
I like the concept of freedom as an American, but as a cotton farmer not so much.
You've made a claim that GPL denies you, and all users, freedoms, but you haven't explained why. I for one, as a GPL advocate, would be interested to hear your reasoning.
There are a lot of programs, which cannot use GPL for some of its restrictions, e.g. commercial software. But also in general, it is quite restrictive to have to change your softwares license just to use a certain library. Consequently, a lot of non-gpl open source software rather not uses readline than changing their license. I am very happy about any more liberally licensed alternative.
>There are a lot of programs, which cannot use GPL for some of its restrictions, e.g. commercial software.

You mean proprietary software. People that write free software do not want their work used in software that does not guarantee that users will have the same freedoms that they gave to others. I think the thing that a lot of people overlook here is that the proprietary software developers want to impose their own set of restrictions that are incompatible with free software. Let's not pity the poor company that cannot profit off the work of others without sharing back.

I think everyone here is aware of that, and programmers choosing GPL are free to so.

You are the one that came here and chastised people for not agreeing with your license preferences.

As the recent years showed, most companies have no problems "sharing back" modifications of open source products. Some companies (MS, Apple) even open sourced their own developments. The problem is not sharing back. The problem is, that GPL forces the whole program to be open in source and freely shareable between people. Most commercial software cannot exist with such a business model.
> People that write free software do not want their work used in software that does not guarantee that users will have the same freedoms that they gave to others.

Take it easy: there are plenty of people writing free software that don't care about this. antirez answered you somewhere in this thread. Then there is BSD and Apache.

Redis is proprietary software? Things licensed under the CDDL?

Let's look at a very easy and very real situation where the (imo) absurd restrictions of the GPL are actively hurting the Linux community:

ZFS on Linux. We have a fully features and powerful logical volume manager and filesystem that you have to jump through hoops to use and cannot be distributed as part of Linux due to license disputes. Software that was originally developed in an entirely proprietary environment that would have never had the source code see the light of day if it was required to use the GPL due to contractual obligations on other pieces of software used.

btrfs, et al, still have not caught up. With a more sane licensing approach, we could have had years of ZoL improving our lives as a default available filesystem/volume manager, and those with idealistic differences strong enough to want a "truly" open version could have been working on btrfs or other alternatives.

You are attempting to paint the world as completely bifurcated, and it just simply isn't the case.

Not everyone can or wants to use the GPL. We don't live in an ideal, purely altruistic world.
+1

There are even a lot of other OPEN SOURCE projects with licenses (Apache, BSD) which cannot use readline because of their restricted GPL (instead of LGPL).

Well, this isn't correct, it's just that the result would have to be distributed under terms of GPL. (Assuming the license is GPL compatible, which most of the ones you mentioned are).
This project goal is a bit more about replacing readline, but a big motivation for the original project is minimalism and trivial embeddability. It's all in the README.
@antirez: should the linked "linenoise NG" be considered a replacement for your linenoise?

I did diff on linenoise.c and linenoise.cpp (from NG) and very few lines are identical.

I wonder why that was necessary, since NetBSD's libedit exists in a portable form. It is (or was) the default on OS X.

http://thrysoee.dk/editline/

Edit: libedit is mentioned in the readme, and it's implied that the reason for this other library is code size.

Another reason is Windows. Even READLINE breaks when used on Windows with UTF-8 characters.
I'm all for replacing readline. It's an ancient, very closely linked to the everyday experience of using the command line, and not very good. I want my REPLs to have things like syntax highlighting and decent tab completion UI, and readline has positioned itself to have a monopoly on the ability to implement these things but failed to deliver.

But this isn't addressing the real problem, which is that readline gets conjoined with the programs that use it. So if I want to write my own line editor, I have to significantly modify every program I want to use it in, which is enough of an obstacle that I won't do it (and neither will others). Nevermind more difficult architectural problems, like making editing local when on high-latency connections. Still, having a BSD-licensed line editor to start from may be helpful for whoever takes on that project some day.

I would love to see contributions improving LINENOISE NG in this direction.
"But this isn't addressing the real problem..."

Well, he addressed a real problem in my opinion: readline is too large and too complicated for many uses.

I used hping in the old days; while I'm not a Redis user (I use cdb and kdb+ for key/value stores), I really appreciate linenoise. I use it everyday.

I thank the author for a very useful contribution.

there are a lot of forks of linenoise out there now.

this one looks good, but it's a big task to pick through all the divergent copies of the code and figure out which ones have genuine improvements and which ones are now rotting.

there's a rust one too which i recently added mingw/msvc support to. that's actually an example of how this splintering could be causing problems because we've just vendored some upstream version of the native c code and changes may be difficult to send back upstream.

That is one of the reason, why I renamed it the LINENOISE NG. The interface is compatible with the original LINENOISE, but it works on linux, Mac and Windows and it supports UTF-8.
Too bad about the C++, though; my condolences.

(The original authors should have made the header comment "against the idea that a line editing lib needs to be 20,000 lines of C code, or any quantity of C++".)