cross-platform programs

  • Thread starter Thread starter John Salerno
  • Start date Start date
J

John Salerno

Bear with me, but I've been reading a lot about how the .NET languages
are platform independent, and I assume this means a program written in
C# can be run on a Unix or Mac machine. If this assumption is wrong,
then nevermind! :)

But if it's true, what will be necessary to run these programs on a Mac,
for example? I know they would need an equivalent to the .NET Framework,
but does something like this exist yet, or is the "platform
independence" just a possibility at this point?

Thanks.
 
Is Java platform independent? .Net is built along the same lines. It is
compiled into byte code that is compiled at run-time to native machine code
by a virtual machine on the host. Now, both of these technologies require
something on the host, and that is the virtual machine to do the run-time
compilation.

It's a common misunderstanding among people just getting acquainted with the
..Net platform to mix up platform-independence with language-neutrality.
These are 2 separate concepts. Both .Net and Java are platform-independent.
However, you can only write Java apps in one language - Java. Microsoft has
gone a step farther (in fact, quite a few steps farther in quite a few
areas, but I'm confining my remarks to the topic at hand) with the .Net
platform, by making it possible to implement any programming syntax for use
with the .Net platform. In fact, there are at least dozens of language
implementations available for the .Net platform at present, if not scores of
them.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
John Salerno said:
Bear with me, but I've been reading a lot about how the .NET languages are platform independent,
and I assume this means a program written in C# can be run on a Unix or Mac machine. If this
assumption is wrong, then nevermind! :)

But if it's true, what will be necessary to run these programs on a Mac, for example? I know they
would need an equivalent to the .NET Framework, but does something like this exist yet, or is the
"platform independence" just a possibility at this point?

Apress has a book called
Cross Platform .NET Development - Using Mono, Portable.NET and Microsoft .NET
by MJ Easton and Jason King

They go into a bit of detail comparing what can and can't be done cross platform.
You can do an impressive amount cross platform.

They test everything on Windows, Mac, and Linux

Bill
 
...

[snip]
Both .Net and Java are platform-independent. However, you can only write
Java apps in one language - Java.

Well, that's like saying that you can only
write C# apps in one language - C#...
Microsoft has gone a step farther (in fact, quite a few steps
farther in quite a few areas, but I'm confining my remarks
to the topic at hand) with the .Net platform, by making it
possible to implement any programming syntax for use with the .Net
platform. In fact, there are at least dozens
of language implementations available for the .Net platform
at present, if not scores of them.

The JVM doesn't care what language you've written your program in.

You can write it in any language, as long as there's a compiler available
for it to create bytecode for the JVM.

You can take a look at these pages...

http://www.robert-tolksdorf.de/vmlanguages.html

// Bjorn A
 
Kevin Spencer said:
Is Java platform independent? .Net is built along the same lines. It is
compiled into byte code that is compiled at run-time to native machine code
by a virtual machine on the host. Now, both of these technologies require
something on the host, and that is the virtual machine to do the run-time
compilation.

There's a big difference, however: Sun support JREs on multiple
platforms, and have licensed the technology to IBM and others for other
JREs to exist.

The same is *not* to of MS, as far as I can tell. Yes, there's the Mono
project, but there's been no guarantee (as far as I've seen) that MS
won't sue companies who distribute Mono as part of their solution,
based on intellectual property infringements.

In addition, there are plenty of bits of .NET which aren't in the
specification for the base libraries. While Mono has ported many of
these bits, there are certainly bits missing. With Java, you're much
more likely to get things working on other platforms, IMO. Furthermore,
new features are likely to arrive on at least Windows, Linux and
Solaris at the same time.

All of this makes .NET an unappealing option for companies wishing to
release software on multiple platforms, unfortunately. MS is basically
in a difficult situation - do they want to beat Java, or do they want
to beat Linux? Supporting CLI platforms on Linux helps to beat Java,
but damages their efforts against Linux.
It's a common misunderstanding among people just getting acquainted with the
.Net platform to mix up platform-independence with language-neutrality.
These are 2 separate concepts. Both .Net and Java are platform-independent.
However, you can only write Java apps in one language - Java.

That's not true. There are *loads* of languages targetting the JVM.
Here's a list, which is probably not exhaustive:

http://www.robert-tolksdorf.de/vmlanguages.html
 
That's not true. There are *loads* of languages targetting the JVM.
Here's a list, which is probably not exhaustive:

I stand corrected. That's what I get for not paying attention to Java for
several years.
Sun support JREs on multiple
platforms, and have licensed the technology to IBM and others for other
JREs to exist.
The same is *not* to of MS, as far as I can tell. Yes, there's the Mono
project, but there's been no guarantee (as far as I've seen) that MS
won't sue companies who distribute Mono as part of their solution,
based on intellectual property infringements.

I doubt that the Mono project is working without Microsoft's knowledge and
consent. However, it would appear that Microsoft doesn't want anyone
indiscriminately to write a .Netimplementation for any OS. I doubt that Sun
does either. It wouldn't be logical to do so.

--

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
I doubt that the Mono project is working without Microsoft's knowledge and
consent.

MS certainly knows about Mono. As for consent? Well, they may have an
admiration for the team, I don't know - but they *haven't* stated that
they've checked for IP violations in there.
However, it would appear that Microsoft doesn't want anyone
indiscriminately to write a .Netimplementation for any OS. I doubt that Sun
does either. It wouldn't be logical to do so.

The differences are that:
a) Sun *do* licence the Java spec to other companies (eg IBM)
b) Sun offer their JRE on multiple platforms already.


The legal situation of running a JRE on Linux and Windows is a *lot*
rosier than the legal situation of running Mono on Linux and .NET on
Windows. There's also the technical aspect of things (the JRE has the
same codebase for both platforms, which certainly can't be said of Mono
and .NET.)

To my mind it's *currently* a no-brainer decision between .NET/Mono and
Java when it comes to cross-platform software for an ISV to develop. MS
could fix that fairly easily, but at the moment they're choosing not to
do so. Pity - I prefer C# to Java on the whole...
 
Cross platform I would look at Java or C++ with QT4 as the GUI. If you
can write
your algorithms in C++ then you can write a generic GUI in QT4 and
compile to
Unix, Mac or Windows.

Regards,
Jeff
 
Hi Jon,
The differences are that:
a) Sun *do* licence the Java spec to other companies (eg IBM)
b) Sun offer their JRE on multiple platforms already.

Well, Sun has had a good head start in that department. My experience with
Microsoft indicates to me that when Microsoft decides to compete, they do so
with a vengeance. I'm sure that you, like me, have had a good peek at what
Microsoft is working on for the near and far future. There are major
improvements in the .Net platform 2.0 compared with the 1.1 platform, which
was an incredible start. I've ben betting on Microsoft for over a decade
now. So far they haven't let me down. ;-)
The legal situation of running a JRE on Linux and Windows is a *lot*
rosier than the legal situation of running Mono on Linux and .NET on
Windows. There's also the technical aspect of things (the JRE has the
same codebase for both platforms, which certainly can't be said of Mono
and .NET.)

You seem to forget the recent debacle over the Microsoft JRE for Windows,
which resulted in a catastrophic absense of support for Java on Windows XP,
for most end-users. Again, I think that the legal issues will straighten
themselves out over time, and Sun has had a significant head start with
Java.

Ultimately, I don't want anyone to "win." I want everyone to win. Absolute
power corrupts absolutely, but competition is good for everybody. Let's hope
that the balance of power is maintained!
. Pity - I prefer C# to Java on the whole...

Same here. But I'm hopeful. As long as we keep participating in the process,
I think it will improve.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Kevin Spencer said:
Well, Sun has had a good head start in that department. My experience with
Microsoft indicates to me that when Microsoft decides to compete, they do so
with a vengeance. I'm sure that you, like me, have had a good peek at what
Microsoft is working on for the near and far future. There are major
improvements in the .Net platform 2.0 compared with the 1.1 platform, which
was an incredible start. I've ben betting on Microsoft for over a decade
now. So far they haven't let me down. ;-)

Sure, .NET is a great platform. That doesn't mean it's a viable one for
commercial multi-platform development.

Yes, Sun had a head-start - but they had a multi-platform strategy for
Java from the beginning. MS has had plenty of time to make in-roads
into a multi-platform story, but they haven't. That suggests to me that
they're just not interested in it.
You seem to forget the recent debacle over the Microsoft JRE for Windows,
which resulted in a catastrophic absense of support for Java on Windows XP,
for most end-users.

Only for those who didn't want to download Sun's JRE - which, I might
add, is smaller than the .NET framework, which ksimilarly needs
downloading if it isn't pre-installed. I don't think there was ever any
danger of there being *no* JRE available for Windows.
Again, I think that the legal issues will straighten
themselves out over time, and Sun has had a significant head start with
Java.

But MS has shown no interest in people developing CLI-based apps on
other platforms. Whereas with Java, Sun *couldn't* ignore Windows
because it's such a dominant platform in many areas, MS seems quite
happy to ignore other platforms as far as CLI-based development is
concerned. Indeed, it would be against their business aim of beating
Linux if they encouraged people to use a CLI implementation there. From
an ISV perspective, this is very disappointing, but I suspect there
aren't *that* many ISVs who absolutely have to have software running on
both Windows and Linux (or other platforms).
Ultimately, I don't want anyone to "win." I want everyone to win. Absolute
power corrupts absolutely, but competition is good for everybody. Let's hope
that the balance of power is maintained!


Same here. But I'm hopeful. As long as we keep participating in the process,
I think it will improve.

I think .NET and C# will improve as platforms, but I don't currently
see *any* signs that MS really wants to "solve" this issue for us. MS
has won back a lot of developers who moved to Java for its ease and
elegance despite only needing to run on Windows - I suspect they'd
rather leave it there and continue making *Windows* a better platform
to develop on than try to get people to use .NET/Mono on multiple
platforms.
 
I think .NET and C# will improve as platforms, but I don't currently
see *any* signs that MS really wants to "solve" this issue for us. MS
has won back a lot of developers who moved to Java for its ease and
elegance despite only needing to run on Windows - I suspect they'd
rather leave it there and continue making *Windows* a better platform
to develop on than try to get people to use .NET/Mono on multiple
platforms.

Microsoft doesn't exactly encourage support for other software and hardware
platforms. That is probably a competitive strategy, which may work well as
they have now embraced international standards. Still, the potential is
there, and I don't think Microsoft is DIScouraging it either. It would not
be good for them to do so, IMHO.

--

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Kevin Spencer said:
Microsoft doesn't exactly encourage support for other software and hardware
platforms. That is probably a competitive strategy, which may work well as
they have now embraced international standards. Still, the potential is
there, and I don't think Microsoft is DIScouraging it either. It would not
be good for them to do so, IMHO.

So would you be willing to risk your company being sued by Microsoft
for distributing Mono along with your app in order to run it on Linux?

That's effectively the question you have to ask yourself before talking
about .NET being platform-independent. In a commercial risk-averse
world, it isn't.
 
So would you be willing to risk your company being sued by Microsoft
for distributing Mono along with your app in order to run it on Linux?

No, but if I was in a position to, I would talk to my company about
partnering or making an agreement with Microsoft on such a project. In fact,
very recently, my company partnered with Microsoft on a project for the NASA
SATS program, which ended in May. It was both educational and enjoyable to
work with their consultants and dev teams, and I got a sneak peek at Indigo
about a year ago in the bargain. And I've made some lasting friendships.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Kevin Spencer said:
No, but if I was in a position to, I would talk to my company about
partnering or making an agreement with Microsoft on such a project. In fact,
very recently, my company partnered with Microsoft on a project for the NASA
SATS program, which ended in May. It was both educational and enjoyable to
work with their consultants and dev teams, and I got a sneak peek at Indigo
about a year ago in the bargain. And I've made some lasting friendships.

I think it's very unlikely to be a "go-er" in this kind of thing - MS
aren't likely to make concessions for companies who are developing on
Linux. Of course it partly depends on the size of the company too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top