Cross-platform programming? (8)

1 Name: #!/usr/bin/anonymous : 2007-02-20 15:00 ID:Heaven

First, why must many languages have their programs compiled with a specific OS in mind? I understand how hardware differences could require something like this, but not how a pure software difference could do so.

Second, are there any cross-platform languages that are NOT scripting languages (ECMAScript, PHP, etc.)?

2 Name: #!/usr/bin/anonymous : 2007-02-20 22:13 ID:Heaven

you mean like java and .NET?

3 Name: #!/usr/bin/anonymous : 2007-02-21 06:44 ID:Heaven

>>1
Each operating system kernel has its own API. User programs don't talk to the hardware directly.

The examples you gave work because an interpreter runs them, and the interpreter is compiled for the OS it runs on.

4 Name: #!/usr/bin/anonymous : 2007-03-06 23:30 ID:0CbrzZVI

>>3
And even then. If you write using a paradigm from one OS that's not on every other one, you end up with platform-specific Java/.NET/Python.

For example, you expect hard locking, and then move your program to Linux (advisory locking only). Or you need symlinks, and move to Windows (hard links only, and only for directories).

You'll also see interesting bugs moving from one interpreter/VM to another; even the same interpreter on a different platform can be enough of a shoogle to make your potential race condition into an actual race condition.

5 Name: #!/usr/bin/anonymous : 2007-03-08 13:21 ID:oRjsD1Dg

Since you're asking this question I don't suspect you of being leader of a big problem. So why not just use cross-platform librarys and then compile twice?

6 Name: #!/usr/bin/anonymous : 2007-03-08 22:41 ID:Heaven

whuy not just program in windows.

7 Name: #!/usr/bin/anonymous : 2007-03-09 00:49 ID:XcIoN9/R

>>6
GB2/VB

8 Name: #!/usr/bin/anonymous : 2007-03-26 06:13 ID:elNFlmyr

>>1
Programming languages are usually platform independant. The platform dependant bits are usually the language's standard Apis. The basic Windows platform is the win32 Api. The basic Unix platform is defined by the Posix standard. Other software platforms (for microcomputer type computers) usually build on top of those two platforms. Without the basic platform, developers would need to write code in their software to control hardware among other things.

Cross platform frameworks (such as QT or GTK) build on top of other basic platforms so that developers only need to target the one framework and have the app work correctly to all the supported platforms (at least at the source code level).

The term Java refers to 1) a programming language and 2) a platform independant framework. Java was designed so that devlopers develop their software to only one platform and don't have to worry about the quirks of developing towards different platforms.

I hope this answers your question

This thread has been closed. You cannot post in this thread any longer.