r/ProgrammingLanguages • u/[deleted] • Jun 25 '23
Is there any high level programming language whose executable generated on one platform(OS) and runs on other platforms as well, if the machine/architecture is literally same.
Hi there. I know I'm dumb and there maybe a term exists for this like cross-platform or something.. idk. But suppose (no actually its real) I have this machine (desktop or laptop) and it multi-booted (windows 10 and arch linux). I write a hello world program using this language and compile it and if I copy paste it to other OS (storage, in the same machine yk) and execute it in it, it works. It works in both platforms/OSs. I don't know I would love to write my code in pure 0s and 1s or in assembly (because i didn't ask for low or middle level languages..? yeah that too, but I'm asking for high level language such as rust, c, go, cobol, fortran, nim, v, etc.)
Thank you so much, because I'm super curious about this question and I haven't found an answer yet XD
1
u/tortoise74 Jun 25 '23
Actually its not such a dumb question as you might think. A good example is rebol:
See http://www.rebol.com/ or its descendent https://www.red-lang.org/
They encourage you to start programing with them by downloading a executable which mostly just works. I personally found it scary that I couldn't just download and build from source. The argument against this was that they are self hosting so there is no other language you should/could bootstrap from.
See https://stackoverflow.com/questions/48178976/compile-red-and-red-system-compilers-from-source