6 ms·
i.e. the main redesign domain, not old.reddit.com If the old one didn't do this, there's yet another reason to use it... I still believe that part of the reas
by userbinator 6y ago
i.e. the main redesign domain, not old.reddit.com
If the old one didn't do this, there's yet another reason to use it...
I still believe that part of the reason a lot of sites are moving to JS-only SPAs and the like is that it becomes much harder to block things like this. Regardless of sandboxing, the idea of letting a site execute Turing-complete computations on its visitor's computers, just to display what could be done without, is quite repulsive.
- ryanlol 6y ago>the idea of letting a site execute Turing-complete computations on its visitor's computers Why is Turing-completeness the issue here?
- jdm2212 6y agoI think that's being used to mean "it's impossible to predict/reason about/constrain what the computation might do". Turing completeness => it can do anything, you can't predict anything
- ryanlol 6y agoThis only makes sense as far as resource usage goes, Turing completeness has nothing to do with access to APIs which you really need to do anything interesting. Brainfuck is turing complete but can’t call any APIs, you can very much predict that a Brainfuck program won’t be doing anything very exciting.
- Gene_Parmesan 6y agoMaybe, but I think it's an overblown term in these sort of questions. Being Turing-complete doesn't mean that it can do anything. It means that it is isomorphic to a Turing machine; in other words, it can emulate a Turing machine, which means it can compute anything a Turing machine can compute. That's definitely not the same as "do anything." For instance, it doesn't mean it's suddenly granted access to APIs to communicate with the system/break out of a sandbox. I mean, I guess it's theoretically possible for it to create an entire simulated CPU (is it though? not sure...), but not in practice. The more concerning thing is how strong your sandbox is.
- smitop 6y ago> it's theoretically possible for it to create an entire simulated CPU A Javascript x86 implementation already exists: https://copy.sh/v86/ https://copy.sh/v86/
- krastanov 6y agoIf it is not Turing complete, your sandbox/interpreter/whatever can be certain that the code does not do anything "surprising". Basically, you can know at compile time that the program fulfills certain constraints. For practical examples, see the newish virtual machine inside of the linux kernel used to execute constraint "scripts" to control the firewall (https://lwn.net/Articles/740157/ https://lwn.net/Articles/740157/) Proving the same constraints and having the same trust in a Turing complete language is basically the halting problem, which is not computable.
- est31 6y agoAnd that's not the only way the redesign is infringing upon user's privacy. See also: http://archive.is/FGLEF http://archive.is/FGLEF
- seph-reed 6y agoI used to really feel the same, and tried to make no-js sites for a bit. Long story short, eventually you're going to want some user interaction beyond submitting forms, and if you've built your site as anything other than a js SPA, it's quickly going to become ugly.
- kiwidrew 6y agoI wonder, would it be possible to identify a subset of Javascript that is benign? Perhaps some rules about which functions the script is permitted to use, along with restrictions on looping constructs (iterate through an array = OK; unbounded recursion = not OK)... That way simple stuff like: var form = document.forms[0]; document.getElementById('foo').addEventListener('change', function (e) { if (e.target.value == 'xyzzy') form.elements['bar'].classList.add('show'); } ); would be perfectly fine, but crazy "let's exploit the JIT" or "emulate an entire 8-bit home computer" stuff would be rejected. And then, as a bonus, we could dump the entire JIT infrastructure and go back to a simple JS interpreter (a la Duktape) because there just wouldn't be much code left to interpret in the first place.
- bigiain 6y ago> (iterate through an array = OK; unbounded recursion = not OK)... Right, so all we need to do is solve the halting problem... <smirk>
- userbinator 6y agoThe halting problem is about the general case, but when deciding a sane subset of JS, one can always be more conservative.
- saagarjha 6y agoYeah, if your subset of JavaScript is not Turing complete.
- kiwidrew 6y ago
- kiwidrew 6y ago> the idea of letting a site execute Turing-complete computations I'll admit that I have never been keen on the "browse with Javascript disabled" idea, but after my digging around yesterday to figure out why Reddit kept asking me to enable DRM [which I totally should've blogged about but oh well....] it shocked me to see just how much JS code was being loaded on each pageview. Now I'm seriously considering taking the NoScript plunge. The problem is that a light sprinkling of Javascript really can go a long way towards making HTML more usable -- how can we find a way to permit the "good" uses of Javascript while prohibiting all of the "bad"?
- ciarannolan 6y agoI browse with js off by default using the setting in uBlock Origin. It works great. When you encounter a site (usually news sites) where the article looks wonky, just use Firefox's "reader view" which pulls out the text and puts it into a nicely formatted, clean tab.
- dwd 6y agoUntil they work out how to properly disable reader view because it allows you to avoid JavaScript driven paywalls and Incognito/Private Mode nags.
- ciarannolan 6y agoGood point. I think some sites have already figured this out. I'll find one every now and then that clearly has a giant chunk of text in the center, but the reader view option doesn't activate. Wonder if there's a flag that disables it or something.
- zamadatix 6y agoEven HTML without CSS can leak more things than one might want with things like pings and lazy loading, adding in CSS it's Turing complete again (albeit much clunkier). The reason the web could and can never end up being a read only protocol is people like the little features that make it exactly not that. People like that a page can not load images until they are needed, people like that their food delivery status can update without constantly reloading the page, people like the "cool" page that has some wizz bang interactive graphic, people like interactive content with the stream, people like live web chat like discord or twitch. Plenty of people don't have any interest in those things, they just want a book with the occasional image, but that's not what the majority get pulled in by on the web. And once you have those things someone will always take advantage of it. If they didn't have these things they would take advantage of whatever they could. Even now there are tracking pixels and a bunch of other things that have nothing to do with JS being in the browser. The solution isn't to try to say a page shouldn't be able to do "complicated" (for lack of a better term) things. Most people don't find a page running code repulsive. Maybe ads, bad actors, tracking. Even then a surprising number of people don't mind. But the problem wasn't that the browser has Turing complete interfaces. What is the solution for these bad actors and use cases? Don't know. I don't think anyone knows. What I do know is if all people want are books with pictures the web isn't the medium to try to find that content in and hasn't ever really been intended as such (i.e. it's not a new development it's just easier to make and/or abuse dynamic content now).
- tenuousemphasis 6y ago>What is the solution for these bad actors and use cases? A model of paying for resources not based on serving ads and selling data? If you're not paying for a service, you are the product, not the customer.
- zamadatix 6y agoThe models exist they just aren't as profitable as models where you pay for a service and they still gather data. You can pay for Reddit, and YouTube, Twitch (3 personal examples) but that doesn't mean they stop tracking the same kind of usage info or trying to suggest more content to you (additional cost or just trying to hook you on the platform more) like service upsells or side markets they are getting into (YouTube TV, YouTube Gaming, YouTube premium which I think includes YouTube Music now). The problem isn't the inability to create or fund products where the problems don't exist it's making them more attractive and financially successful than ones that don't (regardless of platform).
- skeletonjelly 6y agoreddit also packs in analytics into the voting XHR endpoint I believe they used to use a separate domain or endpoint but being a more tech savvy audience this was blocked by a lot of people. Load a page in old.reddit.com and you'll see a "vote" pop up in the network requests https://www.reddit.com/api/vote https://www.reddit.com/api/vote