Live data from Hacker News

Ask HN: Write once, run anywhere front ends failed. Thoughts?

news.ycombinator.com

1–10 of 26 posts

Ask HN: Write once, run anywhere front ends failed. Thoughts?

#1
I think the idea of one programming language everywhere has sailed, for a while at least.

It looked like JavaScript was going to be able to do it. React and React Native were very promising.

But since we now have Swift/SwiftUI and Kotlin/Jetpack, each platform has a language and framework specifically tailored for it. Except for Windows which is still a shit show.

Attempts to abstract this in a cross-platform layer are becoming more and more difficult, and offering less marginal value (e.g. we now have declarative frameworks natively whereas before we only had React).

Each platform has a recommended way to do everything, and we should follow the conventions of each platform.

I would be interested to hear if anyone has actually had successful though with frontend code sharing...

Re: Ask HN: Write once, run anywhere front ends failed. Thoughts?

#3
Do you have thoughts and opinions on the various options for Windows desktop development? I would be curious to know, I am starting to work on a Windows desktop app. I am assuming that the first, MVP-style, attempt will be using Electron.

But I am also wondering if Maui will end up being a better option, or if I will be able to have an excuse to use the Avalonia framework for F#

Re: Ask HN: Write once, run anywhere front ends failed. Thoughts?

#4
Web applications. If it is at all possible to make it a a web application why mess around with anything else? The other day I was struggling with "How the hell do I tell Android users how to find a QR code that really works in the play store" and then it hit me... Web based QR code reader and done!

It can be depressing that you have 20 electron applications running to put icons in the tray but heck... everybody wants to stuff icons in your tray and most of those x-platform frameworks can't make a tray icon. I did an evaluation of a whole bunch of x-platform frameworks and they all sucked, though I do like JavaFX best of all. There's a reason why Electron is as big as it is.

Re: Ask HN: Write once, run anywhere front ends failed. Thoughts?

#5
I will poison my own well and state that I don't think my opinion is a good one but I've come to admit the reasoning behind suckless-type software.

Might not even be adjacent to the topic of this thread but I remember the one time I accidentally found out about UNIX pipes in a bioinformatics course. I didn't know you could use computers in a way that would help you get things done gracefully and without GUIs. I didn't know I could just type in `curl wttr.in` and get the weather results instantly. I didn't even know about vim. I didn't know that an OS could occupy less than 1GB RAM on idle and still let you fully operate and do all the work that you need to do.

You can't just keep abstracting things to work with ways of computing that are just more painful to work with. At one point the end-user has to adapt and simplify for his/her own sake. I wish I did sooner.

Re: Ask HN: Write once, run anywhere front ends failed. Thoughts?

#6
JavaScript has accomplished this, though. It's just that React Native/Phone Gap isn't as performant as native. I'd argue though that the web is a "run anywhere front end" given that pretty much everything has a web client these days, even TVs.

The main issue around this is that there's not a great interface to use native functionality on the web, hence all of these compilation attempts.

Re: Ask HN: Write once, run anywhere front ends failed. Thoughts?

#7
I have been on two projects now that use web frameworks to ship complex management applications and both were nightmares. The cost of doing even simple changes was not small. React has been way worse than angular on this front too. People do not understand it. They do not think "the react way". They invariably code something that doesn't consider reacting to change properly and now you have a complex component that is refreshing all the time

Re: Ask HN: Write once, run anywhere front ends failed. Thoughts?

#8

Do you have thoughts and opinions on the various options for Windows desktop development? I would be curious to know, I am starting to work on a Windows desktop app. I am assuming that the first, MVP-style, attempt will be using Electron. But I am also wondering if Maui will end up being a better option, or if I will be able to have an excuse to use the Avalonia framework for F#

I think avalonia is much more promising than Maui as the latter seems to be kind of mythical in nature.

Re: Ask HN: Write once, run anywhere front ends failed. Thoughts?

#9

I have been on two projects now that use web frameworks to ship complex management applications and both were nightmares. The cost of doing even simple changes was not small. React has been way worse than angular on this front too. People do not understand it. They do not think " the react way ". They invariably code something that doesn't consider reacting to change properly and now you have a complex component that…

Half me wants to say that the SSR-based web application was a revolution. I had a boss who was both a sales genius and an obnoxious penny pincher and he had a pitch that "custom software development was more affordable than ever" and I would back up that with an explanation of the miracle of the relational database and the "stateless" applications that could be built out quickly.

The thing about React is it can be so much fun if you have a clear plan for how information flows in the application. If you don't it can be hell.

I was working on "Rich Internet Applications" based on Javascript not long after Google Docs came out and back then we were making knowledge graph editors, applications that could plan sales territories for organizations with a division (as in military) worth of salespeople, etc. All things you couldn't possibly do with SSRHTML (back then people knew how to implement both simple and complex forms that way.)

Then angular came along and all the little web agencies that were making Ruby on Rails apps with great success felt they couldn't sell those kind of apps anymore and instead they started struggling, struggling and struggling with Angular.

Back then I was making highly dynamic applications with property sheets and other UI elements that the user could control (think an IDE, Photoshop or Figma) and had developed frameworks for updating application state that would self-organize to handle this.

I laugh at Redux and most of the "state management" solutions out there. MobX looks a lot like the systems I used to build, but for some reason hardly anybody uses it.

Re: Ask HN: Write once, run anywhere front ends failed. Thoughts?

#10

Do you have thoughts and opinions on the various options for Windows desktop development? I would be curious to know, I am starting to work on a Windows desktop app. I am assuming that the first, MVP-style, attempt will be using Electron. But I am also wondering if Maui will end up being a better option, or if I will be able to have an excuse to use the Avalonia framework for F#

> the first, MVP-style, attempt will be using Electron.

Good choice.

If you want to stick to HTML...WebView2 is suppose to replace it, but it assumes your backend code is .NET or C++, instead of JS/Node.js. Microsoft Teams is using it.

If you want to use native Windows UI components from JS code, then React Native for Windows is recommended. Facebook Messenger is using it.

All approaches require C# or C++ modules to be used to interact with the Windows Platform. Or there is: https://github.com/tjanczuk/edge.

The recommended approach is WinUI 3 which would involve C#/C++ and XAML.

To SwiftUI/React/JetPack are called module-view-update (MVU). There is an MVU for C# called Comet. https://github.com/dotnet/Comet#key-concepts

Post reply on HN