HACKER Q&A
📣 distcs

Which programming language other than C is available for most platforms?


It is well known that some C compiler implementation is available for almost every computable platform. I am looking for another programming language that has compiler implementations available on a large number of platforms. It must compile source code into native machine code. It doesn't have to match C in ubiquity. It can be less popular than C. But are there any compilers out there that are available on a large number of platforms?


  👤 jjgreen Accepted Answer ✓
F77? But not clear if you're asking for a language which has compilers on most platforms, or a compiler for that language on most platforms ...

👤 cylinder714
It's an interpreter, and it's proprietary, commercial software free for personal use, but OpenLisp runs on thirty platforms as of today:

http://www.eligis.com/

It's an implementation of ISLisp/ISO Lisp. The paid version can compile applications to C.


👤 Comevius
Zig supports a large number of platforms, although the ones that are widely used are supported the most.

https://ziglang.org/download/0.9.1/release-notes.html

The best part about Zig is that it is a standalone cross-compiler, no cross-toolchain is needed. It can also compile and cross-compile C. You can directly import C header files with Zig, it's actually better at using C libraries than C is.


👤 mikewarot
Free Pascal supports quite a few platforms, and compiles to native code.

https://www.freepascal.org/


👤 smsm42
Technically I imagine a language implemented in C should be portable on any platform that has a C compiler? It may lack some functionality if the platform is missing it, but the basics should be there.

👤 kazinator
I would have to say C++.

GCC cannot be built without C++; it is written in C++ now.