Live data from Hacker News

Web frameworks are transforming from runtime libraries into optimizing compilers

tomdale.net

211–220 of 231 posts

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

#211

Earlier quoted context omitted.

People need to stop pulling these "well what about x?" red herrings in an attempt to undermine the discussion.

People also need to stop complaining about things that really are not a problem.

It is really a problem, I'm out of space on my phone due to bloat and it prevents my installing new apps. Sometimes just to update I have to get rid of apps. If you make money off apps then this should concern you.

The next causality is going to be the local sports league, there app has bloated to use 130MB just to show news, ladders and videos. After I uninstall it I'll be much less engaged with the product they are trying to sell me, all because a bloated binary.

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

#212
post #131

Earlier quoted context omitted.

I think WebAssembly has a huge expectations problem: What many people think it is: I can compile my JS frameworks as assembly and ship binaries to the browser, that'll run near-native and be more compact. What WebAssembly actually is: a way to compile libraries from other languages in a manner that you can run them in a JS runtime, but with no access to the DOM, etc. (Think of things like shipping a JS based OCR libr…

> but with no access to the DOM There will be access to the DOM, but even without it, WebAssembly is still useful. You compile libraries that are performance sensitive, you use them from you JS code, and voilà, you have the best of both words : the flexibility and DOM access with JS, and the speed of compiled code with wasm.

Good point – I didn't it wasn't useful, just that there are a lot of people who think that you will be compiling React.js or jQuery as-is to WebAssembly, and just shipping them that way.

That's just not how it'll work.

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

#213

Yet all this is doing so little. It's not like many people are using WebGL and canvases to do interesting graphical things. Mostly they're just messing with scrolling, popping things up, and fading things in and out. All this machinery is way overkill for what it's used for. (Especially messing with scrolling, badly.)

You'd be surprised how often WebGL comes into play, take those silky smooth animations for example...

or, you know, Google Maps.

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

#214
What a terrible title. A "web framework" conventionally is the runtime library, e.g. React, or Ruby on Rails.

The optimizing compilers are part of the "build tools" or "build chain" or "make system". They weren't ever runtime libraries (except in isolated examples), and the general patterns have been around since the 70s.

Yes, it's good to learn how a compiler works.

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

#215
post #121

Domain specific languages I suppose are the next cool aid. Or languages with a comprehensive macro system (like Elixir) can bridge the gap between these ways of thinking. This feels very frontend focused though - I'm wondering if there is a more holistic approach. I have an idea for a framework/project, that over web sockets, views the browser as a thin client for a server side representation; commands would be sent…

"I'm wondering if there is a more holistic approach." The end game, once WebAssembly is fully integrated into the browser, is to expose the 3D API and/or a high-performance low-level 2D API (or both) and slowly, but surely, a "web browser" will become an environment where you download a full rendering engine for a website, written in an arbitrary language that has WebASM support, and in the end both DOM and JS will b…

Unsurprisingly, something along these lines has already sorta been tried [0][1]:

> Famo.us is the only JavaScript framework that includes an open source 3D layout engine fully integrated with a 3D physics animation engine that can render to DOM, Canvas, or WebGL.

They raised a fairly large amount of money, but eventually dropped the idea and moved to a totally different market [2].

Grid Style Sheets [3] gets an honorable mention as well. It compiled GSS rules and applied them as fixed position divs.

I've been researching this subject a bit lately. Surprisingly, many of these problems were already solved in the native world by the end of the 90s. The key innovation from the web is that it's a fully sandboxed environment.

Despite all the web's flaws, one area in which it has done pretty well is accessibility. Many native apps leave a lot to be desired when it comes to basic accessibility... Heck, that goes for many "modern" web apps as well. Hopefully browsers expose good accessibility APIs by the time your vision of developers shipping their own rendering engines becomes reality.

[0] http://deprecated.famous.org

[1] https://github.com/famous/famous

[2] https://techcrunch.com/2015/11/06/nopen-source/

[3] https://github.com/gss/engine

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

#216
post #179
post #169

Earlier quoted context omitted.

James Mickens presents something like this idea: https://www.youtube.com/watch?v=1uflg7LDmzI

Yes, I had the pleasure of seeing him present that live once, though not at that one. I think he was disappointed that people weren't helping him work on it, but I still think that long term the pressures are absolutely inevitable in that direction. It's just that the world at large can't jump there in one shot, it has to get there one very laboriously-worked-out technology at a time first. He's gotten a bit more fam…

It's a very persuasive idea. I also wonder whether Atlantis's stripped-down API could enable a lighter alternative to Electron.

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

#217
post #131

Earlier quoted context omitted.

I think WebAssembly has a huge expectations problem: What many people think it is: I can compile my JS frameworks as assembly and ship binaries to the browser, that'll run near-native and be more compact. What WebAssembly actually is: a way to compile libraries from other languages in a manner that you can run them in a JS runtime, but with no access to the DOM, etc. (Think of things like shipping a JS based OCR libr…

Thanks for putting the discussion back into the realm of reality. For as long as I'm in IT, there has always been the story of an upcoming holy grail of technology that'll change everything aka the silver bullet. Reading through this thread, that role seems currently occupied by WASM, with wild projections of all kind of perceived problems of frontend development and beyond onto WASM. The reality is I have yet to see…

> The reality is I have yet to see a single app making use of WASM on the web.

IMHO a spectacular example is stockfish on lichess.org. On some browsers, like Chrome and Firefox IIRC, it is still slower than PNACL or asm.js, but on Microsoft Edge it is the fastest solution and it's what is currently used for this browser. It should be the fastest solution everywhere once multithreading is added.

The developer of lichess stated that is was fairly trivial to port stockfish to webassembly and compile it for lichess. When I saw it running, I was impressed (and still am).

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

#218

It's crazy to me what amounts to most UI's -- basically forms and buttons, lists of things, images, pages have become so complex. It's like I've died and woken up in a strange, bizarre world where the laws of physics are different, but I still inhabit the same world. Does anyone else feel this way? Is this just how technology works?

Any type of UX interaction was always messy and not very scalable using older javascript. Sure it was do-able and libraries like jquery, which have been shown to be slow, made it convient and easy to write it. But ultimately it was messy looking code. Sure using the basic built-in UX like a button that post a form or a site that just had images on it was simple. Once you added interactivity and the web became a lot m…

You know, that UI's aren't very complex? You know what's scalable? PAGES. The entirety of the (www) internet is done with HTML content that link to another HTML content. The entire Internet!

What would happen if we made the entire Internet a react application? Would that be "scalable"?

Please choose your words more precisely!

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

#219

Earlier quoted context omitted.

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…

Somewhat relatedly - when a new technology wave gets started, it's usually proprietary, because there are big competitive advantages that can be had by being the only one with possession of a new technology. As details leak out and enterprising independent hackers get interested, commodity or open-source clones emerge, and they get much wider distribution simply because they're cheap or free . The original innovator…

This is a very strange example. Gmail, Closure, and Traceur are all Google products.

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

#220

It's crazy to me what amounts to most UI's -- basically forms and buttons, lists of things, images, pages have become so complex. It's like I've died and woken up in a strange, bizarre world where the laws of physics are different, but I still inhabit the same world. Does anyone else feel this way? Is this just how technology works?

Not so much. Components make this simpler than ever.

  import { Button, Dropdown, Slider } from 'antd' //bootstrap, materialdesign,...
  
  const Header = () => (
      
          Home
          
          
      
  )
  
  render(, document.querySelector('#app'))
Post reply on HN