Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: "write once, run anywhere"

by eyepopslikeamosquito (Archbishop)
on Sep 10, 2007 at 21:09 UTC ( [id://638171]=note: print w/replies, xml ) Need Help??


in reply to "write once, run anywhere"

Java takes a "lowest common denominator" approach to portability. That is, it defines a set of basic features that it feels should be available on all platforms, such as files, sockets, threads and so forth, and abstracts them. Features such as the Windows Registry, Unix domain sockets, shared memory, and so on are not available on all platforms, and so do not form part of the Java portable interface. Though you can get at these platform-specific facilities via JNI, you lose "write once, run anywhere" if you do so.

It is somewhat arbitrary what constitutes a "lowest common denominator" set of features, and if you want to port Java to a platform lacking them, you are in trouble. Porting Java to a platform lacking native thread support, for example, is problematic: though you can try a user-level threading library, such libraries tend to behave differently to native threads, leading to subtle portability problems (we had a large Java system that was working nicely on Unix and Windows that took months to port to an OS lacking native threads due to differences in threading behaviour).

Perl (and Ruby and Python) take a different philosphical approach to portability, moulding themselves to the platform they are running on. ActivePerl on Windows, for instance, includes many handy Windows-specific modules out-of-the-box. Though using such platform-specific libraries violates "write once, run anywhere", sometimes that's exactly what you want to do. With discipline, you can create "write once, run anywhere" programs in Perl by sticking to the core language available on all platforms.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://638171]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found