News for hackers. Stuff that matters.
Re:How Four Native Developers Wrote an Electron App by paulddraper on Friday May 19, 2017 @12:00AM (#14372927)
> c# is not native code

Correct. C# does not ahead-of-time compile to hardware machine code (e.g. x86).

> WPF is not a native UI

How do you classify "native" vs "non-native" UI?

Re:How Four Native Developers Wrote an Electron App by flukus on Friday May 19, 2017 @12:14AM (#14372979)
A native UI is one that uses that platforms (or desktop environment) native toolkit, that's win32 on windows, qt on KDE, gtk on gnome and cocoa (or whatever it is today) on Mac.

WPF is it's own toolkit built in directx, it's as native as swing. WPF sits at the same abstraction level as most games, would you consider the main menu in GTA to be a native one?

Re:How Four Native Developers Wrote an Electron App by pvg on Friday May 19, 2017 @12:30AM (#14373035)
would you consider the main menu in GTA to be a native one?

Does a WPF menu (and WPF-based apps in general) integrate with the systemwide conventions and settings for things like keyboard shortcuts, default font, etc? Is it a first-class UI toolkit for the system? My impression was it is supposed to be, in a way GTA's UI (or Swing) is not.

Re:How Four Native Developers Wrote an Electron App by flukus on Friday May 19, 2017 @12:37AM (#14373061)
> Does a WPF menu (and WPF-based apps in general) integrate with the systemwide conventions and settings for things like keyboard shortcuts, default font, etc?

About as well as swing ever did, no where near as good as Qt does, I think we'd all agree qt is not the native UI of windows.

Then again, it is hard to judge. Not a lot of win32 apps seem to follow system wide settings either, even the MS ones.

Re:How Four Native Developers Wrote an Electron App by pvg on Friday May 19, 2017 @12:47AM (#14373092)
About as well as swing ever did

Really? It's just not the impression I get, granted it's been a while since I've used Windows for anything other than to, well, play a bit of GTA. I remember paint.net being a thing (seems it's still around) and it looked and behaved like a Windows app. Qt apps look instantly recognizable and fugly to me on any platform. It's hard to believe that WPF apps had or still have, say, the font-rendering problems Swing apps had or were missing access to affordances like control over the tray icon, etc.

The reason I'm skeptical is that WPF was very much intended to be a first-class Windows-specific ui toolkit. You're telling me it's worse than cross-platform toolkits with all of their necessary design and implementation compromises.

Edit: Oh! I figured out where I was confused. WPF and Winforms. Not the same thing.

Re:How Four Native Developers Wrote an Electron App by WorldMaker on Friday May 19, 2017 @12:08PM (#14377011)
Win32 is essentially deprecated and the native toolkit from Windows 8 on is the WinRT components/engines in "Windows.UI.*" which natively speak XAML (and natively here means these are C++ components baked into the OS). WPF has much more in common with the modern Windows.UI toolkit than Win32 does.

DirectX is at the same level of abstraction as Win32's Graphic Device Interface (GDI) and Hardware Abstraction Layer (HAL) that the rest of Win32's "native toolkit" was built on top of; Windows.UI is just as "native" as Win32 ever was. It should not be a surprise that the hardware abstraction toolkit beat into performance submission by performance demanding games is the new native layer for Windows. The surprise should be how long it has taken to make the transition across. (Avalon promised it back in Vista and WPF was the closest to delivering it. Windows 8 finally delivered on the Avalon promise.)

Re:How Four Native Developers Wrote an Electron App by flukus on Sunday May 21, 2017 @08:22PM (#14390078)
The problem is they didn't provide backward compatibility for Windows.UI. Until windows 7 is dead win32 is the only native option.
Re:How Four Native Developers Wrote an Electron App by WorldMaker on Monday May 22, 2017 @11:18AM (#14394269)
I think to some extent they felt WPF was a strong enough backward compatibility story. Windows 7 supports WPF well. There is a cross-over between WPF XAML and UWP XAML and it is possible to support both with a lot of code shared and even some XAML shared.
Re:How Four Native Developers Wrote an Electron App by WorldMaker on Monday May 22, 2017 @12:29PM (#14394891)
Of course, there have been bumps in the road in the compatibility story between the two XAML environments. .NET Standard 2.0 will help a ton (in the very near future), deeply increasing the amount of .NET code that can be shared between the environments. XAML Standard 1.0 (in the slightly further future) will help a lot, in particular the fact that Xamarin.Forms is planning to implement a WPF renderer for sharing a much larger portion of XAML across every platform.
Re:How Four Native Developers Wrote an Electron App by kensai on Friday May 19, 2017 @12:51AM (#14373103)
On another note, the classic opening Window of Unity games (when you select resolution and quality) looks remarkably native!

Examples: My Summer Car, Sol 0, Software Inc.

Re:How Four Native Developers Wrote an Electron App by dleslie on Friday May 19, 2017 @12:05AM (#14372945)
> How do you classify "native" vs "non-native" UI?

Not OP, but presumably WPF can be considered non-native because it relies upon the .Net stack.

Re:How Four Native Developers Wrote an Electron App by flukus on Friday May 19, 2017 @12:10AM (#14372958)
Not just .net (I think it's all c underneath), I'd consider winforms with c# to be a native UI (but not native code) because it's just a .net wrapper around win32.
Re:How Four Native Developers Wrote an Electron App by LeoNatan25 on Friday May 19, 2017 @02:57AM (#14373495)
Is UWP UI "native"?
Re:How Four Native Developers Wrote an Electron App by flukus on Friday May 19, 2017 @03:15AM (#14373557)
Yes, although the windows desktop situation is such a clusterfuck that I could make a case that it's not ;) It all depends on if you consider the full desktop or the metro interface to be the native one.
Re:How Four Native Developers Wrote an Electron App by pjmlp on Friday May 19, 2017 @12:25AM (#14373021)
Sure it does.

Ever heard of NGEN, Mono-aot, .NET MDIL, .NET Native?

Re:How Four Native Developers Wrote an Electron App by flukus on Friday May 19, 2017 @12:31AM (#14373041)
To what degree are they native? I wouldn't consider something native just because it bundles the VM into the exe.
Re:How Four Native Developers Wrote an Electron App by pjmlp on Friday May 19, 2017 @01:07AM (#14373162)
To the same degree as C is native, there isn't any VM doing JIT compilation.

All straight sugar free Assembly instructions.

Now if you mixing the notions of VM and runtime, even C has a runtime called crt0 on most UNIX systems.

Re:How Four Native Developers Wrote an Electron App by flukus on Friday May 19, 2017 @01:50AM (#14373304)
> Now if you mixing the notions of VM and runtime, even C has a runtime called crt0 on most UNIX systems.

I was mixing them up. The line seems be kind of blurry though once you start embedding garbage collectors though, then again the GC could just as easily be in an external library.