Results 1 to 5 of 5

Thread: OS indepentedent programs

  1. #1

    Thread Starter
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    Is there ant compiler out there, or any way to make a c/c++ program that is basically OS independent? Not a fancy program, maybe just a Hello World program. One that could say run on the consule window in windows, in MS-DOS say from a bootdisk, and then maybe on Linux, mac OS, etc. Like java sort of... The OS doesn't matter.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Not really. You can have portable code, but not a portable compiled program.

    Why not use java?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340

    hmmmm.....

    Well, so what is the Java VM programmed in? ASM? How is it able to run on so many different OS's/platforms? Are there any other languages besides java that are that flexible? And one last question...Say that you were to write your own OS, would you have to write your own c++ compiler?

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    The Java Virtual Machine itself is OS-dependant, but the bytecode that runs on it isn't. Every platform that Java programs will run on needs to have a version of the JVM compiled for it.
    Harry.

    "From one thing, know ten thousand things."

  5. #5
    Addicted Member
    Join Date
    Nov 2000
    Posts
    143
    Lets sum it up shall we
    Code:
    C is compiled Java is interpreted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width