News for hackers. Stuff that matters.
Re:Electron.Net: Build cross platform desktop apps using .NE... by alkonaut on Friday November 03, 2017 @04:38AM (#15617573)
Can't we just make a proper, easy to use portable desktop application framework please? I really don't care what language is used so log as JS is avoidable (It can still be a compilation target so it could even be JS), and I can make a snappy desktop app that takes 10 not 100mb.

I'm not even sure which one I'm hoping for at the moment. Xamarin seems to have bet fully on mobile. Avalonia looks nice but feels like it would need some enterprise backing.

Re:Electron.Net: Build cross platform desktop apps using .NE... by jcelerier on Friday November 03, 2017 @04:55AM (#15617642)
> Can't we just make a proper, easy to use portable desktop application framework please?

Qt ticks all your marks (though the "easy" part is through QML which is a superset of JS), + mobile, (+ one day web maybe https://msorvig.github.io/qt-webassembly-examples/window_ope... though that's fairly experimental).

Re:Electron.Net: Build cross platform desktop apps using .NE... by IshKebab on Friday November 03, 2017 @05:10AM (#15617705)
Yeah unfortunately it fails at the "10 MB" bit. Hello world in QML is like 50 MB.

Also you can't statically link the GPL version which is just a bit of a pain.

I agree if it allowed static linking and wasn't huge it would be perfect. Even so there aren't any better alternatives, but it sucks you can't make something as small and portable as e.g. putty.exe, or depends.exe.

Re:Electron.Net: Build cross platform desktop apps using .NE... by jcelerier on Friday November 03, 2017 @05:21AM (#15617755)
Qt is under LGPL which allows static linking: https://www.gnu.org/licenses/gpl-faq.en.html#LGPLStaticVsDyn...

This way, you can get under 20 megabytes: https://youtu.be/mbs3-XE0HNE?t=1180

Sadly I don't think it's possible to have at the same time "portable" (including to platforms without UIs at all, like DirectFB on linux) and small. Putty and depends.exe aren't portable at all.

Re:Electron.Net: Build cross platform desktop apps using .NE... by rlp on Friday November 03, 2017 @05:32AM (#15617800)
LGPL does not allow static linking. From Qt's legal page:

In case of dynamic linking, it is possible, but not mandatory, to keep application source code proprietary as long as it is “work that uses the library” – typically achieved via dynamic linking of the library. In case of static linking of the library, the application itself may no longer be “work that uses the library” and thus become subject to LGPL. It is recommended to either link dynamically, or provide the application source code to the user under LGPL.

Re:Electron.Net: Build cross platform desktop apps using .NE... by jcelerier on Friday November 03, 2017 @05:38AM (#15617819)
Please read the link I posted, which comes from the people who created the LGPL license:

> If you statically link against an LGPL'd library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application

The only thing that matters from the point of view of the LGPL is that your users are able to update the LGPL parts in your app. This is possible with static linking. Else for instance how would LGPL be possible with languages that don't even have a notion of linking (eg script languages), or which only allow static linking ?

See also : https://stackoverflow.com/a/15322678/1495627

Re:Electron.Net: Build cross platform desktop apps using .NE... by IshKebab on Monday November 06, 2017 @05:18PM (#15639499)
That's quite an ambiguous area of the LGPL. Qt is a C++ app so linking it with the `.o` files from your app is going to be extremely difficult. I'm not sure it would qualify for the LGPL and anyone who says it is is frankly just guessing. The language is not clear and it has never been tested in court (and probably won't ever be).

I certainly wouldn't base a business on that risky interpretation, and the one business that I have been in that used the LGPL version of Qt dynamically linked it. It's just less risky (plus you don't need to build it yourself then).

Re:Electron.Net: Build cross platform desktop apps using .NE... by j_s on Friday November 03, 2017 @08:11AM (#15618505)
A cross-platform UI toolkit with a stable history of commercially support seems to be the most reliable foundation to build on, for sure!
Re:Electron.Net: Build cross platform desktop apps using .NE... by jlebrech on Friday November 03, 2017 @05:53AM (#15617877)
we need a compiled language that splits the generated code into backend, UI and a WASM binary.
Re:Electron.Net: Build cross platform desktop apps using .NE... by jlebrech on Friday November 03, 2017 @05:52AM (#15617874)
yep, qt + wasm is the future
Re:Electron.Net: Build cross platform desktop apps using .NE... by roryisok on Friday November 03, 2017 @12:52PM (#15620548)
Am I missing something? Doesn't wasm still need a browser to run? What advantage are qt bindings if you still have to load webkit?
Re:Electron.Net: Build cross platform desktop apps using .NE... by jlebrech on Friday November 03, 2017 @01:19PM (#15620756)
then when people use the browser they get the same experience as native, not the other way round where people expect a native app and are given a browser masquerading as an app.
Re:Electron.Net: Build cross platform desktop apps using .NE... by roryisok on Friday November 03, 2017 @07:36PM (#15622975)
But if you use qt you're already cross platform and native. Why force the user to fire up a webkit instance to parse your JavaScript when you could code in python or java?
Re:Electron.Net: Build cross platform desktop apps using .NE... by headmelted on Friday November 03, 2017 @04:54AM (#15617641)
Standard WinForms and/or Java isn't too far off what you're describing if you're willing to install runtimes, but I know that's not what you're looking for and I see your point.

The difficulty is that people used to agree (and at varying times, sue each other) over which metaphors to use. The desktop platforms are growing further apart on this front.

Linux has so much work-in-progress happening at any one time that sustainable fusion is closer than a finished and implemented Wayland. Windows is still pushing a "modern" UI metaphor that no-one can stand. Apple has to my knowledge never shown any interest in what you're proposing at all.

That leaves the option of creating another UI layer on top for the app to sit in, and Electron/HTML5 isn't a terrible fit for that.

Maybe trying to get rolling with LLVM and emscripten to run the Electron logic is your answer, or Typescript if it helps ameliorate some of the JS qualms for you.

Re:Electron.Net: Build cross platform desktop apps using .NE... by egeozcan on Friday November 03, 2017 @05:20AM (#15617748)
Yeah, if Electron had just one advantage, it would be that it's available and works today.
Re:Electron.Net: Build cross platform desktop apps using .NE... by fsloth on Friday November 03, 2017 @07:13AM (#15618229)
"The difficulty is that people used to agree (and at varying times, sue each other) over which metaphors to use"

I think you hit the nail on the head. A UI common library should not provide metaphors but direct access to the renderdable elements, their layout routines, etc. A proper UI library would resemble a modern 3D game engine more by its interface.

The level where UI metaphors step in would be built on top of this basic substrate.

There are oh-so-many projects out there trying to use this pattern but for some reason they've not reached popularity.

Re:Electron.Net: Build cross platform desktop apps using .NE... by ttd on Friday November 03, 2017 @07:56AM (#15618433)
I've had good luck so far with Xamarin.Mac + traditional WPF for macOS and Windows respectively, with a PCL containing 90% of the shared code. Xamarin.Mac doesn't seem neglected to me, and the forums are decently active for support.
Re:Electron.Net: Build cross platform desktop apps using .NE... by ivm on Friday November 03, 2017 @10:35AM (#15619458)
Xamarin and C# are great, I will use them for the next desktop + mobile project. I was looking at this option for a long time and the acquisition by Microsoft added enough confidence in the future of the stack.
Re:Electron.Net: Build cross platform desktop apps using .NE... by jagger27 on Friday November 03, 2017 @09:29AM (#15619019)
Maybe I'm confused, by Xamarin.Mac do you mean Visual Studio for Mac?
Re:Electron.Net: Build cross platform desktop apps using .NE... by ttd on Friday November 03, 2017 @09:34AM (#15619063)
Xamarin.Mac is the project emcompassing bindings from Cocoa (i.e. native macOS) to Mono/.NET, the interface with Xcode for building Cocoa UIs, and Visual Studio for Mac (previously called Xamarin Studio). Essentially, Xamarin.Mac allows you to build C# applications that run on macOS with native macOS user interface elements. See e.g. https://blog.xamarin.com/your-app-on-66-million-macs-c-sharp...
Re:Electron.Net: Build cross platform desktop apps using .NE... by yoodenvranx on Friday November 03, 2017 @05:57AM (#15617897)
> Can't we just make a proper, easy to use portable desktop application framework please?

We should just go back to Delphi, it was/is one of the best ways of doing GUIs.

Re:Electron.Net: Build cross platform desktop apps using .NE... by j_s on Friday November 03, 2017 @07:47AM (#15618369)
The usual problem is that the various cross-platform UI toolkits not only fall into the uncanny valley but also only support one programming language best (in this case, Pascal). Only the incentives of the biggest cross-platform browser vendors align in such a way that they pursue native UI effectively.

Recent discussion: Why I use Object Pascal | https://news.ycombinator.com/item?id=15490345 (2017Oct:268points,233comments)

Re:Electron.Net: Build cross platform desktop apps using .NE... by alkonaut on Friday November 03, 2017 @07:00AM (#15618170)
Isn't delphi procedural just like e.g. Swing/AWT or Windows Forms? (Been a long time since I worked with Delphi). I think XAML/XUL and similar declarative GUIs are better.
Re:Electron.Net: Build cross platform desktop apps using .NE... by memsom on Friday November 03, 2017 @09:47AM (#15619167)
No. (Caveat, last version I used was version 5 from 1999.)

Delphi forms are in one of two formats.

1) Binary serialization of the form data (this is the older versions, pre 4/5)

2) A textual representation.

The code for a Delphi form was pre-XML, but it looked like a set of standard markup. There were resources (Form, Button, Edit, Label - these types of control) and they were laid out in a hierarchical developer readable form in blocks. The form code was streamed to/from the file (the files were embedded as resources in the Eve, and the form was read and re-constituted at runtime as well as design time.) Borland made a massive deal about the "two way editing" one could do to the forms. The developer was able to cut and paste controls, and the controls were cut/copied as straight text, which could be pasted to notepad (for example) IIRC.

Re:Electron.Net: Build cross platform desktop apps using .NE... by JustSomeNobody on Friday November 03, 2017 @07:38AM (#15618317)
I’m so over XMLish and it’s declaritiveness. So please, no, don’t wish for this.
Re:Electron.Net: Build cross platform desktop apps using .NE... by nicoburns on Friday November 03, 2017 @05:47AM (#15617859)
There's some promising early stage projects in Rust world. They're all building on WebRender (firefox's new renderer), but without the DOM/JavaScript bit.
Re:Electron.Net: Build cross platform desktop apps using .NE... by j_s on Friday November 03, 2017 @08:13AM (#15618516)
Golang led me to this popular lightweight C library: https://github.com/andlabs/libui
Re:Electron.Net: Build cross platform desktop apps using .NE... by alkonaut on Friday November 03, 2017 @06:29AM (#15618029)
Sounds cool. Do you have any links to these experiments on github?
Re:Electron.Net: Build cross platform desktop apps using .NE... by mamcx on Friday November 03, 2017 @12:31PM (#15620399)
Yeah? Where I can look?
Re:Electron.Net: Build cross platform desktop apps using .NE... by mrits on Friday November 03, 2017 @10:09AM (#15619309)
If you think JS/HTML is bad you should try any of the cross platform desktop application frameworks.
Re:Electron.Net: Build cross platform desktop apps using .NE... by cmiles74 on Friday November 03, 2017 @10:50AM (#15619583)
Swing covers almost every use case (JavaFX as well and has a more modern feel). While people like to complain about Java, it is easy to follow and gets the job done. Other languages are available on the JVM that could also leverage Swing/JavaFX, like Clojure.
Re:Electron.Net: Build cross platform desktop apps using .NE... by camgunz on Friday November 03, 2017 @10:37AM (#15619487)
Qt is pretty great.
Re:Electron.Net: Build cross platform desktop apps using .NE... by pjmlp on Friday November 03, 2017 @06:05AM (#15617936)
According to the latest Windows Developer Day, Xamarin.Forms is that framework in what concerns Microsoft.

As for the rest, sorry for being so blunt, but it is just not wanting to learn.

We we were writing applications across multiple OS and hardware architectures for ages now.

It is easy, no, as it requires actually putting some effort into a proper architecture and OS/hardware abstractions, but it is surely doable.

It feels like devs now want to write apps without spending any real effort on them.

Re:Electron.Net: Build cross platform desktop apps using .NE... by bsaul on Friday November 03, 2017 @06:17AM (#15617979)
"It feels like devs now want to write apps without spending any real effort on them."

I think what people are fed up with, is to spend effort learning the "method du jour" of putting a button on a screen and updating the view on a click.

This is pretty much a solved problem, and has been since MVC was invented in the 70s (not saying it's perfect, but it does the job). So there should be an easy an portable way of doing it for decades now.

QT seems to be the kind of framework, but it's C++ so i won't qualify it as "easy".

Re:Electron.Net: Build cross platform desktop apps using .NE... by cm2187 on Friday November 03, 2017 @06:50AM (#15618117)
It's even worse than that. It makes apps expensive and slower to develop across platforms, makes different version more complicated to maintain and keep in sync, creates more attack surface, etc. And even from a non technical point of view, there is a consistency of experience across platforms point of view. There are very good reasons to have fully cross platform apps that you develop only once.

And in general, I don't think developers are being lazy by going for higher level languages like java, c# or python. Ease of use has a lot of value, particularly if the underlying problem you are trying to solve isn't simple.

The last thing is forward compatibility. If I write an objective-c app, it will only be compatible with apple's platform. Say a new kind of platform appears that takes a significant market share (AR?), there is a lot of value in your app being compatible with this platform without needing even to recompile it, just because the cross platform framework you use will be ported to that platform.

Re:Electron.Net: Build cross platform desktop apps using .NE... by pjmlp on Friday November 03, 2017 @07:54AM (#15618424)
I rather have a portable application that takes advantage of the best features on each platform that it runs, than the minimum common denomitor that is the web.

Ergo developers taking the easy route to the expense of user's overall UI/UX.

Thankfully all web based mobile OSes bombed so far.

Re:Electron.Net: Build cross platform desktop apps using .NE... by bsaul on Friday November 03, 2017 @11:20AM (#15619822)
that was my position for the last 7 years about hybrid vs native on mobile. but with the recent slowdown on new features on mobile, i'd say even the common denominator is probably largely sufficient for 99% of the apps.
Re:Electron.Net: Build cross platform desktop apps using .NE... by cm2187 on Friday November 03, 2017 @08:04AM (#15618470)
I totally agree that html+javascript isn't a good answer to cross platform (for the reasons you mention, and because of javascript's own merits). But the ability to develop an app once and run it on multiple platforms is long overdue. And any effort in that direction is welcome. Having to learn 10 different languages and UI frameworks isn't a solution.
Re:Electron.Net: Build cross platform desktop apps using .NE... by pjmlp on Saturday November 04, 2017 @03:19AM (#15624125)
It is only an issue for those that are Language X Developer.

As consultant and polyglot developer, using C++ and eventually something else for the view isn't a problem at all.

And it doesn't have to be C++, there are other portable native languages to choose from.

Also web developers don't have any issue changing frameworks or languages that compile into JavaScript, almost every month.

Re:Electron.Net: Build cross platform desktop apps using .NE... by j_s on Friday November 03, 2017 @01:26PM (#15620805)
> _It_ makes apps expensive and slower to develop across platforms

Can you clarify specifically what you mean by _It_ there? Maybe (working backwards up the comment chain...) C++, Qt, MVC, "writing apps without spending any real effort", duplicating "applications across multiple OS and hardware architectures" (my vote for most likely), Xamarin.Forms, "easy to use portable desktop application framework", or something else?

Re:Electron.Net: Build cross platform desktop apps using .NE... by jcelerier on Friday November 03, 2017 @07:04AM (#15618188)
> QT seems to be the kind of framework, but it's C++ so i won't qualify it as "easy".

http://qmlbook.github.io/en/ch04/index.html

it's really easy

Re:Electron.Net: Build cross platform desktop apps using .NE... by rpeden on Friday November 03, 2017 @08:57AM (#15618785)
If you use Qt and QML, you can write most (or all) of your application using JavaScript.

I was experimenting a few weeks back, and was able to put together a Hacker News reader app using only JavaScript and QML.

Granted, it was a fairly simple app; but once I knew what I was doing, the QML/JS combo didn't feel any slower to develop with than the React-based web stack I'm familiar with.

Re:Electron.Net: Build cross platform desktop apps using .NE... by ThrowawayR2 on Friday November 03, 2017 @12:03PM (#15620186)
> I think what people are fed up with, is to spend effort learning the "method du jour" of putting a button on a screen and updating the view on a click.

The bajillion constantly changing web frameworks says that people are perfectly delighted to spend the effort to learn the "method du jour" to do those things.

Re:Electron.Net: Build cross platform desktop apps using .NE... by megaman22 on Friday November 03, 2017 @07:35AM (#15618309)
You didn't get the memo? You're supposed to jot down some half-formed ideas, pipe that through some cognitive services apis, pipe the results of that into webpack, and run the resulting mess in a docker container. Boom, magic!
Re:Electron.Net: Build cross platform desktop apps using .NE... by linguae on Friday November 03, 2017 @06:06AM (#15617942)
It would be nice if GNUstep (http://www.gnustep.org/) received much more attention. GNUstep is a free software implementation of the OpenStep API (which Apple's Cocoa API is based on), and GNUstep is available for *nix and Windows. The OpenStep API has already been shown to be cross platform; back in the days when NeXT, Inc. existed, it sold an implementation of the OpenStep API and development tools for Windows NT called OPENSTEP Enterprise (see http://i.imgur.com/I7VivtO.jpg for a screenshot). After Apple bought NeXT, Apple renamed OPENSTEP Enterprise "Yellow Box for Windows" during their Rhapsody efforts. However, in 1998 Apple's business strategy shifted from maintaining NeXT's cross-platform support for OpenStep to devoting NeXT technology solely to the Mac. This is what killed OpenStep as a cross-platform development technology.

GNUstep could have picked up from where Apple left off in 1998 to be a major contender in cross-platform software development. Indeed; it could have attracted former OpenStep developers who liked the cross-platform nature of the API and were stranded when Apple stopped development of Yellow Box for Windows. But for various reasons GNUstep's development and adoption has been slow, and alternative APIs such as QT and GTK ended up winning out in terms of popularity. But I don't think it's too late to promote GNUstep, especially now when a vocal minority of Mac power users are increasingly becoming discontented with the state of the Mac and are looking for high-quality alternatives.

Re:Electron.Net: Build cross platform desktop apps using .NE... by matthewmacleod on Friday November 03, 2017 @07:27AM (#15618277)
As an on-and-off Mac developer, I absolutely love Cocoa as a development platform. I did look into using GNUstep as a tool to base a cross-platform version of a Mac app on, but agreed that it just never quite made it. But I'd love that kind of API to be available cross-platform.
Re:Electron.Net: Build cross platform desktop apps using .NE... by vosper on Friday November 03, 2017 @10:30AM (#15619437)
I'm not sure this is helpful (yet?), but the Red programming language seems to be working on cross-platform UI support.

Original announcement is here, and macOS support was recently added. Language development seems pretty slow, though. http://www.red-lang.org/2016/03/060-red-gui-system.html?m=1

Re:Electron.Net: Build cross platform desktop apps using .NE... by noway421 on Friday November 03, 2017 @05:01AM (#15617670)
Does the binary size matter? Memory footprint is more important.

There's always PyQt which works cross platform

Re:Electron.Net: Build cross platform desktop apps using .NE... by Figs on Friday November 03, 2017 @05:07AM (#15617693)
Yes! Plenty of us are still stuck on mediocre internet connections that have data caps. My cap at home is 5GB/month!

100MB/app is in the range of "I am not going to download it" unless I have a damned good reason to. Doubly so for updates...

Re:Electron.Net: Build cross platform desktop apps using .NE... by timlyo on Friday November 03, 2017 @11:20AM (#15619819)
If we're talking Python, then I've had great experiences with Kivy.

https://kivy.org/#home

Re:Electron.Net: Build cross platform desktop apps using .NE... by matthewmacleod on Friday November 03, 2017 @07:28AM (#15618284)
I have used PyQt. I wouldn't suggest that it's a suitable cross-platform toolkit for anything more than the most basic applications.
Re:Electron.Net: Build cross platform desktop apps using .NE... by jcelerier on Friday November 03, 2017 @09:51AM (#15619204)
Re:Electron.Net: Build cross platform desktop apps using .NE... by WorldMaker on Friday November 03, 2017 @12:01PM (#15620173)
It's starting to look like PWAs will be soon powerful enough for mobile and Windows cross-platform development. I'm somewhat hopeful that maybe we'll finally start to see more PWA APIs and Electron/Electron-esque desktop integration APIs converge.
Re:Electron.Net: Build cross platform desktop apps using .NE... by LemurMadness on Friday November 03, 2017 @11:46AM (#15620039)
The main problem with Avalonia is that it's still in alpha. It looks like a good solution, though, so definitely something to keep an eye on if you're looking for a solution that doesn't require running a web server and render for the UI.
Re:Electron.Net: Build cross platform desktop apps using .NE... by serguzest on Friday November 03, 2017 @05:50PM (#15622425)
those guys are making progress https://github.com/AvaloniaUI/Avalonia Though I wish they didn't choose xaml/wpf way which is pretty much over engineered imho. React like api would be awesome.
Re:Electron.Net: Build cross platform desktop apps using .NE... by Const-me on Saturday November 04, 2017 @11:58AM (#15625600)
I wish they hadn’t picked GTK+. This brings huge technology stack with it, required a desktop subsystem for no reason, and is focused on the CPU rendering.

They should have used something like this instead for backend: https://github.com/memononen/nanovg

Re:Electron.Net: Build cross platform desktop apps using .NE... by rippsu on Friday November 03, 2017 @09:27AM (#15619000)
try Qt
Re:Electron.Net: Build cross platform desktop apps using .NE... by amelius on Friday November 03, 2017 @10:19AM (#15619360)
It's GPL'ed. That means it is a no-go for a lot of people. E.g., my boss would be against it.
Re:Electron.Net: Build cross platform desktop apps using .NE... by jcelerier on Friday November 03, 2017 @10:27AM (#15619415)
No, it can be used under the LGPL, which is fairly different (eg no problem for proprietary apps). Electron uses Blink which should also be covered under LGPL (eg for instance: https://chromium.googlesource.com/chromium/blink.git/+/maste...) and it's not a problem for anyone.