Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > can you port your code to other OSs?

can you port your code to other OSs?
Thread Tools
lord vader
Fresh-Faced Recruit
Join Date: Oct 2004
Status: Offline
Reply With Quote
Oct 19, 2004, 02:35 AM
 
Does any one know if you can port or write code for other operating systems? I want to write code for mac but would like it if i could write it for other OSs or port it over.
     
depolitic
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Oct 19, 2004, 03:07 AM
 
Ohh yes - Easy

Dead Easy, no brainier: Java, Perl + Ruby + Python +PHP
Most of the time not an Issuie, as long as you code good OS independently: C and C++
Possible but with limits: Objective-C using GNUStep, and C# using mono

Enjoy
     
Brass
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Oct 19, 2004, 09:01 PM
 
Many languages are fully portable (as the above post mentioned). However, the problem comes with the APIs. Eg, if you use C++ with Carbon, or Objective-C with Cocoa, the APIs will not be available on anything but a Mac (although GNU Step has equivalents to many of the Cocoa APIs for unix/windows).

This is usually more of a problem for higher level programing (eg, GUI applications), which is where you'd use such APIs.

So you need to think very carefully about the APIs you're going to use, if anything other than standard libraries for that language. You may need to include several OS-specific implementations of some routines (particularly GUI stuff) within the code, and compiler directives instructing it to use the implementation for which it's being compiled on.
     
itistoday
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
Oct 19, 2004, 10:45 PM
 
Originally posted by lord vader:
Does any one know if you can port or write code for other operating systems? I want to write code for mac but would like it if i could write it for other OSs or port it over.
Depends really on what language you're using. Most langauges can be ported, however the difficulty varies depending on what you're using. Java is great in that it's fully portable (unless you're using native libraries, but usually there are versions available for all OS's). C and C++, as the previous posts have mentioned, are more difficult to port because the libraries they use are different depending on the Operating system (usually these are libraries involving the GUI or networking).

Carbon, which uses C, is more portable than say Cocoa, which uses Obj-C. C++ seems to be poorly supported on the mac (as far as I know).

If your goal is ease of portability however, I would go with Java.
     
depolitic
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Oct 19, 2004, 11:30 PM
 
Portability - is only one concern - in your selection - the type of application you wish to build is I think a far more critical choice.

You need to define your product - as not all languages are equal for all purposes you need.

C and C++ and Objective-C are going to be the most low level access to graphics, music, video, and real time programming with the most speed and OS level integration.

Then you go higher level like Java - less speed less OS level integration, but more portable.

Then you get into PHP and Perl, which is even higher level, and are totally OS neutral but you are becoming more abstract and further removed from core OS. At the same time you are loosing speed and heavy lifting abilities (music, computations, graphics etc..) in you application.

Then their is Ruby which is a newer generation of languages which is a very high level language, that is very portable, however has low level access to system functions and is often defined as a scripting language, but it can exists as byte code however it spans the range and option from Objective-C to PHP level in its abilities, being able to be used for both scripting and byte code execution.
     
lord vader  (op)
Fresh-Faced Recruit
Join Date: Oct 2004
Status: Offline
Reply With Quote
Oct 20, 2004, 03:06 AM
 
Thanks for the replies. I am learning C++ right now. Ill probably learn another language later though. I was just wandering.
     
numero
Junior Member
Join Date: Mar 2000
Location: Salem, OR, USA
Status: Offline
Reply With Quote
Oct 26, 2004, 04:52 PM
 
How about thinking about RealBASIC? You can write on Mac and then compile for Mac, Windows or Linux. There are some instances where you will need to make OS specific calls, but RealBASIC can handle that.
     
GeeYouEye
Junior Member
Join Date: Mar 2003
Location: Walnut Creek, CA
Status: Offline
Reply With Quote
Oct 28, 2004, 01:39 AM
 
Originally posted by itistoday:
Depends really on what language you're using. Most langauges can be ported, however the difficulty varies depending on what you're using. Java is great in that it's fully portable (unless you're using native libraries, but usually there are versions available for all OS's). C and C++, as the previous posts have mentioned, are more difficult to port because the libraries they use are different depending on the Operating system (usually these are libraries involving the GUI or networking).

Carbon, which uses C, is more portable than say Cocoa, which uses Obj-C. C++ seems to be poorly supported on the mac (as far as I know).

If your goal is ease of portability however, I would go with Java.
Minor (major?) nitpick - Carbon is C++, not ANSI C. Besides which, there's always CodeWarrior which is primarily a C++ compiler.

Along the same lines: I'm trying to port a Cocoa app of mine to GNUstep, but I'm having trouble installing GNUstep on Windows (via Cygwin). Has anyone had any luck with this?
I bring order to chaos. You are in chaos windows, you are the contradiction, a bug wishing to be an OS.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 28, 2004, 05:10 AM
 
Originally posted by GeeYouEye:
Minor (major?) nitpick - Carbon is C++, not ANSI C.
As far as I can tell, Carbon is written in C++, but the public interface is ANSI C.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
TampaDeveloper
Dedicated MacNNer
Join Date: Nov 2003
Status: Offline
Reply With Quote
Nov 14, 2004, 08:39 PM
 
Ooops, looks like everybody missed a big one. If simple cross-platform development is your main concern, then RealBasic appears to be a good solution. I, personally, have never used it. But it looks good.

www.realbasic.com
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Nov 15, 2004, 10:53 AM
 
Originally posted by TampaDeveloper:
Ooops, looks like everybody missed a big one. If simple cross-platform development is your main concern, then RealBasic appears to be a good solution. I, personally, have never used it. But it looks good.

www.realbasic.com
It depends on what platform you are porting to, but I can attest that the cross-compile from Mac->Windows is very good and reliable now. I have used it on numerous occasions with good success.

Realbasic gets a bad wrap because it's so easy to use, you end up with a bunch of poorly-designed software written with it. But you certainly can design good software with Realbasic -- I've been using it for 5+ years and am very happy with it for rapid-application-development (RAD) GUI apps.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
TampaDeveloper
Dedicated MacNNer
Join Date: Nov 2003
Status: Offline
Reply With Quote
Nov 15, 2004, 05:28 PM
 
Wow Arkham. I'm glad to hear that. I've been beating myself up because I can't bring myself to develop an application in Objective-C. I learned the language, started learning Cocoa, and began writing what I believe will be an excellent money-maker. But the nagging concern is that my software will be marginallized by some copy-cat with deep pockets who brings my product to windows and dominates me out of business.

So I keep procastinating something that is great and has no technical barriers (other than cross-platform support), just because of the uncertainty of being on a minority platform. I kept thinking if I waited that something good would come along.

Maybe I'm going to have to bite the bullet...
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 02:13 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,