• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

Which programming language can run natively on mac and windows?

Is there any programming language that can run on both Mac and Windows Machine, without requiring a framework.  I know that Java Applications require Java and Windows (which can only run on windows) required the .Net Framework.  But I want to know of a programming language that can run on multiple machines, like Java, but not require a framework, like Java.  
0
harsimar11
Asked:
harsimar11
  • 9
  • 8
  • 4
  • +2
4 Solutions
 
my2eggsCommented:
What you are looking for is a cross-platform programming language.

http://en.wikipedia.org/wiki/Cross-platform

The big one that is most commonly used is Java. Do not however that most languages will have some parts to it that will break the cross-platform compatibility.
0
 
ComputerTechieCommented:
Something like this:
http://www.qtsoftware.com/products

CT
0
 
my2eggsCommented:
Oopps. Didn't notice part of your message.

Most all languages are going to need someway of working with the operating system directly. Therefore you either have to write code that will check which OS it is on and then essentially have two sets of code for whichever OS it is on, or you will have to have some form a framework underlying the code to make those distinctions for you.
0
KuppingerCole Reviews AlgoSec in Executive Report

Leading analyst firm, KuppingerCole reviews AlgoSec's Security Policy Management Solution, and the security challenges faced by companies today in their Executive View report.

 
my2eggsCommented:
QT is a cross-platform development framework. Meaning you can write one set of code that will work on multiple platforms without modification. However, you will still have to compile it on the platform you wish to use it on. So you would write once and compile twice. If you are looking for something that will allow you to write once and compile once you will need some form a runtime framework.
0
 
AGoodKeenManCommented:
You might want to look at RealBasic, you can find it here:
http://www.realsoftware.com
Although not as comprehensive as Java, it has a good object model that works well across Mac, Windows, and Linux platforms.
I mainly use xcode now for the Mac, but every now and then I get asked for a cross platform solution and I go back to RealBasic every time.
0
 
harsimar11Author Commented:
Well, I'll make the question easy for you guys....
What language is Java written in?  I mean the Java platform.  It does not require any other platform.  But it can run various Java apps on it.  
What language can create such a powerful, fast, and multi-platform tool (Java)?
0
 
my2eggsCommented:
The Java runtime environment is compiled differently depending on the OS you are going to run it on. You can not run a Windows Java Runtime Environment on a Mac and vice versa.

The Java runtime environment was written in C++ and there are there is different code for each OS that it runs on.
0
 
my2eggsCommented:
The operating system (OS) is the software that interfaces with the hardware of the computer. To do this it requires drivers that have specific code sets that can be used on them, typically in some form of assembly language. To do higher level programming to create general programs you must interface with the OS. Each OS is different has a different set of system codes that can be used to operate. For instance the way Mac works with it's filesystem is different than the way Windows does. Therefore there are different "system calls" that must be made in order to open a file.

When writing a program it must know what "system calls" will be needed in order to get the OS to do what you want it to. For C++ you would have to simply know what these system calls are for each OS you are writing to. Therefore you would have to write two different sets of code for two different OSes.

This creates a lot of extra work for the programmer. Therefore some languages have been created to take care of that for you. Java is a language that will let you write one set of code. Then the Java Runtime Environment which must be installed ahead of time take your code and make the appropriate "system calls" for the OS it is running on. While the Java language is cross-platform capable the Java Runetime Environment must be specifically compiled for the OS it will be running on.

There are other languages that will simply make you write the one set of code and then the compiler will make the appropriate modifications to your code at compile time for the intended OS you are intending on running it on. QT and RealBasic for instance will let you write one set of code but then you will have to compile it on a Mac for it to run non a Mac and compile it on a Windows machine to have it run on a Windows machine.

Ultimately it boils down to the fact that somewhere you will have to make a distinction between which "system calls" you will need to make in order for it to work on the OS it will be running on. Whether that be you who makes the distinction, a compiler or a runtime environment.
0
 
harsimar11Author Commented:
Well, I am trying to create a really powerful application.  A good example would be Visual Studio 2008.  I expect it to be fast and to work on different platforms.  

Is real basic a good choice?
Real Basic looks like Visual Basic, which is slow.

I am good with QT, but some one previously told me something about compiling twice, whi.ch I really didn't understand.  Did they mean that the application needs to be compiled on the platform it will run on?  Like, compile on Mac, if Mac users want to use it?  If no, then sorry, but I didn't understand it.

Thank You for your interest.
0
 
my2eggsCommented:
Right, QT will allow you to write a program. Then without any modification to the code you can compile it on a Mac to make it run on a Mac and then compile it on a Windows machine to make it run on a Windows machine.
0
 
harsimar11Author Commented:
How about Assembly?  Any thoughts on it?  Looks good, hard, and Strong to me.  What are your thoughts on it?
0
 
my2eggsCommented:
Well, you can definitely write fast code with assembly language, in fact it will probably be the fastest, you will also have the most control as it is a low level programming language, but there will be absolutely no cross platform compatibility in any shape or form. There won't even be common libraries like there is with C/C++. Assembly language is essentially "human readable" machine language. You will have to write new code for each individual system you use. You are much better off using C/C++ if you want to get that involved. Plus C/C++ will allow you to insert assembly language code so that you can make processes faster and have more control.
0
 
my2eggsCommented:
Also, just to clarify, when I say you will have to write new code for each individual system you use. I don't just mean new code for a mac and new code for a PC. I mean new code for each different type of hardware you plan to interface with. So different code for a Intel, different code for an AMD, even different code for different models of Intel processors. Further more if you plan to interface directly with the video card then there will be different code for each type of video card your computers use. Writing code in nothing but assembly language is definitely for machine specific programs and no really even does that anymore. Most of the time assembly language is used to write code it's from within a high level programming language like C/C++.

What kind of programming experience do you have and what kind of program are you planning on writing? Perhaps I can point you in the right direction for a language that is suitable to want you need.
0
 
brent411Commented:
Hars,

You have received your answer but since this is still open, perhaps I could explain it better.

Qt (http://www.qtsoftware.com/), which is now practically free as of March (see LGPL license for details), allows you to compile the same source code natively in both Windows and Mac (and Linux for that matter).  You do have to compile it twice...once for Windows and once for Mac, to link the right libraries for each platform, but that is a fairly trivial step.  Qt is able to adapt its graphical user interface to the style of both Windows and Mac automatically, so the apps will not only RUN native, but APPEAR native as well!

Because the libraries for the underlying OS are different on both Windows and Mac, the only other practical way to run "natively" would be to take a windows-compiled app and run it on Mac with WINE, which provides those library calls to make the application run.  Wine is also free.  While WINE will run with near-native speed, it will not LOOK native.  IE, it will look like a Windows app running on a Macintosh.
0
 
harsimar11Author Commented:
sorry for the late response.

Brent, i have never heard of Wine, can you please tell how it works?

thank you!
0
 
brent411Commented:
It is a compatability layer that sits on top of the Mac OS calls and maps Windows API calls in the software to the equivalent GUI functions in the Mac OS.  It stands for [W]ine [I]s [N]ot an [E]mulator.

http://en.wikipedia.org/wiki/Wine_(software)
0
 
harsimar11Author Commented:
First of all the name (Wine) and what is stands for (Wine is Not an Emulator) is kind of funny, sorry.

What is Wine going to do for me?  I don't want the user to download it and then use.  Can I create a package or something using MAC and distribute it to my clients?

I also read online about WxWidgets, how could that help me.  Is it like QT?
0
 
brent411Commented:
I believe the recursive nature of the name is intended to be funny.  Ask not what wine can do for you, ask what you can do for wine. ;-)

I've seen packages that distribute Wine libraries with their executable.  Unlike other packages, its extremely light.  An example would be Navicat.

WxWidgets would fall in the same category as Qt but I don't believe its nearly as powerful or comprehensive.
0
 
harsimar11Author Commented:
Sounds interesting.  I am really interested i WINE, but the interface will not look native.  To my clients, I have to give them familiar and trust worthy application, and GUI plays a big part.  Some people by MACs, because they simply don't like PC, and with a Windows UI on Mac, it won't do no good.

And.......:  Not sure about Microsoft's thoughts on WIne.  According to Wikipedia http://en.wikipedia.org/wiki/Wine_(software)#Microsoft_and_Wine, it says "When WGA validation detects Wine running on the system, it will notify users that they are running non-genuine Windows and disallow genuine Windows downloads for that system."  This feature, I think, removed in Windows 7, but my clients don't use Windows 7, or most of them don't.  

My thoughts OVERALL
- WIne, impressive, but Microsoft doesn't want to get along with it and UI problems on other systems.
- QT looks good, but many of you disagree with it.  You guys are smarter than me, so I trust you.
- Sorry, but I can never get the touch of Java (Even though I can code Java).  The IDE and the GUI doesn't suit me well.
- Assembly, no good.
- Machine code, sounds really professional, would love to do it, only if I knew how to do it. :D
0
 
harsimar11Author Commented:
Sorry myeggs and the rest of you, I think I failed to explain to you my purpose for this question.

I am trying to create a Platform (JAVA, .Net) , for MAC, Linux, and Windows.  Then, create an IDE for the three systems.  The IDE will support two langauges, C# and VB.  
Think of the whole Java environement, exactly same, except support for C# and Visual Basic.  I am not sure if Microsoft is going to have a problem
The whole idea is to shift .Net into different systems.  Microsoft might do it later.  However, Developers demand cross-platform applications written in Visual C# and Visual Basic.

I am still researching on this.  I would like your help on this.  If you lead into the right direction, that will be even better.  

Thank You for all your help!
0
 
brent411Commented:
0
 
my2eggsCommented:
To summarize what I "believe" the author is asking, he is looking for a programming language that allows him to write in C# and VB. Then compile the code once and that compiled executable will then run on both Mac and Windows without the use of an underlying framework. (Please correct me if I am misunderstanding the author's intent).

As noted in my post on 4/20 at 7:40pm and then clarified by brent411's post on 6/18 at 4:26pm, this is simply not possible without some way of making a distinction between the differences in the two different operating system. As was noted previously, this distinction can be made in a number of ways. Primarily this can be done by either compiling the code twice, once for Mac and once for Windows, or by using an underlying framework such as the JavaVM which will make the distinction for you. All of the tools listed above work on this principle of somehow making a distinction between the way Mac does things and the way Windows does things. You either make the distinction at compile time or you make it at run time using an underlying frame work (or make it during coding time which essentially results in two sets of code). So while this isn't the answer the author is looking for, it is in fact the answer to his question (unless of course I am misunderstanding the question).
0
 
harsimar11Author Commented:
Sorry again for the late respinse :(

After doing research, I think QT might get the job done for me.  Although the knowledge you guys have provided me certainly tells me a lot about the good side and the bad side of each programming language.  At times I will use Mono, because I have more .Net experience than C++ and at times real basic, because it is easy and gets the job done.  Wine does not give a native GUI on mac, so that will not work.

Thanks A lot!!!!  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 9
  • 8
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now