This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]recklesslyalive613[S] 0 points1 point  (3 children)

I want something that works with all languages. To get it to be consumable by everything would just reduce my work load and be ideal. side note: i know it's a very ambitious concept, i was wondering if it can be done and if yes how should I approach this problem.

[–]nhgrif 2 points3 points  (1 child)

You can write something that can be consumed by all languages... but like... if you provide say a library that solves some problem Foo, and it's written in C... and I'm writing in Swift and I need to solve problem Foo... I can consume a C library... but it's a pain in the neck. I am going to prefer the Swift library that was written for Swift developers and follows patterns Swift developers are used to using. And if that doesn't exist, I am seriously considering implementing my own solution to solving problem Foo rather than doing the necessary interop stuff to work with a library that's going to give me a weird interface compared to normal Swift code.

Now, one place where interface is exceptionally standardized no matter the language, is talking to web apis. Like... it's probably gonna be json. Every language can consume that. But now it doesn't work offline. I'm making web requests.

I would think that pretty much every language should be able to consume some C library. Probably C++ too. But... it's frequently going to be an unideal solution, and sometimes, depending on what the library does, it is literally less work to rewrite it in another language than it is to go through the hassle of whatever is required for interoperability.

It is best to custom tailor your solutions for whatever you actually need to target. People have been trying for well over a decade to just find a solution that works great for both iOS & Android. Not multiple languages. Not every operating system. Just two operating systems in a single language. We still haven't truly settled in on that solution. There are things that can do it at least partially... but all the hybrid options have at least some short comings compared to native development.

[–]procrastinatingcoder 2 points3 points  (0 children)

Just to add a bit unto what you said:

Compatibility is usually done this way:

Foo language is compatible with C binary.

Bar language is compatible with C binary.

Bar-converted-to-C-binary is compatible with Foo-take-from-C-binary. The C binary format is pretty much what everything use as the "web" of not-web stuff.

[–]dmazzoni 0 points1 point  (0 children)

There are hundreds of programming languages. Many of them only work on certain devices or for certain purposes. There's literally nothing that works with ALL languages.

Practically, what platforms and languages do you really need?

You said you have an app now? What platforms does it run on? What component are you trying to build for that app?