Which programming languages support Linux and Windows?

14

The question is already in the title, however to make it clearer:

  • What languages do I write a single code to, and run on both Linux and Windows?

Example

  • C . Except some commands like system("cls"); system("clear"); .
  • Java . Virtual Machine to interpret.

Obs

  • Languages that perform some task or window in the operating system.
asked by anonymous 23.11.2015 / 14:17

1 answer

14

Essentially all. In fact it is an exception to have languages that run only on one of them and not on the other. In general, few languages are known. Perhaps the biggest exception is Delphi. Even though it is possible to use Lazarus that uses almost identical language, but that requires many changes in several cases.

The language itself has little to do with the operating system. It may have more restriction on the processor that runs, since the language either needs to generate a native code for a specific processor or need to have an interpreter or virtual machine for that processor. There are some languages that confuse its basic structure with what should be library. There it obviously complicates more.

Of course, the basic language library must be able to perform certain operations that depend on the operating system. Almost all have abstractions or at least specific libraries that allow you to do all the major tasks on both operating systems. Eventually it will be necessary to make some adaptation to the specificities. Libraries that can abstract 100% use a "least common denominator" method which does not work well.

Some stand out more for having better abstractions and a greater number of APIs met, whether in the standard library or recognized libraries that become almost standard. C and C ++ with some specific libraries are known to suit both.

Languages interpreted and running in virtual machines usually go very well also in both, this includes C #, VB.Net, Java, PHP, Pyhton, Ruby, Perl, JS, Moon, just to stay in the better known. What matters is having the environment where they run working well on both operating systems.

There is a certain subjectivity in which it serves the two platforms better at the same time. But every code that you want to run on more than one platform needs to be written thinking about it.

    
23.11.2015 / 14:28