Hacker News new | ask | show | jobs
by dataflow 1737 days ago
> What do you mean by "machine code" though? To me, the most native you can get is a Java/C++ app that uses Android APIs directly.

I mean like C/C++ (which compiles to machine code) and not Java (which compiles to bytecode).

Same as the distinction the terminology made on desktop: https://stackoverflow.com/a/855774

3 comments

Android UI is implemented with Java libraries. If you want native Android L&F, you need to use those libraries. You can write your app with C++ and invoke those libraries via FFI, but that's extremely cumbersome way to develop and does not bring any advantages. Java is the native way to develop GUI apps for Android. And recently Java was replaced with Kotlin, so nowadays Kotlin is the native way to develop GUI apps for Android.

Just like C# is one of the native ways to make Windows applications.

> Just like C# is one of the native ways to make Windows applications.

Please do everyone a favor and, at least for the sake of desktop development, don't misuse the terminology like that if you want people to understand what you're saying. The entire reason ".NET Native" was developed was that C# did not produce "native" applications. Saying C# produces native Windows applications is going to confuse the heck out of everybody.

Someone is wrong on the Internet.

.NET has always supported AOT via NGEN, although it only supports dynamic linking and was optimized for fast startup of applications.

Windows 8 introduced the Bartok compiler used by Singularity, where applications would be pre-AOT compiled in the Windows store minus linking, with on-device linking happening on installation.

Windows 10, improved the later scenario with the introduction of .NET Native, slightly based on the Midori experience.

The new Windows 11 store is still fully based on .NET Native, as it makes use of WinUI 2.6.

> .NET has always supported AOT via NGEN

I didn't claim otherwise. But AOT != "native".

What makes something "native" is not merely the fact that you compile to machine code. It's one of the main features of native code but far from the only one. Again: there's a reason they came up with ".NET Native" and called it that despite the fact that NGen always did AOT. And there's a reason the Android NDK has an N, unlike its SDK. It actually means something beyond AOT.

You can go against the grain if you want and call them all native apps, telling people they're Wrong On The Internet, but you're just confusing people.

What makes an NGEN compiled WinForms .NET application not native on Windows?

Curious to find out, how those people distinguish it from an MFC/ATL or an Win32 one.

It's not just one thing. Just like what distinguishes a human from a chimpanzee isn't just 1 thing.

But see for example https://stackoverflow.com/a/855774

If you still don't like the terminology though, I'm not going to keep arguing. I didn't coin the term. You should go ask Microsoft why they didn't call C# native when NGen was already there. I'm just saying that terminology is already established and you're confusing people by using it differently.

Would you consider something that's not a web app, but built with a higher level framework like Flutter to be native in either sense?
Me? Personally I hate any definition that conflicts with the old one, but that ship sailed long ago.

Nowadays, my understanding is, if it's not loading a webpage off the internet, people call it "native". Doesn't matter what framework it uses to actually display things (even if it uses web technology).

Java compiles to machine code on Android, via JIT and AOT compilers.
I'm aware. Windows has NGen too. But that's not what makes people call Java or C# a native language, or apps based on those native apps.
Native is overloaded, however Java is the "native" language of the Android SDK, and on Windows unless one has a morbid pleasure to still use MFC, ATL, bare bones Win32, or use C++/WinRT like ATL is fashionable again, .NET UI toolkits will be the way to go.

Or are you going to argue that Visual Studio, SQL Server Management Studio, Microsoft Store, Microsoft Blend, Office AddIns, Power Automate Desktop aren't native?

> unless one has a morbid pleasure to still use MFC, ATL, bare bones Win32, or use C++/WinRT like ATL is fashionable again, .NET UI toolkits will be the way to go.

I'm not sure how the discussion turned from "native" to "the way to go".

I get the feeling like you're jumping all over HN trying to reply to me at every comment you find because... you took "not native" as some kind of insult to tools you like/consider superior?

Most of the time, I don't bother to read the author, so it is a matter of chance that those posts are yours.

I am jumping because the distinctions you are making aren't the ones that users care about.

So each one can go on their merry lives with their own dictionary version.