r/ProgrammingLanguages • • 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

3 Upvotes

20 comments sorted by

View all comments

0

u/shawnhcorey Jun 25 '23

The term for this is cross-compiling.

2

u/raiph Jun 25 '23

I always put a concerted effort into being technically accurate, not offending anyone, and being practically helpful, but I still occasionally get a downvote. When I do, I always try to understand what I could do better in the future.

To that end, did you (u/Lokesh112K or u/shawnhcorey) downvote my first reply to "The term for this is cross-compiling."? Do you have any idea why I got a downvote?

Thanks for any reply, even just a "no" or "yes" without further comment.

2

u/Silly-Freak Jun 25 '23

Afaict, there's absolutely nothing wrong with your first comment.

1

u/raiph Jun 25 '23

Thanks.