Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How is java a software platform and is c one as well

 
Shridhar Raghavan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Sun states that java's as/w platform. Just wanted to clarify what's the idea behind this. And is C a s/w platform as well
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I don't think C-the-language is a software platform. The standard JDK includes everything necessary to develop complete applications. While there are C libraries that allow all of the same functionality, they're separate from the C environment itself.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Java™ includes tools for creating programs, compiler, run-time, etc. That is why it is called a platform. And I agree with David that C isn't a platform.
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Other languages also use the JVM - JRuby, Jython, Groovy, Scala, clojure, etc., etc., etc..

John.
 
Shridhar Raghavan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey David,
Thanks for the post. But you mind explaining your point as to why despite coming with libraries that almost achieve the same functionalities that the java core libraries, "why are these c libraries together with c not considered a platform". The point am thinking out loud is what's the distinction. Both languages come with a bundle of libraries.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The page you linked to actually does a decent job of explaining what is meant by "platform" in this context - it's the combination of cross-platform JVMs and cross-platform class libraries. That has two important consequences: 1) it's possible to write and compile code on one platform, and it'll run on other platforms, including the GUI parts, and 2) you can use other source languages -like the ones John mentioned- and compile them into code that is executable on the JVM.

As an aside, C does not come "with libraries that almost achieve the same functionalities that the java core libraries" - the standard C libraries are tiny compared with Java's. For example, no GUI functionality is included.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You compile C to native machine code, that runs directly on the microprocessor that you've compiled it for. In principle, you could write a C program that does not depend on any library at all (not even on the standard C library) - you can't do that with Java, because you always need the Java runtime environment (JVM + libraries) to run Java bytecode. When you write software in Java, it has to run on top of the Java runtime environment, so in that sense you could call it a "platform".

Ulf Dittmer wrote:As an aside, C does not come "with libraries that almost achieve the same functionalities that the java core libraries" - the standard C libraries are tiny compared with Java's. For example, no GUI functionality is included.

Indeed, the standard C library is very small and does not even include basic things like collection classes.
 
Shridhar Raghavan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yo. Alright taking into account Ulf and Jesper's comments, i guess the reason they called java a platform is the "cross platform benefit" and the "power packed libraries". A platform does not necessarily mean the ability to write s/w applications. Were that the case, every programming language would in essence be a platform. Guys let me know if i've missed anything.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have missed everything about what a "platform" is. It is complete and self-contained. That is why it can offer independence from the operating system.
 
Shridhar Raghavan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yo. Alright taking into account Ulf and Jesper's comments, i guess the reason they called java a platform is the "cross platform benefit" and the "power packed libraries". It is complete and self-contained. That is why it can offer independence from the operating system.A platform does not necessarily mean the ability to write s/w applications. Were that the case, every programming language would in essence be a platform.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper Young wrote:you can't do that with Java, because you always need the Java runtime environment (JVM + libraries) to run Java bytecode.

gcj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic