Electron.Net: Build cross platform desktop apps using .NET core and ASP.NET core
github.com
github.com
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.
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.
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.
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).
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.
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.
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.
> 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
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).
There's always PyQt which works cross platform
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...
Calibre (https://ic.tweakimg.net/ext/i/1324631500.jpeg)
Spyder (https://github.com/spyder-ide/spyder)
Orange (https://orange.biolab.si/screenshots/)
QGIS (https://live.osgeo.org/_images/qgis_style.png)
OpenShot (http://www.openshot.org/static/img/gallery/clip-overview.jpg)...
We should just go back to Delphi, it was/is one of the best ways of doing GUIs.
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.
Recent discussion: Why I use Object Pascal | https://news.ycombinator.com/item?id=15490345 (2017Oct:268points,233comments)
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.
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".
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.
Ergo developers taking the easy route to the expense of user's overall UI/UX.
Thankfully all web based mobile OSes bombed so far.
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.
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?
http://qmlbook.github.io/en/ch04/index.html
it's really easy
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.
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.
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.
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
They should have used something like this instead for backend: https://github.com/memononen/nanovg
Can anyone on the Edge team comment on this? There would be so many major use cases for this in .NET. Currently we have to use CEF but I really don’t like being forced to delegate work to Chrome - it further secures Chrome’s place as “the only browser”. Not to mention the Edge team would likely receive many benefits from open sourcing the project in the way of pull requests, even if this is a little more managerial overhead.
This has been requested on MS’ UserVoice site. Would love to see it get some love. https://wpdev.uservoice.com/forums/257854-microsoft-edge-dev...
Also, what I'd love to see would be some sort of UI subsystem that all vendors target. Something built on a protocol that can be implemented in any language, and communicated to by any other language. That way all browsers' HTML renderers would target the same UI subsystem, and any UI framework could choose to either target HTML or the UI subsystem itself, as well. That UI framework (if it targets the UI subsystem) could then be run in a different context (say a JS engine running in .NET) and its output could be routed to a .NET implementation of the UI subsystem. This would allow any components built in any language to interface and work together using a common protocol, and as long as you can host the language a given UI framework is built in, you can use it to create UI elements in whatever platform you want. I see this as being THE solution to JS/web/UI stuff - there's tons of amazing developments happening there, but we can't use them in the desktop world. I'd like to see that change, and in a way that doesn't require running an entire browser inside a desktop app.
No it wouldn't? How would a C++ app run my managed control built in C#? Or my JS page run components written in Rust, Java and Clojure? Unless you are expecting all of the runtimes to be bundled with the app/page too, in which case good luck with your file size and startup time...
It won't be long before one can write Rust or Java or Closure and have it compiled to web assembly. At such time, you'd be able to have your components run alongside JS as I described.
> Currently we have to use CEF [https://cefsharp.github.io]
What benefits would an open-source Edge provide to developers that the combination of Chrome and Firefox don't already?
PS. 100% managed C# HTML renderer: https://github.com/ArthurHub/HTML-Renderer
[edited]
Thanks! This is a real differentiator.
It it unfortunate that Microsoft does not currently allow hosting of the Edge renderer "by design".
https://stackoverflow.com/questions/31773359/add-new-microso...
While this works, it's very limited in terms of HTML feature support. Not something you can give to a web developer and say "here use this to make a JS app."
Like the X Window System?
"Not hard to use" was not mentioned, but definitely correlates with popularity. Apple and Microsoft do not target it as a business decision, but X11 is available on both of these platforms with commercial support.
> nobody writes UI code that talks directly to X for obvious reasons
Nor would I expect them to; there are libraries to simplify that. I was pointing out the existence of a cross-platform UI protocol; X11's plight and your immediate visceral rejection provide additional insight into how well an idea like this works out in practice.
What is needed is a protocol which can be targeted by the average JS UI framework creator. It needs to be fairly light weight, and exist mostly as a layer below any sort of framework. If that's X11, so be it, but I haven't seen it running in a browser before.
One such use case would be a JS library which handles the protocol at a fairly low level, allowing someone to create a custom ReactJS renderer which targets the protocol instead of the DOM. Hook up a protocol receiver in your favourite native language, and now you've got native UI driven by React + JS.
https://github.com/Microsoft/react-native-windows
Watching how Microsoft manages this project may give an additional insight into how ideas you are suggesting would fare. (It doesn't seem to be a tire fire or anything from initial impressions.)
> as long as you can host the language a given UI framework is built in, you can use it to create UI elements in whatever platform you want
(The work has already been done to host React/JavaScript cross-platform alongside .NET: see Edge.js http://tjanczuk.github.io/edge/ previously mentioned elsewhere in this thread. http://www.hanselman.com/blog/ItsJustASoftwareIssueEdgejsBri...)
As an aside, I recommend you include some details summarizing reasons for rejecting existing solutions when initiating future discussions so all participants can begin on the same page.
You're right that X is actually suitable of the use-case as described, though that use-case itself is faulty.
The primary benefit to it over something browser-based is start-up time. Since it's ultimately using native assemblies and there's no web server that needs to be spun up causing start-time lag.
Is anyone using Xwt? The NuGet packages for it are up-to-date (but don't have very many downloads), and the official forum for it seems very dead.
https://blog.xamarin.com/glimpse-future-xamarin-forms-3-0/ (2017May)
But one big difference between Xwt and Xamarin Forms is that Xwt supports Linux via GTK (GTK1, GTK2 & GTK3) whereas Xamarin Forms does not.
Xamarin Forms also requires different code for different targets, such as:
// Android
Forms.Init(this, null);
var androidFragment = new MyFormsPage().CreateFragment(this);
// iOS
Forms.Init()
var iosViewController = new MyFormsPage().CreateViewController();
// UWP
Forms.Init(e);
var uwpElement = new MyFormsPage().CreateFrameworkElement();Xamarin Forms Gtk# Backend - https://github.com/xamarin/Xamarin.Forms/pull/1174
It's all floating out there right now but maybe by end-of-year ("Q4 2017") there will be something solid. This uncertainty promises enough to keep people like me from evaluating alternatives.
Unfortunately, it doesn't support .NET Core/Standard yet. The lead dev, Curtis Wensley (@cwensley), is currently working on supporting it and said that he hopes to have to completed in time for the Eto 2.4 release, per their Gitter chat (https://gitter.im/picoe/Eto?at=59d65ab4177fb9fe7e41ff9e).
Another interesting detail is that Avalonia seems to be using Eto's parser implementation. And Eto is (will?) using AvaloniaUI's (the parent of Avalonia) monomac implementation.
I don’t think they’ll be useful for anything.
AFAIK, Edge’s rendering engine relies on DirectX 11, Direct2D and DirectWrite. These are huge and depend on other Windows-specific stuff. There are open alternatives (OpenGL/GLES, OpenVG, Pango, Skia, etc.) but these are not as good.
.NET/QML https://github.com/pauldotknopf/net-core-qml
Not quite production yet, but it will be soon. I'd love to here some input. You can check the unit tests for how things are working currently.
At a certain point, I will also implement a Qml debugger in visual studio code.
The tech-stack perfectly slices responsibilities. That is what really motivated me to do it. Seemed like peanut butter and jelly.
Also, performance. Anything beats electron.
https://github.com/kg/ilwasm/ [2015]
Unfortunately, more proof of concept than anything
* Prism [1], which doesn't seem to support .NET Core. It was originally created by Microsoft Patterns & Practices, but then open sourced it. It's now community maintained. It looks like it's still being actively developed as there was a merge 4 days ago.
* Avalonia [2], which supports .NET Core but is still in alpha.
[1] https://github.com/PrismLibrary/Prism [2] https://github.com/AvaloniaUI/Avalonia
Mac desktop support is in preview (https://blog.xamarin.com/preview-bringing-macos-to-xamarin-f...), and Linux and WPF backends are in development. So ... almost there!
Also if you need interactivity you need JS anyway, so you can switch your server side rendering to client side rendering, thus eliminating the need for this wrapper anyway.
Maybe I am missing something (and if someone tells me I am missing .NET libs then my response is Edge.js, https://github.com/tjanczuk/edge).
However, this seems to be almost an entire server deploy as well as a complete renderer all in one package. That does seem excessive to me for a desktop app.
See https://en.wikipedia.org/wiki/Electron_(software_framework) along with the official docs (though the official docs don't state this construction quite as plainly, it doesn't hide the fact).
This could actually be faster since C# is faster language than Node.
That's precisely what Electron is. So what's the difference if you're okay with one?
Here is a list of programs built with Lazarus/FPC: http://wiki.freepascal.org/Lazarus_Application_Gallery
Python is huge in numerical libraries (numpy/scipy) and deep learning. But it is lacking in UIs. Yes, there's PyQt, but Qt is GPL'ed, making it impossible to use at our shop. And wxPython feels really archaic to use.
Not quite production yet, but it will be soon.
Your comment is not only uncalled for, it's also very off-topic.
People, XAML is dead. Get over it ;-).