Live data from Hacker News

Web frameworks are transforming from runtime libraries into optimizing compilers

tomdale.net

111–120 of 231 posts

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

#111

I think Angular2/4 already goes into that direction. Afaik it optionally precompiles all templates, which means what ends up in the user-facing HTML/Javascript is not the source but optimized generated javascript from it.

Angular 4 does code splitting, but it's bundle size carries a pretty big baseline

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

#112

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…

> 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.

That ship sailed when we 1) made JS too capable (ability to initiate requests, ability to handle requests instead of the browser, access to too many user actions) and 2) didn't improve the standard input and UI elements enough (sortable, searchable table should be built-in, for example)

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

#113

"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…

This seems to be something of a trend in the software library and tool world:

A problem emerges. Some early, sharp thinkers create tools which attack the problem in a high level, abstract, powerful way... but also with the rough edges that come with being early. These tools get a few adopters, but not that many because it is difficult to see the value versus the obvious rough edges.

Then other sharp thinkers, put off by those rough edges, create N new waves of tools which attack the problem less effectively, but more accessibly.

Then eventually, some years later, common practice of the waves of tools will circle back around and start doing the things that that early rave started.

It's easy to criticize the "daily new JavaScript framework" phenomenon along these lines, but I don't think it is specific to JavaScript, nor specific to 2017, and not even specific to software development. It's just part of how we humans work.

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

#114

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.

Most things suck. Interactive environments where the user can inspect the software they are running, and even change it on the fly, is what all computing environments ought to be like. We should be empowering computer users and making it easy to look under the hood.

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

#115
post #41

Check Svelte out ( https://svelte.technology/ ). From the docs: "... rather than interpreting your application code at run time, your app is converted into ideal JavaScript at build time. That means you don't pay the performance cost of the framework's abstractions, or incur a penalty when your app first loads."

Svelte is quite appealing, especially for the "reusable widget" layer web development. But there are two areas where there's probably room for something else to swoop in:

* Pervasively typed with TypeScript, written in TypeScript, completely first-class. (It is very easy to consume TypeScript base code from JavaScript, but tacking types onto something written without them almost always yields a much lesser experience.)

* Output standards-compliant web components by default. (Perhaps with room to also output some other variation of component, if there is some API aspect where that helps.)

(Distraction for another day: I think the future of SPA development will be web components at the widget/component level, while application frameworks start evolving upward to provide more features around building applications - because there is less for them to do around building components.)

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

#116

Earlier quoted context omitted.

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

It becomes relevant when one doesn't intentionally interpret it in the wrong level of Maslow's hierarchy.

Maslow ? You mean the guy behind the obsolete stuff ? Or the guy who let another one torture monkeys ?

http://journals.sagepub.com/doi/abs/10.1177/135050849743004

https://en.wikipedia.org/wiki/Harry_Harlow

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

#117

I think Angular2/4 already goes into that direction. Afaik it optionally precompiles all templates, which means what ends up in the user-facing HTML/Javascript is not the source but optimized generated javascript from it.

Angular 4 does code splitting, but it's bundle size carries a pretty big baseline

Beyond code splitting, I wonder if a future Angular version may do more aggressive compilation as the linked article and much of this discussion describes, to reduce that baseline. I have written quite a lot of Angular code, and I don't think there is really all that much from and application point of view that absolutely requires a large baseline run time. Much of the same experience and application code base (perhaps with some API adjustments now and then, with semver taken very seriously...) could likely be preserved while making Angular work more and more like an optimizing compiler with a small runtime.

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

#118

Earlier quoted context omitted.

That's only true if you believe focusing things with " substantive effect on consumer response" is the right thing to do. It sounds like a good heuristic in theory, but the practice clearly shows that we ought to be able to do better than that. I mean, if only fraction of the effort that goes towards making things shiny and sexy went towards making them efficient and actually useful, the computing world would be bett…

> That's only true if you believe focusing things with " substantive effect on consumer response" is the right thing to do. I like eating. Which means I like getting paid. Which means the companies I work for have to focus on things like "substantive effect on consumer response" to keep getting money to pay me.

Adding this to the list of anecdotes about why capitalism must end.

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

#119

"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…

This seems to be something of a trend in the software library and tool world: A problem emerges. Some early, sharp thinkers create tools which attack the problem in a high level, abstract, powerful way... but also with the rough edges that come with being early. These tools get a few adopters, but not that many because it is difficult to see the value versus the obvious rough edges. Then other sharp thinkers, put off…

Reading your comment reminded me of a classic piece [1] about a similar phenomenon.

[1] http://discuss.joelonsoftware.com/default.asp?joel.3.219431....

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

#120
post #31

elm is a good example.

Elm is a very good example of a compiler, but (as I recall, unfortunately without information in front of me) it's not that great of an example of doing maximal work at compile time to minimize the size of a runtime support library. I don't remember the kilobytes but they are significant.

That said though, since the Elm language is nicely constrained, it seems possible that a future version of the compiler could keep moving quite far in this direction.

Post reply on HN