5 ms·
Here is where RMS went astray with this GCC AST thing. He's insisting that technical barriers be erected to protect something, when that is the job of licensin
by kazinator 4y ago
Here is where RMS went astray with this GCC AST thing.
He's insisting that technical barriers be erected to protect something, when that is the job of licensing.
We would never take some GPL-ed shared library, say, and cripple the API with inconveniences so that proprietary applications can't take advantage of it. That will cripple the free applications too. Of course you make the API technically excellent and complete, and then protect that with the license; it's a GPL violation to link it and call it from a GPL-incompatibly-licensed program.
Same with GCC: expose the full AST so that people are unblocked in doing whatever analysis they want, and protect that with licensing, if you must.
By favoring technical barriers, Stallman is being exactly like the jealous company that didn't give him the information to fix the printer, without signing an NDA.
"You can view a printed version of a partial AST, in a pitch dark room, using a tiny spotlight, and take only handwritten notes, provided you sign this agreement ..."
Come on ...
- LtWorf 4y agoI like the idea but the problem is that gcc isn't a library, so the AST was going to be "output", so not covered by a license. They should have moved gcc into being GPL licensed libraries to achieve this.
- kazinator 4y agoBut then it sounded like he wanted multiple functions in such a library so that the AST is never revealed in its entirety. (As if someone clever couldn't find a way to use them all and piece the AST together?) The underlying problem is this elephant in the room: no matter how you set up the access to the AST, it will be legal for someone to make a GPL-ed utility program which uses that API, and dumps the data to standard output. That utility can then be used in a proprietary development ecosystem, the same way that GNU Bash, Make, CoreUtils, Awk and everything else can be used in a proprietary ecosystem. The subtext behind RMS's arguments is to make it difficult to write such a utility such that it pieces together the entire AST. That's probably why he was vehement on the techincal solution. I'm amazed Stallman just doesn't come to the conclusion "so what?" like everyone else. If someone user finds value in GCC just as a parser, maybe that's better than them not finding any value in it at all. Say someone uses an IDE, whereby GCC is used to help with completion, refactoring and all that. But the actual product that is built for the target uses some proprietary toolchain (e.g. licensed ARM stuff, run on Windows). The back-end parts of GCC aren't used at all. Well, "so what?" That's like saying it's a crime someone proprietary app only used malloc and strcmp from glibc, but rolled its own printf. What if GCC was used to compile the code, but only to obtain diagnostics and maybe run some unit tests? That happens, and I suspect it really bugs Stallman.
- tlb 4y agoThe whole GPL/LGPL dichotomy requires that GPL programs not be usable as part of commercial software. They can discourage linking through copyleft, but they also need to not let their code have any other API, such as an LSP for editors to get type info. Gcc has been hampered by not having import/export between passes for decades. The LLVM ecosystem shows how useful that is.
- discardable_dan 4y agoCouldn't someone with sufficient technical knowledge just write an AST dumper for GCC and release it as a patch? Isn't that the point of Free Software?
- dralley 4y agoAnd they did, but RMS refused to allow any code which did that to be added to either Emacs or GCC.
- deleted 4y ago[deleted]
- alerighi 4y agoI think that there are benefits to not exposing the AST in a compiler, for example the freedom to radically change its internal structure from one release to another without having to maintain backward compatibility with software that use the now public API. He could have used this argument instead, having a public API will put more work on the developers that now have to maintain it. But the argument that this will make it easier for proprietary software to use GCC to parse code doesn't make any sense.