Live data from Hacker News

Web frameworks are transforming from runtime libraries into optimizing compilers

tomdale.net

191–200 of 231 posts

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

#191

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…

Yes. This Elixir library aims to have a virtual DOM on the server and send minimal diffs to the client: https://github.com/grych/drab It can already do this for some kinds of diffs, but it doesn't have a full VDOM yet. It basically allows you to build interactive pages without writing any javascript.

Drab is one of the most interesting and impressive libraries to emerge from the Elixir/Phoenix ecosystem.

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

#192

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?

This is typical of the maturation of any technology platform. What is actually happening is a change from a long-term growing complexity to short-term stable complexity.

Historically, building something simple in an HTML page has always been simple. A field here, a button there, you're done.

But with increased requirements, that sort of work became exponentially more difficult to maintain. If you have 10 fields each with the same basic functionality, you'd end up repeating the same thing 10 times. If you wanted some complex state management, you're building it all from the ground up. Your code may be "simple" in the sense that you don't need a build tool, preprocessors, or any dependencies to maintain it, but it becomes increasingly difficult to maintain.

React, babel, webpack et al can make things much more complicated _to start_, especially for someone not acquainted with it. But the trade off is that things keep more or less the same level of complexity. Adding a feature is easier, duplicating an element or a screen is easier.

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

#193

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?

I think you’re understating the complexity of modern web applications. There are lots of web apps out there that cannot be aptly described as “pages,” or even as simply “UI”.

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

#194

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?

This is typical of the maturation of any technology platform. What is actually happening is a change from a long-term growing complexity to short-term stable complexity. Historically, building something simple in an HTML page has always been simple. A field here, a button there, you're done. But with increased requirements, that sort of work became exponentially more difficult to maintain. If you have 10 fields each…

I disagree with this sentiment and it's tautologically false.

Have you ever worked in a mature babel code base? I have worked in many and frequently get contracts to clean them up. I have yet to see a clean one. Can you even point to a clean open source one?

The complexity doesn't reach some steady state, it just keeps growing.

The argument that something simple needs to be complex because of unknown future needs is a prime example of design based on emotion, not engineering.

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

#195

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 more than just dry course dumped information people wanted a way to navigate that.

Even the most simple website can be improved with a hamburger menu to have an always available nav menu instead of the classic scroll to the top or have a fat footer at the bottom.

So a convoluted CSS solution is available by using a type 'checkbox' and seeing if its check in the place of the hamburger.

But really that's shoving your view logic and your ui logic together.

That covers the state of javascript before these libraries. What hacks, work arounds, or messy spaghetti code can we create to make it work. Since it worked for us 10 years ago then making maintainable, readable and sensible code should be considered bizarre and strange?

I see this push back a lot. I think it is cause originally learning HTML, CSS and Javascript was easy compared to what it is now. You learned mostly HTML and CSS and you learned the basic idea of functions and making API calls to the browser like document.getElementById or console.log.

But deep down I've met a lot of these 'older' and 'experienced' javascript developers that wonder why we are moving in such a 'necessary' direction. I find most of them don't really understand programming itself. What the javascript language is doing. What the concepts are. The fact that a lot of calls are to the browser api that are exposed via javascript and not natively part of the 'language' itself. Sure Node has some similar those functions because it's built-in to their library to mimic the similar environment.

Point is, if you enter any other language like Java, Python, C++, C#, Ruby ect, these way we use to code in Javascript were essentially anti-patterns and extremely round-about ways to solve problems instead of using proven design patterns that have been established throughout other languages.

So in conclusion I think the push back is that right now Javascript has become more difficult to learn or adapt at first with the notion that 'its easy'. But the truth is that it has caught up to more mature languages but the browsers have still been lagging behind requiring extra work to learn how to adapt tool chains to build these so they are compatible.

I have no issue with people writing a simple website in React, Vue or whatever SPA or UX framework they want. I think it's crazy if they just serve the straight javascript files as creating static files of their site is rather easy and makes the initial load times to paint quicker and javascript-free friendly. Therefore you get both worlds. Nice maintainable and readable code that is very easy to modify months later with the same benefits of your typical static pages.

Long rant but hopefully you can better see why things moved in this direction even for simple websites.

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

#196

It seems like the less code users have access to, the less control they will have over their computers. Example: it might become harder to block tracking and ads, turning the open WWW into something more like mobile phone apps (which are terrible for the freedom of end users).

[deleted]

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

#197
post #193

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?

I think you’re understating the complexity of modern web applications. There are lots of web apps out there that cannot be aptly described as “pages,” or even as simply “UI”.

Mobile apps have complex UI, yet you don't see them switching ui frameworks every 6 months.

JavaScript is in a bizarro land by itself. I think the main reason is that is a starter language for many folks (the initial learning curve is gentler), and once they get good enough, they decide to re-invent the wheel again and again, just a bit rounder and rounder.

Also, since probably a lot of younger folks get into JS, they are more guilable/eager to just try new things, no matter how broken are they.

Sometimes this actually creates real progress, often it just increases complexity with no real advantages apart being "fancy and different"

This will probably would have been the case in mobile as well, but the realities there are different:

1. You are stuck with what apple and google provides to you, and at max you can build some util frameworks to make things a bit easier. Most replacements attempts have failed.

2. There is a higher/steeper barrier of entry to ship good mobile apps, and smarter/more experienced folks steer away into following the latest fad.

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

#198
post #141

Earlier quoted context omitted.

Facebook app on iPhone is reporting at 1.02 GB for me. Most space used with the exception of storage-based applications like photos/music.

I knew it was big, but didn't think it was that bad. I'm not familiar with iOS, does that figure include the apps locally cached data and/or embedded resources (I imagine retina images and icons could add up quickly) or is that mostly Facebooks infamously bloated codebase?

Yeah that includes cached resources. But in my opinion that's even worse since it's not an app that I would anticipate needing so much cached information.

Music or Photo applications I would expect to grow in size with use. But for something like Facebook to grow 5x in size on my phone with use seems rather disingenuous. Like "hey we reduced our upfront app size by grabbing assets after install!".

Maybe I'm misunderstanding what's happening here?

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

#199
post #173
post #105

Earlier quoted context omitted.

I was just thinking about Opa the other day - it looked nice but I never used it. People were worried about debugging through the layers of abstraction. Is it still "alive"? You write in the past tense...

It is not really alive as of now. But there is still space for a full stack language and Opa is relevant today. MLstate, the startup behind Opa, shifted to secure communication platforms (built with Opa) and was acquired last year but without Opa itself. Many things we did became hype later (implemented in OCaml, a functional language, JSX before React - I know Jordan played with Opa before building React) and we sti…

Tierless programming languages did not started nor ended with Opa. Eliom is very well alive and kicking (disclaimer: I'm finishing my PHD on the topic), as well as Hop, Split.js, Ur/Web, Links, Websharper, ...

I was always very disappointed by the fact that the inner workings of Opa were never described in any way. I can't even really cite it in my PHD thesis, because the documentation for the early (and more interesting, imho) versions has completely disappeared.

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

#200
post #131

The author mentions WebAssembly, yet writes at the end : " and a security model that allows us to forget that we run thousands and thousands of untrusted scripts every day." WebAssembly is designed to run in a sandbox. I suppose that does not by itself make it completely safe, but it can not be much worse than the current situation, can it?

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.

Post reply on HN