Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Which programming language can run natively on mac and windows?

Posted on 2009-04-30
25
Medium Priority
?
514 Views
Last Modified: 2012-05-06
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
Comment
Question by:harsimar11
  • 9
  • 8
  • 4
  • +2
23 Comments
 
LVL 4

Expert Comment

by:my2eggs
ID: 24274526
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
 
LVL 23

Expert Comment

by:ComputerTechie
ID: 24274541
Something like this:
http://www.qtsoftware.com/products

CT
0
 
LVL 4

Expert Comment

by:my2eggs
ID: 24274551
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
The Firewall Audit Checklist

Preparing for a firewall audit today is almost impossible.
AlgoSec, together with some of the largest global organizations and auditors, has created a checklist to follow when preparing for your firewall audit. Simplify risk mitigation while staying compliant all of the time!

 
LVL 4

Accepted Solution

by:
my2eggs earned 1000 total points
ID: 24274663
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
 
LVL 5

Expert Comment

by:AGoodKeenMan
ID: 24274992
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
 

Author Comment

by:harsimar11
ID: 24275074
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
 
LVL 4

Expert Comment

by:my2eggs
ID: 24275323
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
 
LVL 4

Assisted Solution

by:my2eggs
my2eggs earned 1000 total points
ID: 24275388
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
 

Author Comment

by:harsimar11
ID: 24276247
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
 
LVL 4

Expert Comment

by:my2eggs
ID: 24276273
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
 

Author Comment

by:harsimar11
ID: 24396339
How about Assembly?  Any thoughts on it?  Looks good, hard, and Strong to me.  What are your thoughts on it?
0
 
LVL 4

Expert Comment

by:my2eggs
ID: 24396515
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
 
LVL 4

Expert Comment

by:my2eggs
ID: 24396870
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
 
LVL 1

Assisted Solution

by:brent411
brent411 earned 1000 total points
ID: 24661454
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
 

Author Comment

by:harsimar11
ID: 24662742
sorry for the late response.

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

thank you!
0
 
LVL 1

Expert Comment

by:brent411
ID: 24662793
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
 

Author Comment

by:harsimar11
ID: 24663600
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
 
LVL 1

Expert Comment

by:brent411
ID: 24670876
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
 

Author Comment

by:harsimar11
ID: 24672315
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
 

Author Comment

by:harsimar11
ID: 24672345
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
 
LVL 1

Assisted Solution

by:brent411
brent411 earned 1000 total points
ID: 24674415
0
 
LVL 4

Expert Comment

by:my2eggs
ID: 25078067
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
 

Author Comment

by:harsimar11
ID: 25078698
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Understanding the various editions available is vital when you decide to purchase Windows Server 2012. You need to have a basic understanding of the features and limitations in each edition in order to make a well-informed decision that best suits …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension . This reminded me of questions that come up here at EE along the lines of, "How can I tell the type of file from its cont…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question