[Courses] [Basics] Dear participants...

jennyw jennyw at dangerousideas.com
Sat Apr 6 22:33:56 EST 2002


On Sun, Apr 07, 2002 at 01:41:30PM +1000, Shuying wrote:
> On 6 Apr 2002, Beth Johnson wrote:
> > of theme elements.  I'm also interested in how programs are ported from
> > one OS to another.
> 
> I haven't ported very many programs (actually 1), but my understanding is
> that you simply change the bits of code that rely on a particular OS. For
> example, if you're porting a linux program to windows say, you're likely
> to make use of some win32 library. And then sometimes you've to do some
> really dirty hack because what works on one OS doesn't work on the other.
> :) Hope that answers your question.

I don't know if "simply change ..." is the best way to phrase it ;-).  
But, yeah, you end up using different libraries, etc. Then of course an
int on one system might have a different number of bits than an int on
another system.  And compilers might support different language features.  
And ... there can be a lot involved, which is why some stuff doesn't get 
ported.  

Of course, it all depends on the language you're using. If you were
programming in Smalltalk, for example, porting from one OS to another
probably wouldn't be too hard (most Smalltalk implementations, like
Squeak, are pretty much the same on one platform as another).  Assembly
code, on the other hand, is going to be pretty specific from processor to
processor, so you may end up rewriting the whole thing.  C is somewhere in 
between.

Jen



More information about the Courses mailing list