Hacker News new | ask | show | jobs
by angersock 4316 days ago
For the curious, this is what is considered "non-trivial":

  .it makes an AJAX request or is loaded along with scripts that make an AJAX request,
  .it loads external scripts dynamically or is loaded along with scripts that do,
  .it defines functions or methods and either loads an external script (from html) or is loaded as one,
  .it uses dynamic JavaScript constructs that are difficult to analyze without interpreting the program, or is loaded along with scripts that use such constructs. These constructs are:
    ..using the eval function,
    ..calling methods with the square bracket notation,
    ..using any other construct than a string literal with certain methods (Obj.write, Obj.createElement, ...).
( http://www.gnu.org/philosophy/javascript-trap.html )

I generally support Richard Stallman (or, as I've taken to referring to him lately, GNU/Stallman or GNU plus Stallman), but this is a set of directives so wildly out of step with common engineering practice that I have to question how seriously others will take it.

Or, perhaps, there's a deeper question here--can programs consumed from others on a network (such as embedded scripts) ever truly be considered free?

4 comments

> I generally support Richard Stallman (or, as I've taken to referring to him lately, GNU/Stallman or GNU plus Stallman), but this is a set of directives so wildly out of step with common engineering practice that I have to question how seriously others will take it.

Its not about engineering practice, its about ideology -- these are only blocked if they aren't attached to an appropriate license notice. This is a tool to maintain an ideologically pure experience, engineering has nothing to do with the purpose.

The point is to know that you are running free software. If it's free and has a free license, then yes, it's easy to be considered free. Free. If it's trivial, you need not apply a license. Trivial. (You may disagree with their standard of trivial vs non-trivial, but if your objection is they set the bar too low, then you missed the point.)

Non-trivial and non-free? Not good for you young one, tread carefully. That is the point and it's obviously not clear, from reading this comment thread (I also didn't get it at first) but, that is clearly a gray area where free software activists/advocates could draw a line and shield themselves by saying "won't execute."

Find a program you would objectively call non-trivial in JS that does none of the things listed in the philosophy doc. If you can, the heuristic algorithm needs a patch to make sure it gets its license checked by LibreJS prior to runtime.

> this is a set of directives so wildly out of step with common engineering practice

how so? It's just a set of guidelines for how program such as LibreJS might interpret what trivial JavaScript code looks like. If you think it's wrong, write to RMS and tell him, or tell me and I'll pass it along.

But something like:

it uses dynamic JavaScript constructs that are difficult to analyze without interpreting the program

calling methods with the square bracket notation

feels like a totally arbitrary restriction. That has nothing to do with free software and everything to do with the difficulty of analysis. Stupid.

They're reasonable signs that the JavaScript is non-trivial, not restrictions. You can write a program that uses them and release it under a free software license and LibreJS will run it.

Here's a good example of a trivial JavaScript program.

<a href="#" onclick="javascript:alert('hello world')">click me</a>

For any non-trivial JavaScript programs, a free software license is required if you want it to be run by LibreJS -- a program designed to block any nonfree software from running on your computer inside a web browser.

I don't understand this view point. If this is about Free Software, then triviality should be irrelevant, either the code is Free or it isn't. I can write an arbitrarily complicated program within their constraints, license it under a non-free license and this thing will run it.
Those forms are not (supposed to be) blocked if they are attached to a free license.
It might be useful to automatically cross reference to a source like GitHub or NPM. Code could very well have licensing information at the source, but not serve it to web clients. Just the name of the library would be enough to get a lot of these.
The name is not nearly enough. I could serve a jquery-1.11.1.js file that has my own proprietary modifications. A checksum could fix this. However, what about when minified JavaScript is served, as is often the case? What source code corresponds exactly to the "binary" (minified source)? People use different minifiers/uglifiers with different settings. And then there's the issue of minifying all of your source files and then concatenating them into a single file. It's a tough problem.
And how would you define the "non-triviality" of JS code?

Actually, you can omit that completely. This extension does not need any triviality heuristics to do what it is meant to do. If it does it - it does it only to make life of its users a bit easier.

It's not about blocking non-trivial scripts. It's about allowing trivial scripts even if they're not explicitly marked as free.