Is there a universal language?

We are developing an application that will work on Windows, OSX, iOS and Androids. It would be nice to at least have most of the code in one language, instead of using Objective-C for versions of Apple, C # or C ++ for Windows and Java for Android.

We saw Flex (with all its problems) as a way to avoid using a different language for each version, but Adobe threw a towel and ultimately was not going to do the job. Java promised to be universal, but it looks like Apple no longer supports it as part of a distributed OS, and as far as I can tell, Microsoft has never supported it. We do not want our users to download and install something so that they can use our application.

Is there a solution? Or are we committed to creating an application in several languages?

+6
source share
9 answers

“global” languages ​​are likely to use virtual machines, so you won’t be able to avoid “users need to download and install something so they can use the application” ... I think Java is your best choice if you don’t want to deal with language issues that compile into native machine code.

+6
source

HTML + css + JavaScript!

Run the application on a standard web server. All of the above has standards-compliant web browsers, all of which support JavaScript and AJAX. The only thing that really changes is the screen size, and this can be easily dealt with using your own .css file for each target browser.

+16
source

You can host the web application on the server and use application browsers to interact with the application.

Although this is not a native application, all devices will be able to use it.

The disadvantage is that you will need to connect to the server, however this may not be a problem.

+8
source

You can use C # on all of these platforms:

(If you ever wanted to write an application for Windows Phone 7, you would be fine too.)

Of course, part of the user interface will have to change significantly between different platforms, and I doubt that it will be particularly smooth, but at least it's worth considering.

+4
source

I'm not very sure, but I heard that python is a universal language. I tried this with both mac and windows, not sure what other plactforms are

+2
source

I believe that C ++ code can be run on all of these platforms: Windows fully supports it; Android has an NDK; and you can use Objective-C ++ on iOS (and I also assume OSX!).

I would not go so far as to claim that this is the best option, but I thought it was worth mentioning.

Ultimately, a lot will depend on the nature of the application you are developing. If this is a great application, I would strongly recommend making some detailed consultations with someone who has experience in this field: due to the vagaries of different platforms, this is one area where the experience is considered to be very large.

+2
source

Depending on the requirements for your application, there are several options:

The first is a web application, as mentioned earlier. This is the same as the largest common factor - very small

Second one . Build the core of your application in c / C ++, and for the interface, use a framework that suits your needs. These recommendations are really, really wonderful. You can even develop an interface separately for each platform, in Java for Android, Objective C for iOS, etc.

Remember that you can never, ever, do the same code on all platforms. There will always be some part with #define MAC or #define ANDROID . It is simply impossible to run identical code, even for the simplest application.

If not

 void main(void){} 

Even a web application will have code like

 if(browser()==Safari) {} else {} 
+2
source

I think the answer depends on which application you are going to build.

If this looks like twitter, the answer is a good web interface. Each client simply needs to handle the work with the graphical interface using its own platform language and lib.

If this is a game, there is no connection to the server. I prefer C and script like Lua to create the core of your application.

"Is there a solution? Or are we stuck in creating an application in several languages?"

No, there is no solution for this. We use different languages ​​because they work on different platforms. Generic languages, such as HTML, have many limitations, because in order to be generic, you must reduce all differences. This is a set of intersections of all platforms, which is very small.

+1
source

Using HTML and Javascript is likely to be a better approach. Another option that runs on these platforms is Java FX 2.0.

+1
source

Source: https://habr.com/ru/post/903350/


All Articles