Live data from Hacker News

Web frameworks are transforming from runtime libraries into optimizing compilers

tomdale.net

61–70 of 231 posts

Re: Web frameworks are transforming from runtime libraries into optimizing compilers

#61

Earlier quoted context omitted.

Honest question: apart from nerds, what reason do we have for valuing 'View Source'? I mean, you can't 'View Source' anything of the computer the browser is running on, or the browser itself.

Learning: I learned a big deal of web development (HTML, CSS and JS) from view-source. Tweaking: I sometimes fix broken closed-source/proprietary applications or websites by checking the source and writing a user script. Those two can probably fall into the "Nerd" category, though...

When I was a kid and started doing that, I thought that the compiled scripts were written like this, and I was fascinated (and terrified) by how complex they were.

Re: Web frameworks are transforming from runtime libraries into optimizing compilers

#62

Whilst I am in favour of the optimisation of resources (and use these sources) we are willingly moving the "View Source" model to for profit entities like github. In the way the internet has evolved we really should look hard it the elephant in the room: the DOM is for documents - not for interfaces. IMHO optimisation for javascript is just a short term fad (hopefully) and browsers will adopt a more open approach to…

Honest question: apart from nerds, what reason do we have for valuing 'View Source'? I mean, you can't 'View Source' anything of the computer the browser is running on, or the browser itself.

None apart from that.. but the freedom to easily tinker and understand whats going on has massive impacts on the industry in the long term.

Technology is becoming easier to use, but more sophisticated and more of a blackbox so much harder to understand or replicate. Higher barriers to entry in the market, more power to existing gatekeepers. Fewer and fewer people will understand enough to wield influence and those people will be employed by big companies for tons of money. It shifts the balance of power and only a select few people can expect to have a big impact.

Simple example - imagine Google was as easy to replicate as it was in the very beginning. If you disliked the direction ads & privacy are heading, maybe 4-5 people could make their own search engine just as good with more privacy rights and less creepy tracking. Now it will take 100 people and billions of dollars to even get close...

barriers to entry go up => resources required to compete with existing players go way up => existing players get more power => existing players abuse power. Ahh the business cycle.

Re: Web frameworks are transforming from runtime libraries into optimizing compilers

#63

> When it comes to eking performance out of hand-authored JavaScript and accompanying runtime libraries, we’ve reached the point of diminishing returns. Are you saying that web developers are writing the best code that they can? That future gains are going to come from more advanced js preprocessors instead of more informed developers? I strongly disagree that we have reached any sort of diminishing returns when it c…

> my advice for anyone who wants to make a dent in the future of web development: time to learn how compilers work.

Many people in web development went there because it's the one place in IT development where they don't need to learn CS stuff like parsing, compilers, and assembly code.

Re: Web frameworks are transforming from runtime libraries into optimizing compilers

#64
post #10

"The trend started by minifiers like UglifyJS and continued by transpilers like Babel will only accelerate." Those were predated by Closure Compiler, which was started with Gmail, and Closure Compiler in some ways still doesn't have an equal. Besides being a fully optimizing compiler, it also has a module system for code splitting, and optimization passes designed to move code at the method/property level from initia…

Those features are supported in Webpack and other bundlers. Code splitting: https://webpack.js.org/guides/code-splitting/ Tree shaking: https://webpack.js.org/guides/tree-shaking/

React moved some parts from Uglify to Closure recently. They're only compiling using "simple" ("none" and "advanced" are the other options), but they're still seeing benefits: https://github.com/facebook/react/pull/10236

Re: Web frameworks are transforming from runtime libraries into optimizing compilers

#65
post #11

> a small 40MB iOS app What a sad, sad world we find ourselves to live in.

Indeed, we no longer worry about food, safety and survival and instead our sadness is directed at irrelevant application binary file sizes.

The sadness does not step from the size of a random binary file per se. The sad part is the prevalence of attitudes deemed unprofessional among people of a certain profession.

It's sad for example, that with all the technologies available to us, to imagine what we could have, and compare it with what we do have.

Re: Web frameworks are transforming from runtime libraries into optimizing compilers

#66
post #11

> a small 40MB iOS app What a sad, sad world we find ourselves to live in.

Interesting is that usually an equivalent Android app will be about 15-20MB. For larger apps (like Facebook) the difference can be even up to 4x as much (and that's after AppStore stripping).

Re: Web frameworks are transforming from runtime libraries into optimizing compilers

#68

OT, but this jumped out to me: > In the same way that a compiled Android binary bears little resemblance to the original Java source code From what I recall, Java binaries actually look a lot like their source code. They're not human-readable of course, but you can decompile them very easily and get fairly good code back out. This made Minecraft an easy game to mod: just decompile a class, change a line or two, recom…

Android code goes through ProGuard on release usually, which is an optimizer (and obfuscator if enabled). It usually makes a lot of optimizations on bytecode level which makes decompiled code noticably harder to read.

Re: Web frameworks are transforming from runtime libraries into optimizing compilers

#69
post #5

I don't think so. Browsers will catch up with what developers want. We have seen that with ActiveX, Flash, Java applets, jQuery etc. Every time tech was needed because "The browser alone is not good enough" the browser became better and made the additional tech obsolete.

> the browser became better and made the additional tech obsolete. And almost every time, a separate browser codebase died and a vendor switched to WebKit. Because with all this cruft, maintaining a browser codebase has become a nightmare only few can afford.

> with all this cruft, maintaining a browser codebase has become a nightmare only few can afford.

Perhaps this is not all too inconvenient for those few ...

Post reply on HN