Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
TobiSGD2816y@HampusMa Nowadays Python works pretty much like Java, where it is compiled into bytecode first and then run in a Python VM, IIRC.
-
Fabian10136y@TobiSGD Does the user just install a simple thing like the JRE for Java and then they can just run it? Or does it have to be explicitly compiled for every device?
-
Well do not take my word for it but GO was built for that purpose all be it, it is mostly a server language.
-
TobiSGD2816y@Fabian You have to compile explicitly for the different platforms, but since in Go everything is statically compiled into the executable (including the runtime environment) you don't need to install anything but the application itself (where install means: copy it to the machine).
Currently working on a REST-API for an internal project in our company, the complete binary so far, including HTTP/1.1, HTTP/2 and websocket server is about 12MB in size. -
Fabian10136yI guess JavaScript also works similarly? For example I'm running a NodeJS program on my Raspberry Pi with Raspbian right now and I have also previously run it on Debian and even Android and the instructions say that it works for Windows as well. But I've also heard a lot about messy JS setups and other JS weirdnesses on DevRant and r/programmerhumor, so maybe that's not a good choice?
BTW, context: I'm looking for programming languages that are worth learning. If I don't even know what operating system I'll be programming for in the future, it's better to choose something that can run everywhere. I already know Java and have written a simple script in Google Sheets (uses a custom JavaScript variant), but I've not learned any Python or Go yet. -
TobiSGD2816y@Fabian For Node.js you need the Node.js environment on the machine you want to run the application on. The Node.js environment comes with the V8 Javascript engine from Chrome/Chromium for executing the scripts.
I personally don't like Javascript and it (or better the V8 engine) is single threaded, which can be a real problem if you have to deal with a lot of concurrent calculations (just I/O, so querying a database or reading a file is asynchronously in Node, so that is fine, but once you start doing heavy calculations on environments that are inherently multi-threaded, like webservers, you might run into serious performance problems).
Having said that, Go is pretty easy to learn (simplicity is a goal of the language), I would say it is a good mix of C, Python and a bit Javascript, so maybe just give it a try.
I love the language. -
@HampusMa you can compile python and java is the fastest vm language (look it up, its about a year old article)
-
I'm wondering that nobody said C yet which basically runs everywhere (although it is a PITA to make it compile everywhere).
Also most of you forget that running "everywhere" for most languages means running everywhere where a runtime/interpreter is available. -
@TobiSGD just to be sure, python and js are both scripts fed to an interpreter. So if one is a valid answer, so is the other.
-
Fabian10136y@beggarboy .net doesn't run on Linux. You can somewhat run most programs with Wine/Mono, but it's not just a matter of download+run.
-
Fabian10136yOh wow, so many comments. I guess I should have defined my question better: I'm looking for things that I can just program once, without any change to adjust for other systems or devices (unless I want to do GPU stuff and such of course), and that users can just download and run, as long as they have the corresponding thing, like JRE or Python, installed, without having to launch an IDE or use a command-line compiler or whatever. Basically something that Just Works™. I'm pretty sure C does not fulfil those criteria and Assembly definitely doesn't, both were commented here. This was not meant as "which programming languages do you like". In the best case something where I just say "install XY" (e.g. "Java") and it's intuitive to the user what to do, afterwards they can just download and run the one binary/whatever file.
So I guess the list so far is this one?
- Java
- Python
- C# probably
- Go -
ojrask2866y@Fabian yup, as long as a PHP interpreter is installed things will work, assuming you're not running exotic extension code. Of course you need to have the correct version, similarly to Python 2 vs. 3, depending on what you want to run. PHP has built-in support for single-file executables as well (PHARs) that you can run.
-
Dart seems okay, and Kotlin/Native is becoming an option
ohh, also C++ with Qt if you're up for the challenge -
Brolls31156y.NET core brings nice cross-platform magic, and you can even bundle the runtime up in the executable with a tool like dotnet-warp.
The performance metrics they’re getting are pretty impressive too, admittedly it’s interpreted and just-in-time compiled, but unless you really specifically need bare-metal performance you’re fine. -
https://docs.microsoft.com/en-us/... @Fabian
What people don't see is that since they allowed people to make vs code
and then fucking refactor the csharp framework? thats golden. -
Fabian10136y@ojrask I know at least that I was unable to get paint.net running, even with complicated Wine setups or Mono.
-
ojrask2866y@Fabian I presume Paint.NET is not written with .NET Core, but .NET Framework, which is Windows specific?
-
C does work for that setup unless you want to do GUI programming. But since that sucks in C anyway, nobody will do that.
However, you will need to provide several binaries for the users to download, depending on CPU and OS.
In order to do that without getting crazy, you will need to design your application in a proper way, e.g. with encapsulating stuff with multithreading so that you can have the Win API under Windows and POSIX threads under Android and Linux. No big deal. -
Froot75396yJavaScript is what you're looking for. Got tons of options there like react native, electron and so on. Stuff runs well and is battle tested
Related Rants
Which programming languages can create portable programs that can run on every operating system, device, etc. (and are actually intended for that)?
- Java
- Python
- I heard some things about C# maybe…?
- What else?
question
portability
programming language
java
python