What would be something "native"?

Asked

Viewed 263 times

7

I’ve read many posts and articles talking that one language, framework, editor or anything else is "native".

So my question is:

  • What is something native?
  • Is that good or bad?
  • There are advantages and disadvantages?
  • Just to reinforce, nw js. also nay is native, both Electron and NW.js use an embedded browser, Chromium, so it is not native, because the components/elements are generated from HTML... what NW.js means by "native" is that it can communicate with native things, usually through its Addons, this is done at "installation time", but technically this is kind of possible in Electron as well, only it increases the paths, since it goes through Node.js, so to summarize, NW.js is hybridized and has "native" components, but is not actually native.

3 answers

7


What is something native?

It depends on the context that is used. Almost everything you see out there will be in the context of mobile, is comparing only one that goes straight on the operating system or if it is web, but is not the only one.

It’s a shame because some people don’t even know the fundamentals anymore, which is correct in the broad sense. Looking only at a context is what causes many people to no longer understand what is happening to their applications.

It is not always easy to use the term correctly to classify something. There is no such clear definition of the line that separates something native or not.

Original term

Native can be run the software directly on the machine, without intermediaries. Some people may consider that there may be some momentary intermediary as with the Jitter. Roughly speaking we can say it’s binary form.

It opposes some form of environment interpretation or virtualization that does not generate binary code that is exactly what the processor understands.

But it is not always simple to say what is running native or not. Simple example:

  • C, C++, Rust, Swift, D and Delphi are clearly native (in the best known implementations, nothing prevents being different).
  • PHP until the date I write is clearly not native (in the implementation that everyone uses, this will change).
  • C# or Java/Kotlin run native code, but the most commonly used form requires a process that generates this native code at the time it will run. That is not interpretation (another). In fact, it’s possible that this mechanism opens up opportunities for optimization that normal native code cannot have. I consider it native, but there are those who argue that it is not so much. Some people may complain that memory is managed by a Runtime, but this I doubt I can say that it eliminates directly that it is native.
  • Python, Ruby, Lua, Harbour, Perl seem to be interpreted. But it is common for them to be pre-compiled before (not in all implementations, some use Jitter, others even use the AOT generation). Does this make them native? No. There will still be interpretation of a bytecode in a VM. It is different from the previous item that despite having an interpretation of a bytecode, occurs only to generate the native code, the machine code.
  • Javascript is more complicated because it interprets source code, but almost all implementations run on a Jitter, so the execution takes place natively. Is it native? The cost to generate native is quite large, in some cases it may take longer than in a language of script pure that runs on a VM playing a bytecode (that is much easier).

Popular term

There is another context that is about accessing the operating system API. Again we are talking about having some code mediating access or not. And there are also controversies of what is native.

For example, Qt is a multi-platform window system access and screen design library. Is it native? More or less. It depends on what you consider. Access the operating system Apis, but it’s a layer on top of it to make certain parts in a different way.

The same goes for mobile. If you access Android with Java/Kotlin in general you will have native access to OS libraries. But if you use Xamarin, which is C#, the access is native. In general it is considered that yes, there is a layer, but everything is allowed the same if done with Java/Kotlin, and everything happens the same way, essentially with the same performance.

And if you use Xamarin Forms (future MAUI), is still native? It seems that yes, it doesn’t change much, it’s just another layer. But there are small limitations. So it becomes more difficult to say.

If it is accessed by some web technology is still native? It is generally considered not. You have a very different way of doing it and that by chance the rendering technology used (something that is part of an internet browser) will access something from the operating system, but it is not your application directly, so it would not be native. Change the semantics of what to do. Access a completely different API.

Almost everything you search around will only be classified as non-native if it’s web, and native to everything else. It’s not a good rating but it’s acceptable, people understand it that way.

Is that good or bad?

You can’t say that. See next item.

There are advantages and disadvantages?

Sure, like everything else. And depending on the context, I’m going to try to mix the two that I mentioned.

Native is advantageous:

  • It’s much faster (almost always).
  • It tends to be lighter to send an application, but it depends a little, there are cases that is worse, hard to pin if this is advantage and if it happens, depends on what you are comparing.
  • Allows you to do everything that the native API always allows, and is as up to date as possible.
  • The user experience is the same across the platform, it can be said to be more perfect.
  • Some platforms give advantages to native applications.

Native is disadvantageous:

  • Native cannot be used on other platforms and if you need to do for several can cost you more and take longer to do for each one. Although I have some tricks that can minimize this, as I mentioned above.
  • Native can be a crude way of doing and be harder to code than a more abstract, extra layer.
  • Depending on how the non-native is done and the platform, it may be easier to update *web for example), but it is not difficult for the native, people just are not as used to.
  • In the context of the web the experience can be interesting in the sense that everyone is accustomed to the web, no matter what device or operating system they use. The problem is that each web site/app uses a different way of doing it, which is bad, so the native would be more advantageous by giving a basis of how the UI should be. It’s not easy to sink these things.
  • In general the native needs some form of installation, but it depends a little, it is not as bad as people usually do (we can not put as a disadvantage the fact that people do wrong).

Note that the disadvantages have more to do with the API, the fact that you run the native executable, if you look at just that aspect, it tends to be only advantageous. Some non-native technologies may have other advantages that outweigh the fact that it is something slow, having an intermediate.

Some questions depend a lot on what you are looking at. I even used an example, but there are several cases. There are solutions for seems more limited, more difficult to do one way, but you can do it another way.

  • So something native is something that directly accesses OS without needing software to work before?

  • 1

    We cannot say that, there is no clear definition. It’s basically this, but it’s not clear what kind of intermediary you can have, so I give examples of cases that have intermediaries, but it being thin, not changing the basic semantics, not limiting you, can still be native. Python is not usually native, but there is implementation of it that you can say it is. Memory management is not so much yet, but the rest is. There is Python that even the management of memory is closer to the native, but then I would say that it is another language similar to Python, and not Python itself.

  • 1

    Anyway, it is very complicated to draw a line to say what is native or not. Some cases are very clear that they are native. C++ is (in almost all implementations). C# I would say it is, some implementations certainly, but not in 100% of the aspects. Javascript doesn’t seem to be, but the implementations aren’t that different from C# or Java. But it’s a bit. But JS alone does not mean much, it along with HTML and CSS does not use the screen system of the operating system. Is Typescript native? It’s such a different way of it all. But TS is JS, and now?

-3

Nowadays, what is called hybrid development has become increasingly popular, whether on mobile or desktop platforms. Whenever we develop a software we choose which platforms we will develop it for and which Operating Systems we will support, for example on mobile we have Android and iOS, on desktop we have Osx (Apple), Windows and Linux. If we choose to develop Android then we will program in Java, if we choose to develop iOS we will program in Swift and so on. But what if we could only program once and this code is good for both Android and iOS? Wouldn’t it be wonderful? That’s when the hybrid platforms began to appear, in what has become more popular we can mention the mobile with Reactnative and Flutter, where you program only once and the code will work for both Android and iOS. Now imagine that you need to work with some features that only exist on Android or only on iOS? then you can no longer use hybrid features, that’s where enters the so-called "native" where you use features that only exist in Android for example. When we talk about native programming we are basically talking about working with the official language, that platform, in the case of Android Java or Kotlin, and iOS Swift. Another example that we can give is the Desktop development, if we program with Java, our system will work on any operating system, be it Windows, Linux or other, but now imagine that you want to access specific functions of Windows, then you will need to use the native Windows API that is done in C# (Microsoft). Working with native is very advantageous because you earn a lot of performance, because you are working directly with the components and with the language of the operating system, but in contrast you need to program your application in 2 different languages, I mean, you have to do it in Java for Android and then redo it in Swift for iOS. The advantage you have using hybrid is the greater freedom to work with the components of the specific operating system and the performace, but as I said, in contrast you need to reprogram the App, so everything will depend on your need.

-4

Native applications are developed for a specific system (Android and iOS) and are downloaded to a mobile device from an app store. It is developed in specific programming languages, such as Swift for iOS and Kotlin for Android.

  • 4

    Jaime, the "native applications" are not unique to Mobile and the question itself asks the definition of what is native.

  • Sorry the mistake, I wanted an example of native applications on Android and IOS.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.