Slashdot Mirror


Fast, Open Alternative to Java

DrInequality writes: "For those of you out there who admire the portability of Java but want something faster or open source, the answer to your prayers is finally here. The Internet Virtual Machine is open source, fast and supports C, C++, Java and ObjectiveC. There are some cool demos for Linux (requires Redhat 6.0 or above, and OpenGL 1.2 or Mesa 3.41) here (1.5MB) and for Windows (requires glut32.dll, here) here (1.5MB)." We mentioned this last year; perhaps it has improved. I'm sure a lot of people would be interested in a language as portable as Java but speedier.

357 comments

  1. [insert scary music here] by laymil · · Score: 1

    No way...its too good to be true. something faster and more open but with the same functionality of java? awesomeness.

    1. Re:[insert scary music here] by jilles · · Score: 5, Insightful

      It's just C compiled to bytecode. It doesn't have most of the features that made Java popular (e.g. security, dynamicity, reflectiveness because inherent design decisions in the way C programs work inhibit this). In other words it is no replacement.

      Don't understand me wrong, maybe integrating such a thing with e.g. the gnu compiler would be useful. It would be great to create a single set of binaries and distribute them to the hubndreds of unix versions and other operating systems. But it has to be clear that this thing is orthogonal to java rather than the same.

      In any case, I'm not impressed and even bored. Java is a relatively simple language. Most of the language concepts are easy to grasp, even for novice programmers. Yet people keep comparing it to more primitive languages such as C and suggesting alternatives which are basically C++ improved rather than Java improved. After years of being confronted with a rapidly growing java community, even some C++ programmers begin to appreciate things like garbage collection (after having dismissed it for years based on performance concerns). However, beyond garbage collection they are still largely missing the point (i.e. C is not so cool after all).

      What I would like to see from the open source community (perhaps as a proof of concept) is a more ambitious effort, not just a (partial) duplication of features inspired by ignorance rather than innovation. Java has room for lots of improvement, lets set it as a baseline rather than a design goal. Duplicating all of Java's useful features should be a minimum requirement and not the ultimate design goal.

      This post is rather harsh, I know. However, I think this is a fundamental problem with open source in general and linux in particular: it's mass production of commodity software components (kernels, compilers, IDEs, word processors), not creation of new ones. If cutting edge technology is your thing, the propietary world is still the source of it (speech recognition, cool 3d technology, AI related improvements to user interfaces, compiler technology, languages, ...). It is very rare to see an open source project that does not just duplicate features but instead introduces radically new features and paradigms. There are some research projects that use open source to distribute their stuff but these generally play only a marginal role in the open source community. The big open source projects are all about duplicating and imitating the bigger/better (in most cases) propietary counterparts.

      In short I find the open source community boring & backwards. Its contributions are very useful and I use them on a daily basis. However, as a researcher I don't want to wait for thirty years to see things like OO being grudgingly accepted; I hate it when linux is advocated as a windows alternative when the people doing so largely fail to even realize why windows got popular in the first place. The same applies to Java and Visual Basic (yes, from the *evil empire* you understand me correctly). The features that made those things popular have yet to be duplicated. Effords like the one advocated in this article are just so backwards they only make me angry. Go do something useful! Don't waste your time figuring out how to reinvent the wheel, I already have half a dozen.

      --

      Jilles
    2. Re:[insert scary music here] by blkros · · Score: 1
      Thanks for this post. I'm kinda new to the programming stuff, and this clarified some stuff for me. I think that you pointed out one of the biggest problems in the open source community, and linux in particular. I think that in the next few months, or years, that this will be the big discussion in the open source community. Ie.--where are we going and why. It's already started as we can see from a few discussions from the past week. Are we going to reinvent the wheel over and over, or are we going to forge ahead and get on with the future? I think that the next year or so is going to define the open source community, even more than the last ten.

      --
      Damnit, Jim, I'm an anarchist, not a F@#$!^& doctor!
    3. Re:[insert scary music here] by Anonymous Coward · · Score: 0

      The complaint that open source only imitates but never innovates is either born of ignorance or deliberate astroturfing. If the former, do some investigation before demonstrating your ignorance for the world to see.

      Huge chunks of Unix were developed at Berkely as part of the BSD project long before the term "open source" was ever coined. This includes TCP/IP, the fundamental protocol of the internet.

      In languages, almost ALL innovation is open source. Java is an EXCEPTION and C# is not really anything new. Perl, Python and a raft of less well known languages all came from open source development.

      In operating systems technology, there are dozens of projects to build new and different operating systems in the open source world. Slashdot recently covered MenuetOS and LegOS.

      Hans Reiser's file system has several innovative twists and a vision of something radically better than standard Unix file systems.

      There are even attempts to reinvent the user interface with projects like Berlin.

      The fact that Microsoft opposes government funding of GPL software because it means they won't be able to take advantage of the "software ecology" is proof that even Microsoft thinks open source software creates innovations they need.

      Open source software does reimplement and imitate the functionality of closed products, but that's only because we need the functionality. Reinventing the wheel is an unfortunate necessity. And even with all the work going in to reproduction, there is still ample new and different work being done.

    4. Re:[insert scary music here] by jilles · · Score: 2

      Well, my complaint isn't that there aren't innovative projects (because there are) but that many self proclaimed OSS advocates are mainly concerned with reinventing the wheel and actually have a very conservative attitude towards anything new.

      Just to provide some opposition:
      ReiserFS. Check out Oracle's and MS plans to replace filesystems with databases. That is innovation, what Reiser does is just an admirable effort to duplicate the journaling feature invented by others.

      Berlin. This is a nice project, however, apple has a vector based (pdf) backend for their GUI in mac os X. That is what I call innovative.

      Perl, Python, Ruby, TCL, Java (the language, not the VM) are all variants of the same language constructs. Lots of syntactic sugar, good libraries. A lot of hard work went in them. But take a look at intentional programming from microsoft research or multidimensional separation of concerns tools from IBM and you will see my point because that is true innovation.

      Some of the stuff I mentioned is actually open source BTW but I'm not discussing the license but the process and the community instead.

      --

      Jilles
    5. Re:[insert scary music here] by Anonymous Coward · · Score: 0

      File system as a database is neither new nor innovative. Ask any AS/400 admin.

      Reiser is NOT just added journalling. Ext3 is, but not Reiser. Reiser's algorithms and approach to file system namespaces are not used in any other file system I know of.

      The PDF backend isn't a new idea either. NeXT had display postscript years ago.

      Regardless of how useful you think it might be, the Berlin project's native 3D interface is certainly a different twist.

    6. Re:[insert scary music here] by Some+Dumbass... · · Score: 1

      In short I find the open source community boring & backwards. Its contributions are very useful and I use them on a daily basis.

      Funny, I think you've got it backwards. You do realize that most of us aren't researchers (read: theorists) and mainly want useful software, rather than theoretically advanced software. I prefer performance to knowing that all the software I'm running is object oriented, and I prefer usefulness to originality, especially to that sort of excessive originality which leads to software which is useless :)

      Besides, the Open Source community strongly supports open standards. There's often a conflict between coding new concepts and sticking to the standards. If you're writing software for people to actually use, then the latter will usually win, especially since greater simplicity (for the sake of those who might want to hack the code) is often found in the latter case. That's why the Open Source community won't recreate Java. Whatever they make won't be a standard. (Of course, there's a next generation C++ with an ungodly name being developed right now, and I expect that Open Sourcers are working on that...) Like you said "Don't waste your time figuring out how to reinvent the wheel, I already have half a dozen."

      Of course, most of us want cars, not just a bunch of wheels :) We want tools to do whatever it is that we need to do. So while I understand why a software researcher would care about the originality of the ideas coming from the Open Source community, most of said community have totally different types of needs. At work, I want good stimulus-presentation software, or the tools to write it (for Psychology research). At home, I want the Radeon driver to improve. Either of these goals will be significantly held back by too much emphasis on theory.

      As a side note, I do work with some psychology researchers working in human interfaces and AI who are developing open source tools. Perhaps much of the theoretical development within the Open Source community is simply not as well publicized as the stuff IBM and Microsoft are working on? Theorietical research requires money, and two big sources of money are Corporations and Universities. Perhaps more Open Source research occurs at Universities, where the research is mainly publicized in academic journals?

    7. Re:[insert scary music here] by Anonymous Coward · · Score: 0


      "There is nothing new under the sun" and thats a quote from the Bible so its pretty old.

      I think you are being too pessimistic in your view of what is innovative. If you look at it all in an abstract way its "just" another OS or language or branch of mathematics or ...

      You do have a point though, but not overdo. Dunlop may have been just reinventing the wheel but air filled rubber tires are still a significant innovation.

    8. Re:[insert scary music here] by Anonymous Coward · · Score: 0

      but shit man, 'requires RedHat 6.0 or above'

      what a load of bollocks. Requires LINUX. Linux has just so gone GAY.

      BSD is the superior UNIX os.

  2. A fried of Mono? by Whyte+Wolf · · Score: 3, Interesting

    COuld this possibly be useful with Ximian's Mono project, or Gnu.NET? I could imagine using this as a VM for C# could seriously PO M$ :)

    --

    Beware the Whyte Wolf.

    With a gun barrel between your teeth, you speak only in vowels...

    1. Re:A fried of Mono? by Anonymous Coward · · Score: 0

      "With a gun barrel between your teeth, you speak only in vowels... "

      Plus h, k, g, etc.

    2. Re:A fried of Mono? by RevAaron · · Score: 2

      A quote penned by a retard, seeing how it's incorrect. If I said "Creationism is true in every and any sense of the word!" you could quote me- but that wouldn't make it any less incorrect, or you any less stupid.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    3. Re:A fried of Mono? by barneyfoo · · Score: 2

      Ximian isn't interested in staking new ground. THey want a sure thing. THey are a company in need of money. They want C# because they think it will be a new revenue source in which they can make a name for themselves.

      Java is full of weenies mark(et)ing their territory already. No room for ximian. Poor ximian, so badly in need of revenue. what for-ever shall they do? C# Ah yes. Ride on teh back of microsoft. maybe they are wiser than me, for I would be too scared. (offtopic, OSU was kicking tonight! I am so druNK! Fsxk me! hahahha ahahhahah. It aint the 4th biggest party school in the US for nothing!)

  3. I wonder... by L-Wave · · Score: 2, Interesting

    "Our vision is to bring the Internet Virtual Machine to the Internet completely, enabling video games, interactive entertainment, and applications to be operated from the Internet on your browser or television"

    I wonder how secure they expect this to be? I know I wouldn't want to run an Accounting program (or anything similar) via the internet. Does anyone have any experience with the code to share info?

    --
    I SURVIVED THE GREAT SLASHDOT BLACKOUT OF 2002!
    1. Re:I wonder... by small_dick · · Score: 3, Interesting

      In the future, there will be middleware.

      I don't know how else to put it. The laws, the technology...everything is going to middleware.

      Java, C#, this product...a better question is : how will i find apps that don't run off the internet?

      Answer: a computer museum. I'm totally serious.

      --


      Treatment, not tyranny. End the drug war and free our American POWs.
      See my user info for links.
  4. It crashes on RedHat Linux 7.1 by BlowCat · · Score: 4, Informative
    I downloaded the binary and it crashed on RedHat Linux 7.1 with all updates and kernel 2.4.9-ac10. It looks like that it's the library loader that crashes, because even ldd icvm dumps the core.

    Sorry, I have no time to download 23M of compressed sources to compile it. But if it crashes for you, you probably have to.

    1. Re:It crashes on RedHat Linux 7.1 by Anonymous Coward · · Score: 0

      It runs fine for me on Debian GNU.

    2. Re:It crashes on RedHat Linux 7.1 by MarkusQ · · Score: 2
      I kinda hate to say it, but a lot of stuff crashes under 7.1--at least, a dozen or more apps that ran fine under older RH (and seem to work fine on other distros) core dump. etc. on my RH 7.1 box. Mostly it's been glibc incompatibilities and such, but still rather anoying if you don't have the time to chase it down. So this may not be a problem with the IVM per se.

      -- MarkusQ

      P.S. Who the heck moderated the parent "offtopic"?

    3. Re:It crashes on RedHat Linux 7.1 by barneyfoo · · Score: 2

      Lol. And why do you think anyone on slashdot should care? Mmmm Beta software doesn't work for person X. Maybe I shouldn't try it. Yeah! Great, thanks for passing on the gewd wh0rd (goat speak - yes, I am durnk)!

    4. Re:It crashes on RedHat Linux 7.1 by Torp · · Score: 1

      It crashes on Slackware 8.0 too... since it was compiled for RH 6.2, and all the modern distros have much newer system libraries, it's not much of a surprise. Hopefully they will find the time to provide some binaries based on glibc 2.2 and the 4.1 X libs, at least if they want some good publicity... some don't have time, some don't dare, some won't bother to compile themselves.

      --
      I apologize for the lack of a signature.
    5. Re:It crashes on RedHat Linux 7.1 by BlowCat · · Score: 2
      Of course it's not a problem with IVM, if ldd crashes. ldd should never crash. It's a libc problem (or the kernel, but it's less likely).

      Sorry, I keep forgetting that an average /. reader cannot figure it out.

  5. Faster? by silicon_synapse · · Score: 4, Insightful

    Java is already comparable to C/C++ in speed. It has made a lot of improvements over time. I think the key to better speed now lies more in better code than in a better virtual machine. I can't see this gaining a significant acceptance. It'll probably do it's job well, but there needs to be some pretty compelling reason to move away from java.

    1. Re:Faster? by L-Wave · · Score: 1

      i would have to disagree, I have experince in all three languages, Java is no where NEAR the speed of C, java makes everything High level and must be run through in an interpreter in order to run (which is most of the slow down), with C, you have acces to many atomic actions and your code is much lower level (of course writing BAD code could give you the same speed as java...)

      Java pet peeves:
      no type defs
      to define a constant: public static final int foo;
      *I hate having to uyse parseInt to use an int.

      =)

      just my two cents all, not meant to be a troll,flame,whatever =)

      --
      I SURVIVED THE GREAT SLASHDOT BLACKOUT OF 2002!
    2. Re:Faster? by Anonymous Coward · · Score: 0
      parseInt to use an int

      Agreed. Don't forget you have to catch an exception that parseInt can throw, too :) But your other points are minor nuisances, not worth griping over.

    3. Re:Faster? by MfA · · Score: 1

      There are people left who dont use JIT's? (which is not an interpreter)

    4. Re:Faster? by spiro_killglance · · Score: 3, Informative

      Java is no where NEAR the speed of C, java makes everything High level and must be run through in an interpreter in order to run (which is most of the slow down).

      But if the interpreter is a highly advanced on
      the fly optimisating JVM like in Hotspot, you
      may well find its optimising your code to a native
      binary than you C compiler does. Have you tried
      Java 2, v 1.4 beta 2 yet?, a lot of Java slowness
      was not due to the JVM but due to badly designed
      I/O and String classes. Additions to Java 1.4
      add a Native Input/Output libraries for much
      faster access, and move powerful access such as
      mapping a Buffer to a region of a file.

    5. Re:Faster? by Waffle+Iron · · Score: 5, Insightful
      Java is already comparable to C/C++ in speed.

      Well, the actual situation depends very much on the abstraction level of the program being implemented.

      JIT compiled Java is kind of strange because it is competeitive with C++ at both low-level (bit banging primitives) and high-level (dynamically allocated objects). However, in middle ground (nontrivial objects that can be allocated solely on the stack), C++ blows Java away. This is mainly because all Java data that is not a local primitive variable must be dynamically allocated.

      As an example, one concept that is on the border between mid-level and high-level abstraction is strings:

      If you use C++ at a nice comfortably high level of abstraction (i.e., with some implementations of STL's std::string), it can be significantly slower than Java because of construction and destruction of every function parameter. OTOH, if you write your C++ program in a painstaking and dangerous C-like fashion (using one stack-based buffer for a string across many levels of function call), it can be an 1 or 2 orders of magnitude faster. If you bang on strings alot, a language like Perl can be a good choice because its mutable strings are more efficient than Java and safer or easier than C/C++.

      (Aside: In my experience, a rule-of-thumb is that most dynamic memory allocations in any language seem to take on the order of 1000 CPU clocks, and most dynamic "objects" end up consuming about 1000 bytes.)

      Of course, at the end of the day, all the issues that I just raised pale in comparison to the importance of the basic structure of your algorithms. If you feed in 50X times your expected load into your application, it will often slow down and/or eat memory in a spectacular fashion. By recoding to eliminating that problem, you can often make a "slow" language outperform "fast" one. This is often done by identifying the portions of your algorithm that depend on input size and perform worse than N*log(N) in space or time, then recoding them so they don't.

      The upshot: it all depends.

    6. Re:Faster? by eric17 · · Score: 2, Interesting

      Well I've never had a compelling reason to move TO java, so I think perhaps there is a group of people like me that have different needs than the group of people who find Java compelling.

      Perhaps Java is _too_ dynamic, _too_ simplified, and _too_ rigidly held by its creators for certain developers. On the other hand C++ is annoyingly crufty, but does let us do stuff that Java will not, and is not controlled by any one company. Java's design prevents many forms of optimizations, and there will always be programs that are impossible to write in Java with anything near C++ speeds. Java can beat C++ in some forms of code where its design does not prevent good optimizations. On the other hand there is a separate but smaller set of optimizations (and associated cruft) that C++ can't perform because of its forced compatability with C and old style linking.

      Perhaps IVM will allow someone to build a language that jetisons the cruft from C++ without removing the power, perhaps not. While the JVM design prevents this from happening, the IVM does not seem to prevent it, AFAICT.

    7. Re:Faster? by gawi · · Score: 1

      I like your comment because you are raising the importance of size and complexity of algorithms.

      A higher-level abstraction language, such as Java, allows easy replacements of the strategies. The operative word here is "easy". Although it's possible to implement cache, instance pool and threaded operations in plain old C, it's more complex than in C++ or Java.

      Since the most notable optimizations are done by changing algorithms, the "speed" of a language (what it means for you) should not be the primary criteria when choosing a programming language for a project. To speed, I'll prefer functionality, readibility, simplicity, safety and coherence.

      Personally, I'm sick of spending too much time on trying to figure out what that C++ compiler message means, what the semantic of that expression and how the linker will find that symbol. I prefer to spend my time on solving the real problem. For this reason, I choose Java for most of my projects. If I were programming games or math-intensive applications, that might be different.

      --
      All humans are mortal. Socrates is a human. Socrates is dead.
    8. Re:Faster? by quintessent · · Score: 2

      Have you ever programmed with swing? It's just painful.

    9. Re:Faster? by cabbey · · Score: 2

      That would just be because Swing is broken by design. It's terrifying to think that a bunch of unix geeks could come up with something that is just that horribly broken. If you want a snappy java gui just use the remnants of AWT and ignore all the deprecated warnings, or pick up one of the java to native widget libraries that are floating around the net.

    10. Re:Faster? by Anonymous Coward · · Score: 0

      People that know won't claim that java is faster than C. It can be competitive with object oriented C++ in some cases. It will never beat C/C++, but total cost is lower and ultimate performance is not always a requirement. You can always add more boxes with J2EE to scale. Hardware is cheaper than programmers.

      A monolithic C program is unbeatable by a higher level object oriented language for execution speed. Isn't there some law that demonstrates that? Assembler is even better. Low level languages sure are a bitch to maintain though. Especially if you inherit an 8 year old monster with lots of hardcoding that has been maintained by scores of programmers, some good, some not so good.

      I will take java/C++ ease of maintenance over that sort of mess any day of the week, up to 20% performance loss and all.

      l8,
      ac

    11. Re:Faster? by gss · · Score: 1

      Swing is not "broken by design", in fact it is designed rather well, model-view-controller is the way gui libraries should be implemented. That being said it isn't perfect but it's a 100 times better than the atrocity of AWT.

    12. Re:Faster? by Anonymous Coward · · Score: 0

      I was going to say this. Java and C++ are very close now in terms of performance - it's C that's hard to beat, thanks to the lack of abstraction that needs to be preserved in the language and compilation time. (Runtime type checking, etc...)

      Besides - how many developers write apps that need extremely high performance? The difference in most apps between Java and C/C++ is not even noticable to a human user - it's something that you can see if you do some kind of profiling, but in reality, you don't NEED to eek out every ounce of performance for most apps.

    13. Re:Faster? by MarkusQ · · Score: 4, Insightful
      ...if you write your C++ program in a painstaking and dangerous C-like fashion (using one stack-based buffer for a string across many levels of function call), it can be an 1 or 2 orders of magnitude faster...

      There is a general principle at work here: you can quite often go one or two orders of magnitude faster if you are willing to give up safety. It applies to everything from sex to ice hockey, and (viewed at the right level of abstraction) the results are always pretty much the same.

      -- MarkusQ

    14. Re:Faster? by kryps · · Score: 2, Informative
      How nice it may sound, some things in this comment are just not true:


      JIT compiled Java is kind of strange because it is competeitive with C++ at both low-level (bit banging primitives) and high-level (dynamically allocated objects). However, in middle ground (nontrivial objects that can be allocated solely on the stack), C++ blows Java away. This is mainly because all Java data that is not a local primitive variable must be dynamically allocated.

      Objects that are used only in the function in which they are created can be allocated on the stack if no references to this object are returned/passed as arguments. In fact recent VMs (Sun 1.3.1, IBM 1.3) do exactly that.


      If you use C++ at a nice comfortably high level of abstraction (i.e., with some implementations of STL's std::string), it can be significantly slower than Java because of construction and destruction of every function parameter. OTOH, if you write your C++ program in a painstaking and dangerous C-like fashion (using one stack-based buffer for a string across many levels of function call), it can be an 1 or 2 orders of magnitude faster. If you bang on strings alot, a language like Perl can be a good choice because its mutable strings are more efficient than Java and safer or easier than C/C++.

      Well that is what the StringBuffer class in Java is for. StringBuffers are very fast for this kind of thing. While I have to admit that Java immutable Strings make it easier for the developer too generate code which performs poorly it is well possible to produce (text processing) code which performs really well.


      Aside: In my experience, a rule-of-thumb is that most dynamic memory allocations in any language seem to take on the order of 1000 CPU clocks, and most dynamic "objects" end up consuming about 1000 bytes.)

      Your numbers are just wrong at least for recent Java implementations. Object allocation is very fast in languages using a generational garbage collector because allocating an object just consists of increasing a pointer by the size of the newly generated object. On the other hand the time needed for object deallocation has to be considered. The cost for deallocation is highly dependant on the number of live objects and the way objects are created. If the way objects are created is "compatible" with the generational GC (i.e. most newly created objects are short-lived) deallocation is very fast as well. Example: Object creation takes about 60 CPU cycles (JDK 1.3.1) on my Athlon 1200 if the objects are discarded directly after creating.

      I don't know where you got the "1000 bytes per dynamically allocated object" number from. In JDK 1.3.1 each object has an overhead of 16 bytes.


      Of course, at the end of the day, all the issues that I just raised pale in comparison to the importance of the basic structure of your algorithms. If you feed in 50X times your expected load into your application, it will often slow down and/or eat memory in a spectacular fashion. By recoding to eliminating that problem, you can often make a "slow" language outperform "fast" one. This is often done by identifying the portions of your algorithm that depend on input size and perform worse than N*log(N) in space or time, then recoding them so they don't

      With this I have to agree.


      -- kryps

    15. Re:Faster? by Anonymous Coward · · Score: 0

      hello? how is this score 3? the guy cant even type complete sentences and you believe what he says? "But if the interpreter is a highly advanced on the fly optimisating JVM like in Hotspot, you may well find its optimising your code to a native binary than you C compiler does." Parse that. But if the interpreter is (a highly advanced [on the fly *optimisating*] JVM like in Hotspot), you may well find (it is optimising your code to [a native binary] than you C compiler does). And don't get me started on the factual errors...

    16. Re:Faster? by X · · Score: 3, Insightful
      Some things you got wrong:
      1. All Java data that is not a local primitive variable must be dynamically allocated.
      2. Dynamic memory allocations in any language seem to take on the order of 1000 CPU clocks.
      3. Most dynamic "objects" end up consuming about 1000 bytes.
      1. I presume by this you actually mean stack allocated, as opposed to dynamically allocated (it's certainly possible to define statically allocated objects). While on one hand objects are meant to appear to be allocated on the heap, IBM has done a great deal of research on using linear analysis to allocate linear objects onto the stack. Works great.
      2. Allocations in the HotSpot VM can take only a few instructions, much like stack allocation. Unlike C++ you don't have a heap that you are constantly trying to keep balanced and unfragmented.
      3. Objects in Java are quite small. Indeed they have to be smaller than the 1K that you claim they need. Try allocating a million objects in a system with less than 1GB of memory. You'll find it works just fine. Again, with a compacting garbage collector, you don't have to worry about all the overhead associated with heap management which causes objects to be bigger than they need to be.

      It seems to me your programming prejudices are tied to experiences with C++. If you learn the Java paradigm better, you'll discover that a lot of the performance trade-offs you learned in the C++ world don't play out the same way in the Java world.

      --
      sigs are a waste of space
    17. Re:Faster? by mj6798 · · Score: 3, Insightful
      However, in middle ground (nontrivial objects that can be allocated solely on the stack), C++ blows Java away.

      What you are complaining about there is that a particular coding style you are used to from C++ doesn't carry over to Java. However, there are reasonable, alternative ways of expressing the same kind of code in Java. They aren't ideal (and Java isn't perfect), but they are workable.

      (Aside: In my experience, a rule-of-thumb is that most dynamic memory allocations in any language seem to take on the order of 1000 CPU clocks, and most dynamic "objects" end up consuming about 1000 bytes.)

      That may be a good rule for C++ (whose storage allocators generally have high overhead), but in a language like Java, a good implementation should have about one word of overhead for a large object and no overhead for small objects, and it should take about as much time as one store on average per word of storage allocated. The current JDK is a bit worse, but it still seems to beat most C++ allocators.

    18. Re:Faster? by mj6798 · · Score: 3, Interesting
      I have experince in all three languages, Java is no where NEAR the speed of C

      Sure it is, but it's harder than in C. Basically, in C, it's easy to write code that runs fast, but it's hard to write code that's correct and robust. In Java, it's easy to write code that's correct and robust, but it's hard to write code that runs fast. If you invest enough effort, you can write code that runs fast and is correct in either language. Which language makes the better tradeoff? 20 years ago, the choice was clearly C. On today's hardware, the choice is pretty clearly Java.

      [Java] must be run through in an interpreter in order to run (which is most of the slow down)

      Sun's JDK and IBM's runtime both are compiled implementations; they run Java at machine speeds, not interpreted.

    19. Re:Faster? by Anonymous Coward · · Score: 0

      > Java is already comparable to C/C++ in speed.

      First, there is no C/C++ language. There are instead
      C -and- C++, but they're totally different, despite the
      similar syntax.
      Saying C/C++ is like saying BASIC/FORTRAN.

      Java is actually much much much less performing
      than C (and much much less performing than C++:) by
      design. Maybe you compared a well written software
      in Java with some bad software written in C.

    20. Re:Faster? by Anonymous Coward · · Score: 0

      *I hate having to uyse parseInt to use an int.
      in oposite to 'atoi(..)'

      Although java is not as fast as C, it seems you
      are unaware of JIT's and the Hotspot technology
      which makes machine code on the fly. It certanly
      speeds up Java _very_ much compared to a traditional interpreter.

    21. Re:Faster? by Anonymous Coward · · Score: 0

      Amiga MUI. Nearly dead now, but sweet.

      *Step. Not dead at all, very sweet. You don't even have to learn ObjC anymore (not that that's hard), with Java bindings to MacOS X and Gnustep, and ruby bindings to GNUstep.

    22. Re:Faster? by Anonymous Coward · · Score: 0

      StringBuffers have synchronized methods that impose a serious overhead. StringBuffers are not very fast as compared to a custom StringBuffer-like class with no synchronization.

    23. Re:Faster? by fatmav · · Score: 1

      Am I running DOS so that I only have one task running at a certain moment, and now your app can simply suck up more CPU cycles than it really needs, and then claim it's waiting for me because I am a slow perk in typing? Well, that argument works in DOS age (or any non-multitasking environment).

      The fact that the user will probably not notice the performance lost due to lazy code is true only when you are talking about one task. But when there are more than one task running, it really adds up, even when those are just "constant speed slow down" (i.e. asymptotically the same but differs in a "small" constant). Just look at, urr, whatever you want to name here.

      I find it really annoying to hear programmers claiming their code only needs to be in "user speed" (being as fast as the user). That's not true at all these days. Any code, even the GUI code, should be _reasonably_ efficient or else I will only have to upgrade my CPU every year just because of lazy code.

      Sad.

      --
      // FIXME: put sig here
    24. Re:Faster? by Anonymous Coward · · Score: 0

      If you use the full MVC design style, yes. If you use the AWT style, no. In fact, it's MUCH nicer than using MFC.

      But I agree, the complexity of the MVC style is a real pita for small-size GUIs.

    25. Re:Faster? by Anonymous Coward · · Score: 0
      Well I've never had a compelling reason to move TO java.



      How about an increase in your productivity by a factor of 4? (Obivously, productivity depends on lots of things, but not knowing anything else, I think it's a reasonable estimate)



      Clearly, if all your projects get finished 3 months ahead of the deadline productivity doesn't matter that much, but how many projects are like that?

    26. Re:Faster? by greenrd · · Score: 2
      What's broken about it? They didn't do enough optimisation on it until this year (1.4), sure, but that's not a fundamental external API problem, just an internal design problem.

    27. Re:Faster? by Anonymous Coward · · Score: 0

      Rewriting less than 2% of our app in C, even with all the huge inefficiencies of JNI, netted us a 60% speedup. Anecdotal, yes, but far better than benchmarks from Sun or Javalobby...

    28. Re:Faster? by Anonymous Coward · · Score: 0

      Yes, writing little web apps in Java is certainly 4 (or more) times faster than doing it in C++.

      But now try to write a large software system, and you'll find yourself fighting with the garbage collector and wishing for a more powerful langauge.

    29. Re:Faster? by Anonymous Coward · · Score: 0

      "a bunch of unix geeks could come up with something that is just that horribly broken."

      Javasoft is technically part of Sun, but us Unix geeks here don't much associate with them. They're _ALMOST_ all idiots (with one or two exceptions).

      Don't believe me? Just pick 10 random .c files and 10 random .java files from the freely available JDK source, and read them.

    30. Re:Faster? by eric17 · · Score: 1


      How about an increase in your productivity by a factor of 4? (Obivously, productivity depends on lots of things, but not knowing anything else, I think it's a reasonable estimate)


      That would certainly be a compelling reason, if in fact Java was general purpose enough to work for the sort of applications I work on. I'm sorry, but for some applications a general purpose garbage collector does not cut it, and you need the speed of stack allocated and inlined array objects, and there are other issues.

      Basically, the lower level your coding needs are, the less likely you can use Java. And I'm not talking about kernel code, but the kind of basic building block code that is often built in user land.

    31. Re:Faster? by IkeTo · · Score: 1

      Safety comes from two things when programming: the language, and the programmer. Even when confronted with stack-based C-style strign, you can easily make things safe if enough care is taken.

      The difference is that C and C++ let you choose when you need safety from the language and when you need speed and thus safety from the programmer. Java dictates that you want safety from language and never speed.

    32. Re:Faster? by cabbey · · Score: 2

      AWT widgets map directly to the native widget sets for almost all platforms: Windows, Mac, Unix (Motif in many cases). This allows the windowing system to do all types of optimizations, and minimizes the complexity of the application, as well as the volume of information it needs to send to the display.

      Swing by contrast maps all the way to pixels within the JVM. This not only prevents the native optimized windowing system from having any advantage, but nearly always degenerates into full frame bitmaps being pushed for every refresh. While it is true that IBM is pushing a lot of performance tweaks into 1.4 to try and work around this, there really isn't any way it will ever catch up with awt.

      This is not a problem on windows where applications can get direct access to the hardware to push a pixel image down, but on most other operating systems this simply isn't the case. X is particularly hard hit in this, have a look at a swing application running under xscope to really see this.

      Java was promissed to be a platform independent environment, but it has become clear that Java's GUI team only cares about Windows. Sadly by the time this was discovered a lot of applications had already been coded and deployed. Within my company for example an entire toolchain was developed before anyone had discovered this, and the impact of widespread use on the network had been discovered. The result is that the large unix boxes that the applications are run on have been set up with VNC servers and the users have vnc clients on their thin client machines because it's compression and selective redraw logic does such a major improvement over raw swing.

      This is more than just an internal design problem, it's a core architectural issue because Swing was *intentionally* designed to work this way, doing all the widget rendering (and font rendering, and focus management, and ...) in the JVM so that it could present the same (bit for bit) gui no matter the platform. While they have reached that goal, it has been at a cost... while all java based applications can look and feel the same, it also means that none of them really blend in with the other applications on the system, infact they stand out as "differnet" and sometimes "broken" in the user reactions. An end user (who else are applications written for?) usually wants something that integrates with their platform, they don't care what we used to implement it. This is why I say swing is fundamentally flawed by design, unfortunately most of AWT has been deprecated.

    33. Re:Faster? by cabbey · · Score: 2

      From a UI designer perspective I fully agree with you; however, that wasn't what I was talking about.

      The front end of swing is nice, but the backend behind it is FAR worse than AWT, and unfortunately, because of the other promises swing made about having the same user impression no matter the platform means that there really isn't any other option.

    34. Re:Faster? by cabbey · · Score: 2

      Actually I've seen the parts that *aren't* freely available and dealt with the so called "support" organization they put together, so I know you're being polite in your understatement. ;)

  6. java is not slow by Anonymous Coward · · Score: 1, Informative

    Java is not considered slow anymore.

    For numerical computation it rivals C/C++ and can be faster in some cases.

    JDK 1.4 (now in beta) addresses scaleable I/O.

    The graphics pathways to the video card are not as optimized as could be but it is improving in JDK 1.4.

    GUI apps are generally OK on (what is now) low-end hardware. However, becoming an effective GUI/Swing programmer is more involved than most people would like to think. However, writing high-performance and bug-free GTK/C code is no easier.

    1. Re:java is not slow by WildBeast · · Score: 1

      Oh you're right it's not slow at all. Just how many OS's have been written in Java? One?

    2. Re:java is not slow by Outlet+of+Me · · Score: 2, Informative

      As a person who works with the internals of a Java Virtual Machine day in and day out, and a user of Java applications, I have to say Java has some ways to go before it matches C in all aspects.

      I submit this example: Forte is a Java application, and I recently saw it being run on a 700MHz PIII machine with 256MB RAM. It literally crawled on bootup, and the performance at runtime was not on par with other non-Java GUI apps.

      Now true, I would love for Java to match C performance-wise (would make my job a lot easier :-), but there would be a lot of value in something that could compile C to a platform-independent format that would execute at native C speeds.

    3. Re:java is not slow by Anonymous Coward · · Score: 0

      - It literally crawled on bootup
      Boot up your dumb ass off campus!! Why don't you literally dumb ass! You're literally fucking hen's teeth.

    4. Re:java is not slow by RoninM · · Score: 1

      This is the benchmark you're going to use for speed? Whether people have written an Operating System in it or not?
      I suppose, then, that C++ is moderately slow, C is very fast, and assembly has been getting really slow as of late?

      --
      If a corporation is a personhood, is owning stock slavery?
    5. Re:java is not slow by Anonymous Coward · · Score: 0

      Well, comparing KDevelop and Netbeans on my system (900 mhz athlon, 512mb sdram) is not really favourable to kdevelop...

      Kdevelop has a subset of the netbeans functionallity and still it's dog slow after startup in comparison (takes a loooong time for caret to update in code-writing, menus are slow etc. etc.)

      They only time kdevelop beats netbeans in speed is in startup -
      netbeans: 18 s
      kdevelop: 11 s

      startup occurs once (or mayby twice) a day - caret, menu update occurs a day.

      Judge yourself if netbeans (written in java) is slow compared to an equivalent (native) program.

      just my 0.02 euro's

      (pardon my bad english)

    6. Re:java is not slow by Anonymous Coward · · Score: 0

      I wrote one a year or so ago... I don't know if it works though, because I'm still waiting for it to boot.

    7. Re:java is not slow by egomaniac · · Score: 2

      I submit this example: Microsoft Word is a C++ application, and it sucks ass on a 700MHz PIII machine with 256MB RAM.

      The fact that a particular program runs poorly is not an indication that the language in which it is written sucks. I get great performance out of Java. (And, Forte runs fine on my 128MB 400MHz PII, but I'm not going to argue with you about that...)

      --
      ZFS: because love is never having to say fsck
  7. DotGNU by bstadil · · Score: 4, Insightful

    The DOTGNU guys has already looked at it. From Carsten Kuckuk via the MAilinglist

    Quote

    I printed out the spec last night and read it on the commuter train back
    home. The IVM team essentially created a specification for a Motorola 68000
    like 32 bit processor, assigned 16 bit opcodes to instructions and
    implemented an interpreter for it as well as an adoption of the gcc
    compiler.

    Advantages:
    + Portable
    + It works
    + Very fast

    Disadvantages:
    - No separation of data and code
    - Interface to the underlying operating system is POSIX
    - No built-in security, not even a sandbox

    My assessment:
    o Good piece of Engineering: It's there, it works, it solves a problem, it's
    GPLed, it's tested.
    o In order to be used as one of the VMs for DotGnu, security needs to be
    added. As one of the rules in secure programming is that you can never add
    security to a system, but that it needs to be designed into it, I don't know
    if that is possible.
    o For my personal taste it's too close to real untyped assembly language.

    Carsten Kuckuk

    Unquote

    --
    Help fight continental drift.
    1. Re:DotGNU by lostguy · · Score: 1

      Disadvantages:
      - No separation of data and code

      He must have accidentally put this under "Disadvantages" instead of "Advantages".
    2. Re:DotGNU by high · · Score: 1

      Ehm? What? Separation between data and code must be an advantage, such as in XML/XSL. Right?

    3. Re:DotGNU by Anonymous Coward · · Score: 0

      Sigh. We're talking about low level virtual machine ISAs here, not high level text processing.

    4. Re:DotGNU by pohl · · Score: 1

      True, the analogy was faulty, but the point remains that a separation between data and code at the VM level is the best way to prevent someone from executing some malicous data, isn't it? This is pretending to be an "internet" VM, so some basic security-related architectural ideas are to be expected.

      --

      The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...

  8. Four 32-bit integer registers? by idiot900 · · Score: 2, Insightful

    Looking at the description of the VM, I see only 4 general-purpose 32-bit integer registers - which seems like a rather shortsighted limitation to me. Seems like this VM is designed to be easily dynamically-translatable to x86 code - but there are plenty of other (better designed) architectures with more registers that IVM could target...seems like a waste to me.

    This is a neat idea - but isn't this essentially a clone of what Amiga's been doing with their universal VM?

    1. Re:Four 32-bit integer registers? by b0rken · · Score: 3, Insightful

      That's right -- the "internet virtual machine" seems designed to map well onto a single CPU, the x86.

      The standard library seems designed to map well onto a single OS, Unix.

      You can run it on your big fancy RISC machine (well, if they've gotten around to writing a stable back-end), but it'll still approximate the performance of a register-emasculated ia32 processor.

      It's a bit more portable than an Linux ELF binary, but not much. And about as revolutionary, given that a Linux runtime also exists on the modern BSDs (for example)

      --
      Hate stupid software on freshmeat? Laugh at
    2. Re:Four 32-bit integer registers? by Russ+Steffen · · Score: 3, Insightful

      Why even bother with registers at all? Hardware CPU's use registers as because they are bits of faster memory, but that isn't necessary in a pure virtual machine. Unless you're trying to model a real CPU, why screw up the acrchitecture with unnecessary registers. Just have it do everything on the stack. In an all software VM, regsiters buy you nothing but unneeded compiler complexity.

    3. Re:Four 32-bit integer registers? by Cassandra · · Score: 1

      Unless you're trying to model a real CPU, why screw up the acrchitecture with unnecessary registers. Just have it do everything on the stack. In an all software VM, regsiters buy you nothing but unneeded compiler complexity.


      But almost all java VMs compile to native code (JIT VMs). When you are going to run your programs on a real CPU, it would simplify things a lot for a JIT to be able to map JVM registers to real ones.

    4. Re:Four 32-bit integer registers? by b0rken · · Score: 1

      On the one hand, a register-based VM can have lower (virtual) instruction counts, since
      add r1, r2, r3
      would be
      load r2
      load r3
      add
      store r1
      in a stack-based machine.

      On the other hand, it doesn't really help to have registers in the virtual instruction set, because the targets all have different register counts---For instance, none on a stack machine, 8 registers on x86, ~32 registers on many RISC, ~128 registers on ia64, ~16 registers on x86-64 (and the number of floating-point registers is similarly variable)

      So you can pick a stack-based vm and let the native code translator optimize stack actions into register actions (not hard) or pick a large enough number of registers in the virtual instruction set that code will typically never spill registers to the stack (say, 1024 registers) and let the native code translator optimze register actions into spill-fill operations (not hard)

      *OR* you could pick a number of registers that is small enough to require spill-fill in the virtual machine code, because that makes it easy to write the translator for one of your architectures (x86) at the expense of either performance in other architectures (Only using 4 of your 128 integer registers?) or complexity there (turning memory operations into register operations is a tougher problem than either of the alternatives I presented above---GNU Lightning, upon which I believe IVM may be based, doesn't do it)

      --
      Hate stupid software on freshmeat? Laugh at
  9. What about C#? by tshak · · Score: 3, Offtopic

    What about C#? Many Java and anti-Java advocates have come to a common ground that C# is a great language. It's fully OO and very easy to code in. MS has submitted the spec to the ECMA, so isn't this possible?

    --

    There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    1. Re:What about C#? by Anonymous Coward · · Score: 0

      C# isn't cross-platform compatible. Java is. Deal with it.

    2. Re:What about C#? by tshak · · Score: 1

      Could someone _please_ explain to me how this got modded as a Troll???

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    3. Re:What about C#? by Graymalkin · · Score: 2

      If Microsoft submitted it to the EMCA that means the GCC folks can compile it. Whether or not you can use Microsoft's libraries has nothing to do with whether or not it's portable.

      --
      I'm a loner Dottie, a Rebel.
    4. Re:What about C#? by Anonymous Coward · · Score: 0

      Well, the usability ends up in the trashcan if you don't run it on a Microsoft OS. COM is nifty stuff, and C# is just Java without the huge library if you can't use COM. And last I checked, Microsoft OSes cost a bloody fortune to license, so C# is right out for embedded apps, which will be flooding the market by the BILLIONS in the next few years. Make PCs look like small change. And Windows licensing fees are a bitch.

    5. Re:What about C#? by Bob+McCown · · Score: 1
      A moderator with cranial-rectal inversion[1], I believe.

      [1]also known as 'head-up-ass syndrome'

    6. Re:What about C#? by Anonymous Coward · · Score: 0

      >If Microsoft submitted it to the EMCA that means the GCC folks can compile it. >Whether or not you can use Microsoft's libraries has nothing to do with whether or >not it's portable. > Nobody really gives a shit if Microsoft submitted C# to the EMCA. Get over it.

    7. Re:What about C#? by WildBeast · · Score: 1

      Let's see hmmm, it's slashdot. MS = Satan.

    8. Re:What about C#? by Waffle+Iron · · Score: 2

      Could someone _please_ explain to me how this got modded as a Troll???

      Probably because they said "C# is a great language". The adjective "great" is so overused in MS literature that the original poster is obviously a paid MS shill. A genuine /. complement would have said something more like "I ported all of emacs to C# in 3 days and it's rock solid running on my Amiga and BeOS boxen".

    9. Re:What about C#? by Graymalkin · · Score: 2

      You dumb piece of horseshit. If a language is posted for standardization that means anyone can write their own compiler and distribute it without paying royalties. It isn't a technical hinderance but a legal one. Why don't you think before you write dickhead.

      --
      I'm a loner Dottie, a Rebel.
    10. Re:What about C#? by WasterDave · · Score: 2

      Couldn't agree with you more. It's a good language, Microsoft invented it, nobody uses it. So bite me, no troll here.

      Dave

      --
      I write a blog now, you should be afraid.
    11. Re:What about C#? by Graymalkin · · Score: 2

      I didn't say it was useful for anyone but Microsoft for fuck sake. Can you fucking read? I was responding to the glaring inaccuracy of the guy's statement. He berated the original poster saying C# was some sort of magical Microsoft-only language which it isn't. Besides, the entire reason for Mono (Ximian's .NET runtime) is to run .NET apps open source style. So your C# apps don't end up in the shitcan if you're not using a Microsoft OS. Jesus man get the net.

      --
      I'm a loner Dottie, a Rebel.
    12. Re:What about C#? by tshak · · Score: 1

      Well, I'm the MS Shill you speak of. I don't work for MS, and they sure don't pay me to say anything. I've been doing Perl, Cold Fusion and Java for the majority of my career and excuse me for being honest about a "GREAT" technology rather then being an anti MS zealot.

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    13. Re:What about C#? by tshak · · Score: 1

      Uhm, whoever thinks C# is useless without COM is uninformed. C# only support COM for backward compatibility, and derives it's real power from the .NET platform libraries, that are part of the CLR, which is also being submitted to the ECMA.

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    14. Re:What about C#? by quintessent · · Score: 1, Troll

      This is Slashdot. Only anti-Microsoft posts are allowed.

    15. Re:What about C#? by MonkeyMAN · · Score: 0

      Hey CockMeister, remember Rambus, Unocal, etc.?
      How bout you shut the fuck up.

    16. Re:What about C#? by Waffle+Iron · · Score: 2
      Don't worry, I was employing irony.. (noun: the use of words to express something other than and especially the opposite of the literal meaning)

      Except about the word "great"... Microsoft's overuse of the word has almost ruined its meaning for me. I can't read it without seeing an image of Bill Gates.

      (Actually, I haven't used C#, but it looks reasonable enough. The main problem I see with it from looking at MS example snippets is that this "attribute" stuff tacked into the syntax to do COM stuff seems to be out of control. A couple of examples I saw had more of that in it than real code.)

    17. Re:What about C#? by DahGhostfacedFiddlah · · Score: 1

      "Teach a man to hit himself on his head with a fish, he'll have a headache for the rest of his life?"

    18. Re:What about C#? by tshak · · Score: 1

      Attributes, although useful for COM interopability, are an elegant way to describe MetaData, and are definatly not "out of control".

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    19. Re:What about C#? by Anonymous Coward · · Score: 0

      Only parts of the .NET platformm are being submitted - parts that are the equivalent of NON-GUI java functionality. Thus, C#/CLR is useless on non-windows CLIENTS. Java has saturated the enterprise server market, and more and more client applications are appearing. The partial submissionof the .NET classes is designed to both attack java on the server side (non-GUI), and fend off encroaching java on the client side by preserving the desktop GUI monopoly.

      JAVA DOES NOW EVERYTHING THAT MS SAY .NET MIGHT ONNE DAY DO!

    20. Re:What about C#? by Anonymous Coward · · Score: 0

      ECMA standardisation is really irrelevant. Java is available from multiple competing vendors, now, and the language is standardised in freely available documentation - GCC ALREADY COMPILES JAVA, and to native code, too, for example.

      I'd rather have a non-ecma-standardised multiple-vendor language than an ecma-standardised single-vendor one. There's no pressure for that single vendor to stick to the standard, or to limit themselves to that standard. And MS-dialect ECMAScript, even in the presence of other implmentations, has managed to deviate, simply by making all the APIs it addresses non-standard (MSDOM, MSXML, etc).

    21. Re:What about C#? by bvankuik · · Score: 1

      You know how that company is like. No, it isn't possible, IMHO.

    22. Re:What about C#? by Anonymous Coward · · Score: 0

      Prolly because most people on this site are so biased towards their linux and/or bsd boxes and only think that MS is the root of all evil...

      I have nothing agianst MS. I think they have done a brilliant job in brining low cost computer system to the computer illiterate.

      Just because these machines might not suit other peoples tasts or that they crash a lot does not mean that bill is satin. They are good for beginer Users... Greate Infact... Their a Peice of piss to install and have a greate suit of applications, which linux doesnt realy have yet. :P

      And before you ask, yes im a linux and BSD user, infact i plan on experimenting with lots of OS's. I beleive we can survive with more than just one OS int he market. Once day OS's will be specialised but all have some software due to java or someother javaIdea. (AmigaDE :))

    23. Re:What about C#? by Mekanix · · Score: 1

      Ahem, Amiga and BeOS are neither Linux, GNULinux or GPL'ed. Thus any /. posts would automatically get modded down.

      Only nonGPL'ed system that would get modded up would be PlayStation since those really nice chaps at Sony is sooo communityfriendly and lobbying fiercely against all those draconian laws.

    24. Re:What about C#? by tshak · · Score: 2

      But they also submitted the CLR - doesn't that contain many of the essential libraries?

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    25. Re:What about C#? by Anonymous Coward · · Score: 0

      Actually we are porting all our Java to C# and getting rid of Sun in our shop. 100% Java Free!!!!

    26. Re:What about C#? by Anonymous Coward · · Score: 0
      Java is trash. Get the 100% Java Free logo
      • here
    27. Re:What about C#? by tshak · · Score: 1

      Great, now it's "offtopic". We are talking about languages for an Open Source VM. How can this be offtopic? I hope the meta moderators deal with this one fairly.

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    28. Re:What about C#? by Anonymous Coward · · Score: 0

      Java isn't "cross-platform compatible" [sic] either.

      If I write some java code, it will run on exactly ONE platform; the java platform.

      If I write for x86/Win32, my code will run one exactly one platform, even if you write an emulator for it that runs on other platform (perhaps utilizing JIT compilation for speed). And the x86/Win32 code will run natively at least one place, as opposed to java which runs natively nowhere.

    29. Re:What about C#? by Anonymous Coward · · Score: 0

      Correction: they submitted CLI, not CLR. CLI is a subset of the CLR.

    30. Re:What about C#? by tshak · · Score: 1

      You're correct. Please post as a real person though so that the rest of us can enjoy your posts.

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    31. Re:What about C#? by quintessent · · Score: 2

      Oops. That was an anti-Slashdot post. Here: Microsoft Sucks!

    32. Re:What about C#? by Anonymous Coward · · Score: 0

      I want a civilization in which ego-free debate is the norm, where unpopular ideas can easily be voiced and judged because nobody is scorned or punished for having held them. Your bigotry is contemptible.

    33. Re:What about C#? by 11223 · · Score: 2

      Really? Every term I hear "great" I see this puke-inducing image of Steve Jobs shouting "Insanely Great!"

  10. Re:As open as this? by asbestos_diaper · · Score: 0

    That would be open sores.

    --

    Visit me online.

  11. C++ vs. Java all over again. by under_score · · Score: 3, Insightful

    Okay - this is a "religious" issue. Building and promoting for C++ works up to a point. But the fact is that C++ and Java are both industrial strength languages (especially if you consider their libraries and tool support). It seems that the IVM does C++ "natively" but requires an extra step for Java etc. Why? Can't it just figure it out from the context? The file extension? The syntax? This IVM seems to be a pretty cool idea. Not new, but cool (IBM's UVM). I like the fact that they bothered with Objective-C (although that might just be because I believe the GNU GCC supports it).

    1. Re:C++ vs. Java all over again. by Malcontent · · Score: 2

      Actually there is something called internet c++ I haven't played around with it much but it sure looks interesting. Does anybody have any experience with it? It looks like a pretty good idea.

      --

      War is necrophilia.

    2. Re:C++ vs. Java all over again. by Dixie_Flatline · · Score: 2

      Objective-C has been supported by GCC for a long time. In fact, the NeXT Obj-C compiler was a hacked up version of GCC.

      In any case, I think Obj-C support was added because Obj-C is finally being used again. With OSX, Obj-C is seeing a small resurgence. It's about time.

  12. Execute cross-platform code with native speed by goingware · · Score: 2
    If you'd like to execute your code with native speed on any platform from a single sourcebase, why not use a cross-platform application framework?

    Here is a list of many application frameworks, many of which are cross-platform, and many of which are free software.

    My favorite is ZooLib, a multithreaded C++ framework.

    Read about the importance of cross-platform application development.

    --
    -- Could you use my software consulting serv
    1. Re:Execute cross-platform code with native speed by iapetus · · Score: 2
      If you'd like to execute your code with native speed on any platform from a single sourcebase, why not use a cross-platform application framework?

      Because then you either have to recompile for all platforms and provide binaries for all of them (along with suitable installation instructions/programs) or you have to make your source available. The former is a pain, since the whole aim of writing truly cross-platform software is that it can run on any platform, not just those you happen to have development tools for. The latter may not be desirable (not all software is open source, you know) and causes hassle for people who don't feel they have the skill to compile code from source and install it.

      Well, you asked...

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    2. Re:Execute cross-platform code with native speed by Anonymous Coward · · Score: 0

      You speak as if Java allows you to just write the code once and ship it to all your customers. Where I work, we won't support our app unless you run it on one of our tested platforms, using the same JVM we tested for that platform. We had far too may support calls due to different VMs having different bugs. You may be the last person on this planet to learn that WORA (in java at least) is a complete myth for non-trivial software.

      "The latter may not be desirable (not all software is open source, you know)"

      You could distribute your app as "shrouded source" which is just machine obfuscated source code. Its FAR harder to read than decompiled Java...

    3. Re:Execute cross-platform code with native speed by iapetus · · Score: 2
      You may be the last person on this planet to learn that WORA (in java at least) is a complete myth for non-trivial software.

      Complete myth? Hardly. Many programs (the majority of real-world code IME) will work straight off. Of course if you're going to have to support it, particularly under heavy use, then you'll expect people to be using it with a specified and tested JVM and platform. They call it WOTE for a reason, you know. ;) And unless you're utterly insane the same is true for cross-platform libraries of any level of complexity. If I tested my program with FooLib 1.2 on Red Hat then I'm not supporting you using FooLib 1.3b on OS X.

      Java does allow you "to just write the code once and ship it to all your customers", provided you make it clear that the only supported versions are the ones you've tested against and they run it on other versions/VMs/platforms at their own risk. And anyone who needs to run it on a different platform will be able to, and 99% of the time it will work just fine provided the code was well written in the first place. The same can never be true of binary distributions using shared libraries.

      Of course WORA doesn't work perfectly - it's one of the first things I point out when teaching Java. But you seem to be painting a picture of a world where Java code needs to be carefully targetted at particular platforms and will fall over if you try to run it elsewhere, and that's even further from the truth.

      You could distribute your app as "shrouded source" which is just machine obfuscated source code.

      Which does nothing for those users who aren't happy recompiling from scratch, and doesn't do much to appease the boss/lawyers/project manager who is hung up on the idea that it's a bad plan to let customers see our source code in any form.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
  13. MacOS X Version by MissMyNewton · · Score: 1
    On the site, I saw specific references to Objective C and also Open GL.

    Does this imply a MOSX version will be forthcoming? Am I reading into this? (Wishfully?)

    Anyone know? Or better yet point me to more FM? I'm glad to read - align my eyeballs as needed! ;-)

    --

    ---

    Information wants...you to shut your pie hole.

    1. Re:MacOS X Version by Anonymous Coward · · Score: 0

      Unfortunately, MacOS X is closed source. It would be very difficult to seamlessly integrate it into the MacOS X proprietary GUI.

    2. Re:MacOS X Version by JasonAsbahr · · Score: 1

      And Windows is open source?

    3. Re:MacOS X Version by kiwipeso · · Score: 0

      If you've got OS X, you should have the system's developer tools anyway.
      They do Obj C & OpenGL just fine.

      --
      - Kaos games and encryption systems developer
  14. Portable? Fast? by spiro_killglance · · Score: 1

    At present it only runs on Windows X86 and
    Linux X86, thats doesn't sound very portable
    to me.



    The OpenGL support is nice, and might even
    make it useable for 3D games.


    The Virtual machine doesn't support JIT
    compilation, so i can't see how this can ever be
    better than advanced JVMs like Suns Hotspot. They claim there CISC VM is so fast it doesn't need a JIT, i find this very unlikely, benchmarks please.


    Threading and SMP support was not mentioned can
    IVM handle these yet?


    A C/C++ compiler is not available, only Java
    and Objective C (both missing libraries), i've never
    tried Objective C (what are its pros and cons), so can't comment on it, but if your programming
    in Java you might as well use the Java virtual
    machine instead of this one.


    All in an interesting project, that might become
    a useful programming tool, but not for another
    couple of years.

  15. Some numerically intensive demos would be nice by strags · · Score: 1

    Unfortunately, although the GL demos look nice, they don't really reveal much in terms of performance speed. In particular, demos like "gears" do very little CPU work.

    Although the idea may be sound, also, I suspect they're going to have a great deal of difficulty achieving the necessary momentum to attract developers, particularly without a solid GUI framework, and such sketchy documentation.

    (Besides, everyone and their dog has written a PlayStation emulator by now - if you just want browser games based on a common development platform, why not use those :)

  16. I would like the other-way-around by davidmccabe · · Score: 1

    Personaly, what I would like better then C++ in a VM is something with Java-like syntax which runs natively. What if we had I langauge ( I'd call it 'Z' ) that was as fast as native C++, yet had the easy syntax and object-orientedness of Java? Of course, it would have to be open to be really perfect. And it would be able to access C++ APIs, so that we could use it with OSs and libraries for which no one has yet writen 'Z' API headers..

    1. Re:I would like the other-way-around by davidmccabe · · Score: 1

      That's great! How do I use it?

    2. Re:I would like the other-way-around by Per+Bothner · · Score: 1

      I have just the thing for you. It is called GCJ. It has Java syntax and the core Java libraries, it runs natively by being compiled with GCC (though a VM is also available) and CNI is a very convenient way of accessing C++ APIs.

    3. Re:I would like the other-way-around by j7953 · · Score: 2

      There is nothing that prevents you from compiling a software written in Java (the language) to something else than the Java VM (Java the platform). Doesn't the latest release of gcc even include a Java-to-native compiler? I don't know how much of Java (the class library) is supported then, though.

      Almost no language has any features that tie the language to a single platform exclusively. This includes Java. You could even support operating system functions in Java by writing an appropriate library. That library would likely not be compatible with the Java VM, but if you don't target that platform anyway, who cares?

      One problem with Java, I think, is that Sun has marketed "Java" as a programming language and never made any real difference between Java the language, Java the platform, and Java the library. What they should have done, IMHO, is to release the Java VM and the Java class library as one product, and make the Java the language a seperate product that happens to support the Java VM as a target platform. That's essentially what Microsoft is doing with .net -- there is the .net platform, which is basically a bytecode ("intermediate code") format and a class library, and there are the programming languages that support the .net platform, including a new language (C#).

      --
      Sig (appended to the end of comments I post, 54 chars)
    4. Re:I would like the other-way-around by Per+Bothner · · Score: 1

      You follow the links I provided. Short answer:
      gcj -g -O -o foo --main=Foo Foo.java
      ./foo

    5. Re:I would like the other-way-around by davidmccabe · · Score: 1

      Exuse me. I was refering to the first message posted, which refers to "HotSpot" and provides no links.

  17. C++, Java and Objective-C by under_score · · Score: 2

    I have used Java and Objective-C professionally in a very extensive manner, and a little bit of C++. I think they are all great, but I feel more friendly to Objective-C :-) It is great to see that the IVM people have bothered with it. It would be really fantastic if they made it so that you could inline any language inside any other. The big difficulty with this is that the three languages (C++, Java, Objective-C) have fundamentally different ways of "implementing" objects, particularly method calls, but other aspects as well. Objective-C provides more flexible run-time typing and meta-class objects. Java has decent security, exception and threading built in (decent, not great). C++ has operater overloading, friends, etc.
    Check out my Courselet: Architectures with XML Documents

    1. Re:C++, Java and Objective-C by Leeji · · Score: 1

      The problem with embedding multiple languages in the same source is that you'll never know to call startupMeUp() or BPtrStrCrash()! C/C++ style coding conventions make me want to puke!

      --
      It all goes downhill from first post ...
    2. Re:C++, Java and Objective-C by Malcontent · · Score: 2

      You bring up an intersting point. How fast is objective C and why aren't more people using it?

      --

      War is necrophilia.

    3. Re:C++, Java and Objective-C by bnenning · · Score: 2

      Fast. Method invocations take (I think) about 3 times longer than normal C function calls, and if that becomes a problem in a tight loop (which is rare) you can cache the function pointer for a method and use it to bypass the dynamic lookup. Unfortunately Objective-C mostly got overlooked due to the momentum of C++, but hopefully Mac OS X and GNUStep can change that.

      --
      How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
    4. Re:C++, Java and Objective-C by Thing+1 · · Score: 1
      It would be really fantastic if they made it so that you could inline any language inside any other.

      Check out BlueBox , a system designed to do just that.

      The developers are writing "words" for many different languages; they currently have syntaxes written for Python, Java, C++, Perl, and are working on more.

      I think that'd be very cool -- write something in Perl, then convert it to Java and run it anywhere! (Questions about performance, stability, security, etc...)

      Straight from the main developer (from BlueBox Mailing List ):

      In this way, Java programs can be translated to Win32 programs, Perl programs can be translated to C# programs, etc. Compatibility is achieved by providing a mapping process from one platform to another, eliminating the importance of particular APIs and platforms in the process. To emphasize the differences in approach, we're calling this an "anti-platform" as opposed to a "platform." This approach is a better approach, but - given SUN's and Microsoft's commerical bent towards closed source - it's understandable that they made the technical decision for the binary compatibility of a virtual machine rather than source compatibility of a translator.

      BlueBox still has a long way to go, but it's looking great so far. Just wish I had more time to help with the effort!

      --
      I feel fantastic, and I'm still alive.
  18. Maybe faster, but not necessarily better by bee-yotch · · Score: 1

    Although Java might be a little slower than C/C++ for the majority of applications the speed is fine. Computers are fast enough now to make up for its slight inefficiencies.
    I think the main benefit to Java is that it's great for developers. The language basically forces programmers to use good coding techniques which in turn makes modifying the code afterwords very easy.
    Besides, how is this new virtual machine an alternative to java?? Isn't it just an alternative to the java virtual machine? Since this new VM can use java.

  19. Source? by Quixote · · Score: 1

    Where's the source, Luke?

    I, for one, don't want to download and run a binary from an unknown site.

    1. Re:Source? by BlowCat · · Score: 2

      You didn't look carefully. The source is here.

    2. Re:Source? by Anonymous Coward · · Score: 0
      I, for one, don't want to download and run a binary from an unknown site.

      Oh please. Even if there was source you wouldn't read it. Get over your open source bigotry.

    3. Re:Source? by Anonymous Coward · · Score: 0

      I bet you're the sort of person who refuses to go up in a tall building, just in case a plane crashes into it and it falls over.

      Chicken.

  20. Oh great... by weslocke · · Score: 1

    I'm a C++ novice... I dabble in VB... I'm trying to teach myself Java... And then here comes yet another language for me to never really fully learn.

    Sheesh! Will you people leave me alone?!

    --

    'Life is like a spoonful of Drain-O, it feels good on the way down but leaves you feeling hollow inside'
    1. Re:Oh great... by Zach+Garner · · Score: 1

      Get Busy.

      Of course, I get this:
      Your comment violated the postercomment compression filter. Comment aborted

  21. Isnt that what Ximian mono is about? by MfA · · Score: 1

    Arent they trying to implement a portable version of the Common Language Runtime library?

  22. Java *is* open source by magic · · Score: 4, Informative
    The original post was misleading.

    Java is open source, at least for practical purposes. Sun has released the source to the entire Java standard library. IBM's Jikes is one of the best Java compilers available (it is more reliable and faster than javac), and is available with full source.

    Open source doesn't just mean the GPL! The GPL trouble more often than not because most companies won't get within miles of it for fear of legally contaminating their sources. The important thing is getting provided source code to be seen as a standard, not a wierd alternative. With Java, the source is provided and is really useful.

    I wouldn't put Java and C# in the same boat as far as "proprietary". You can't fork the Java code base directly, but Sun is really responsive to the community. Most new libraries are incorporated from user built packages, and all new features go through a community review. The bug database is open to the public. Sun provides open source repositories like jxta.org to help the community. Sun is the good guy... C# is Java Microsoftified and is evil (although a decent language) because it won't have this kind of community interaction and open source.

    -m

    1. Re:Java *is* open source by Anonymous Coward · · Score: 0

      what a total biased crock of shit! Sun as the good guy! HA! Let them release the code to the IETF then.

    2. Re:Java *is* open source by Seenhere · · Score: 1

      The GPL trouble more often than not because most companies won't get within miles of it for fear of legally contaminating their sources.

      Tell me: What companies will get within miles of Sun's JDK source code, with * This software is the proprietary information of Sun Microsystems plastered all over it? I mean, what can you actually be sure you can go ahead and USE that source code for, in a commercial context?

      --Seen

      --
      "I used to be a dilettante. Then I thought I'd try something else for a while."
    3. Re:Java *is* open source by Anonymous Coward · · Score: 0

      Submitting anonymously for obvious reasons.

      The company I work for, is implementing a large-scale enterprise-wide "widget" in EJB, Servlets, and yadda.

      We recently came across some scaleing-based issues with our widget, and we narrowed the bug down to a class in JDK 1.3. We busted out the source to the class, fixed the bug, and sent Sun a patch. This fix is now in JDK 1.3.1.

      No, we didn't fork our own version of the JDK. We didn't come out with our version of the compiler (btw--Jikes+ant can be really tempermental on > 100 sources. Useless for us, because we have something like 1200 .java files). However, having most of the source to the JDK really helped us debug our issues. *That* is what we can do with Sun's JDK. Diagnose our own bloody problems and give it back to the vendor, because waiting for the vendor while having > 20 developers just spin their wheels was unacceptable. We'd rather tell the vendor of the issue, and then try to diagnose the issue with the vendor instead of just going back and forth with the vendor, and being at the mercy of them.

      Incidentally, we also use BEA's Weblogic. That also has faults, and unlike Sun, they don't give us the Java portion of their stuff, and so until they get us answers to their issues, we're also quite dead.

    4. Re:Java *is* open source by Anonymous Coward · · Score: 0

      -- We didn't come out with our version of the compiler (btw--Jikes+ant can be really tempermental on > 100 sources. Useless for us, because we have something like 1200 .java files).

      Really? Do you have any more information about this or a bug reference with IBM? I've been using jikes with a large source base (a quick scan of the tree gives 1143 .java files) and haven't seen any problems. I'd like to know if there was a known issue to try and avoid it.

    5. Re:Java *is* open source by Seenhere · · Score: 1

      That's why you want Java instead of C#, not why you want Java instead of GNU software. The scenario you describe here you could do even more easily with GPL (just make the change and publish the source to the patch).

      I'm still missing what's the advantage of Sun's license over that nasty GPL that no company will touch...

      --Seen

      --
      "I used to be a dilettante. Then I thought I'd try something else for a while."
    6. Re:Java *is* open source by oops · · Score: 2, Interesting

      This is a perfectly fair comment, despite the replies it's received already. I use the API source to answer queries from programmers I work with, resolve issues wrt. performance/usage etc. From my clients perspective (big banks, usually) this is perfectly adequate. They're not going to want to modify the source. They invest in Java to have a maintainable code base that does (to any practical degree) run anywhere.

      The Sun developer connection is responsive. I vote for bugs to be fixed (3 at one time). In the last 3 weeks I've had three issues resolved.

      One of my developers came across a threading issue last month. It's resulted in Sun's kernel people, Java people and threading people banging their heads together and finally issuing a bug fix in the form of a new JVM for us to test. Once we've confirmed that it's a fix, it'll go into the main branch.

      Is it GPL ? No. But from a big business perspective, there are other more important issues.

    7. Re:Java *is* open source by angel'o'sphere · · Score: 1

      That post is a good post, and right.
      Some moderation abuser hat it moderated as "troll".
      What the heck is up with the readers here, don't you have any feeling for responsibility?
      Usualy I have to meta moderate 50% of the flaimbait or troll moderated posts as: unfair.

      Regards,
      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    8. Re:Java *is* open source by egomaniac · · Score: 2

      Hmmm. I'm using Jikes with 2000+ file programs, no problem. I'm not using Ant, so maybe that's the issue, but I can assure you that Jikes has been able to handle *really* big programs for years.

      --
      ZFS: because love is never having to say fsck
    9. Re:Java *is* open source by haggar · · Score: 1

      Um, that's what I was to say, myself: Java is open source. But, naturally, such a post had to be modded as "troll", right? I mean, this _is_ slashdot, after all!

      Oh well, have I already metamoderated today?

      --
      Sigged!
    10. Re:Java *is* open source by cabbey · · Score: 2
      Java is open source, at least for practical purposes. Sun has released the source to the entire Java standard library.

      Not really, last I checked the sun.* packages have not been released, and the packages that have been released are under the equivalent of MS's "shared source" license.

      IBM's Jikes is one of the best Java compilers available (it is more reliable and faster than javac), and is available with full source.

      Why thank you. But Jikes is more a result of Sun having attempted to standardize Java, we work from the two pubished specifications for the language and the virtual machine, not from anything released under the SCSL. (aside: we're also in need of more active developers.)

      Open source doesn't just mean the GPL! The GPL trouble more often than not because most companies won't get within miles of it for fear of legally contaminating their sources. The important thing is getting provided source code to be seen as a standard, not a wierd alternative. With Java, the source is provided and is really useful.

      hmm... well that's true, however, a more important aspect I've always felt was what you can *do* with the source. With the SCSL for example if you find a bug in a given class you can't distribute a fix without violating the license. The best you can do is submit a bug telling them how to fix it, then hope it eventually get's incorporated.

      The bug database is open to the public.

      Um, not entirely. You don't get 100% view of the bugs, even in the community source area.
  23. Some quick thoughts. (No sound, GPLed) by BrookHarty · · Score: 3, Interesting

    The demos are nice and small, very impressive. Ill need to try this on my linux box in a few moments. (Looks like from the /. posts is crashs on some redhat installs..)

    No sound, but its still in beta, so things should be added. The most impressive thing, is IVM is GPLed! No pesky Sun or Microsoft License! Now give me a QNX, Ipaq and Gameboy Advance IVM and im set!

  24. Win98 OK, Fails on win2k by heretic108 · · Score: 1

    demos work ok on win98, but in win2k, the ivm prog does nothing.

    --
    -- In the beginning was the WORD, and the WORD was UNSIGNED, and the main(){} was without form and void...
    1. Re:Win98 OK, Fails on win2k by Anonymous Coward · · Score: 0

      You need the GLUT libs.

      http://reality.sgi.com/mjk_asd/glut3/glut3.html# do c

  25. Faster than Java??? by Tom+Davies · · Score: 1

    Where does it say that this is faster than Java? -- yes, I have read the site.

    One of the best things about Java is its libraries -- any open source alternative (and that would be a Good Thing) will have to replicate them before it can be compared to Java -- no matter how fast it is.

    Tom

    --
    I have discovered a wonderful .sig, but 120 characters is too small to contain it.
  26. Perhaps... Perl? by consumer · · Score: 1

    I know people like to bag on Perl around here, but it has better portability than Java and is faster for many applications.

    1. Re:Perhaps... Perl? by Dog+and+Pony · · Score: 1

      True. Perl is really fast when written correctly (not much to that, just don't make new regexpos every other line hehe).

      The only thing that makes perl slow is the overhead at the start of the script, and since many perl programs, cgi and others just starts, performs a task, and then exits, you have to figure that in. Sadly.

      However, a running perl program, or one implemented in mod_perl etc can compete with the best of them.

  27. What about support? by smoondog · · Score: 1

    Is there any word on support by any big players? The success of a new language such as this will depend entirely on how well it is adopted by the big guys. Without that support this language will likely fail (like many others). Kudo's for /. tooting its horn, this may get adoption of the language faster.

    -Sean

  28. Bullshit by slashdot2.2sucks · · Score: 0, Flamebait

    Absolute bullshit

    "For numerical computation it rivals C/C++ and can be faster in some cases."

    The fact is, Java is NEVER used in serious numerical compution. Fortran and C are used to a greater extent, with some advocating C++, but nobody, absolutely nobody even considers Java.

    1) Java is far too slow.
    2) All the math libs are already written in Fortran and C, and nobody wants to port.
    2) Most scientists are not fancy programers and don't care too much about OO, garbage collection, and other frills.

    You go to your Physics department and tell them that you want to do 10,000 body Molecular Dynamics in Java and they will laugh your fucking, dumb ass off campus.

    1. Re:Bullshit by shion · · Score: 1
      Really? We're operating on giga- and tera- size datasets, with complex floating-point calculations, and Java is just as fast as any of our best C or Fortran programs.

      Java is most certainly used in a number of mathematically-intensive applications. See CERN's Colt library, for example. Quite useful, asshole .

      Now let's see...
      1. Java is far too slow.--no, it's not. Stupid Java is slow, but you shouldn't be writing Java if you're stupid.

      2. All the math libs are already written in Fortran and C, and nobody wants to port.--right, except CERN and a veritable half-ton of other nobodies. Be way of all those "two-dimensional matrix" libraries out there, though. Most suck, like you.

      3. Most scientists are not fancy programers and don't care too much about OO, garbage collection, and other frills.--I see. Then I must work with some damn rare, unusual scientists. Or maybe it's just that you don't know what you're talking about.

      The End, Hooray!

    2. Re:Bullshit by Anonymous Coward · · Score: 0

      somebody mod this down! look at him: he has in bold words like asshole, stupid, stupid, suck you. Look at some of his previous comments: http://slashdot.org/comments.pl?sid=7528&cid=79430 3
      http://slashdot.org/comments.pl?sid=8228&cid=707 67 0
      http://slashdot.org/comments.pl?sid=10698&cid=41 17 58
      http://slashdot.org/comments.pl?sid=5101&cid=111 82 52
      http://slashdot.org/comments.pl?sid=8067&cid=728 02 3
      clearly this guy is a troll. Mod him to -1 so we threshold users dont have to waste our time on these trolls.

    3. Re:Bullshit by iapetus · · Score: 2

      Okay, let's look at those arguments again.

      1) Java is slow because Java is slow.

      Cool. I'm convinced, but some would view this as a slightly circular argument.

      2) Java is slow because some libraries have already been written in other languages.

      You make a good case here. But again, some might frown and accuse that argument of being a bit of a non sequitur.

      2) Java is slow because some people who don't use it don't know how to use it.

      Again, 100% solid. But I fear some might be slightly wary of the utter irrelevance of what you're saying and still other might suggest that the fact you can't count to three makes you a less than optimal judge of speed of numerical computation...

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
  29. Awesome by bcilfone · · Score: 1

    Now I can get segmentation fault (core dumped), GPFs, and BSODs without having to port a single line of code!

  30. Re:Faster -- with evidence by Leeji · · Score: 5, Informative

    Okay.. Here's a few things. First, about the original statement, "Java is almost as fast as C." I agree, with evidence.

    In terms of raw computation, let's dump some equivalent C and Java. I tested these on my schools large Solaris box.

    int main(void)
    {
    float x = 0;
    int counter;

    for(counter = 0; counter < 10000000; counter++)
    x += (counter / 3.14159265359);

    printf("%f\n", x);

    return 0;
    }

    [11:29pm || 24](~)> date && compute && date
    Fri Sep 14 23:29:06 EDT 2001
    15969064845312.000000
    Fri Sep 14 23:29:11 EDT 2001
    (5 seconds)

    public class Compute
    {
    public static void main(String args[])
    {
    float x = 0;
    int counter = 0;

    for(counter = 0; counter < 10000000; counter++)
    x += (counter / 3.14159265359);

    System.out.println("" + x);
    }
    }

    [11:29pm || 26](~)> date && java Compute && date
    Fri Sep 14 23:29:53 EDT 2001
    1.59690648E13
    Fri Sep 14 23:30:02 EDT 2001
    (9 seconds)

    I did this a few times, and the general trend continues.

    What also kills Java performance is lazy programming. People tend to use vectors (high-maintenance linked lists) when native arrays will do. Or they'll store a load of information in a Vector, then repeatedly search through it (in O(n) time). If they had any mind for performance, they'd use a native O(logn) data-structure like a Treeset. People use Treesets (a sorted, tree-like data structure) and then re-sort them. Or worse, if they can't find a sort() method for their specific object-type, they'll hack together a bubble or shell sort.

    The only place that Java beats other languages is the API. Large enterprises have a Java fetish *not because it's portable*, but because their almighty productivity numbers go through the roof. Where a C++ programmer has to code (or buy) linked lists, b-trees, hashtables, sockets, etc, Java wraps it neatly into the language core.

    Second, answers to your peeves :)
    1) Typedef = class!
    2) Constants only require "final int foo". The public keyword only makes your constant visible to other classes. You don't need this if you define the constant in the class you're using it. The static keyword simply lets you use the variable without having to instantiate the class. Again, you don't need this if you define the constant in the class you're using it.
    3) You only have to use parseInt() to take an int from a string. I'd say the equivalent atoi(...) in C is just about the same!

    --
    It all goes downhill from first post ...
  31. IVM explained (faster than java? How?) by moogla · · Score: 1

    What IVM really is: a simple virtual machine and a gcc target for this virtual machine. If the virtual machine is simple and efficient (4 internal registers almost guarantees using the eax-edx intel registers), then gcc does all the hard work. It does the optimization, it handles multiple front-end languages. Furthermore, since you can run this VM on any architecture or OS, the code is portable. Nice idea, but let's not get all worked up over it... it's not magic.

    --
    Black holes are where the Matrix raised SIGFPE
  32. How bout something even better? by nodrip · · Score: 1, Informative


    Yindo

    1. download size - 350K and shrinking
    2. portable, cross-platform design
    3. based on a simple, elegant, dynamic oo language
    4. core vm is open source
    5. supports cross-platform open standard api's
    6. multimedia oriented
    7. write once, run anywhere code
    8. runs in browsers and as a local app

    check it out if you have the time. it's still in beta, but is getting there.

    --


    -- "The best way to predict the future is to invent it."
    1. Re:How bout something even better? by 8string · · Score: 1

      Weakly typed. 'nuff said.

      BTW: What about GCJ? I think _that's_ a great idea.... I tried it out a few months ago, but not since. It was cool back then, and probably even cooler now since they've had time to continue to implement the core API.

    2. Re:How bout something even better? by Anonymous Coward · · Score: 0

      whats wrong with weakly typed languages?

      I frankly LIKe to just declare variables whilly nilly... lets writing code me a bit more spontainous =]

    3. Re:How bout something even better? by 8string · · Score: 1
      I frankly LIKe to just declare variables whilly nilly... lets writing code me a bit more spontainous =]


      Aside from the fact that I don't know exactly what 'writing code me a bit more spontainous' means, I think there are a number of advantages to strongly typed languages. If you're argument is that you like to declare variables whilly nilly, then surely you don't do any real design or specing out. That in and of itself is probably enough of a counter argument to your argument.



    4. Re:How bout something even better? by Anonymous Coward · · Score: 0

      s/"lets writing code me a bit more spontainous"/"lets me write code a bit more spontainously"

      (what was i *smoking*...)

  33. Cross platform? by bay43270 · · Score: 3, Insightful

    I know Java isn't very popular here, but I have to say this... (I guess I wasn't going to be able to spend the karma on Christmas presents anyway) I think this is a bit insulting to the people at Sun to say IVM is cross platform. Cross platform means a lot more than just being able to run on more than one OS. Think about internationalization support. Does the ability to swap out text in the GUI constitute internationalization? No. Currency, calendars, colors and many other issues make up internationalization. The same principal applies to cross platform support. Sun spent a lot of work grappling with issues such as how to provide the programmer with an operating system independent environment. They deal with memory management, threads and display capabilities in ways that work consistently from a kiosk to a cluster of Alphas. They spent a lot of time dealing with j2ee, making sure the application server environment was swappable. They spent a lot of time working on platform independence in general, and I think its insulting to Sun to say that slapping a virtual machine under a compiled language is any more than a small part of the platform independence offered by Java.

    1. Re:Cross platform? by 8string · · Score: 1
      They spent a lot of time dealing with j2ee, making sure the application server environment was swappable.

      I'm sorry, but I guess in whatever alternate universe you've had to implement j2ee in, there's only one app server. My experience with j2ee has been REALLY bad. I spent a couple weeks getting a .ear file from borland app server ported to a weblogic friendly version. Nightmare. I actually think j2ee has made deploying to different app servers more difficult.

    2. Re:Cross platform? by egomaniac · · Score: 2

      I've been able to switch my application between different app servers in about five minutes.

      What sorts of problems are you running into?

      --
      ZFS: because love is never having to say fsck
    3. Re:Cross platform? by Anonymous Coward · · Score: 0

      his problem is that his application is non-trivial.

    4. Re:Cross platform? by StClaraOperationIvy · · Score: 0

      Or so he's mistaking Java by Jscript, I guess.

      Check out these guys too: Bombshell Rocks

  34. Re:Faster -- with evidence by L-Wave · · Score: 1

    i would agree speed is trivial in this case, but I had written a program )(in java) that parses an ISO9660 filesystem, this program ran relativly slow (relativly compared to what a C prog would take...no i dont ahve times presently) most of the time taken was due to the lack of the ability to cast a set bytes to a class. In java i was required to read in each individual variable (and yes..there are ALOT of them)

    --
    I SURVIVED THE GREAT SLASHDOT BLACKOUT OF 2002!
  35. Re:Faster -- with evidence by Spankophile · · Score: 2

    Do you realize what you're doing when you type:

    System.out.println("" + x);

    Probably not, so I'll tell you.

    First of all, you instantiate a StringBuffer class, which is used to concatenate the "" and the x. Then the StringBuffer is used to create a String object. Then you rinse and repeat to the tune of ten million. That's a LOT of allocating.

    As anyone who does Java knows, object allocations are DEATH in java. Avoid them if at all possible.

    I bet if you change just the "" + x to just x, you'll shave off those extra 4 seconds.

  36. It Will Never See Widespread Acceptance by istartedi · · Score: 3, Insightful

    It Will Never See Widespread Acceptance. Why? It's GPL'd. So, until Linux conquers the desktop, or Netscape recaptures the browser market it's irrelevant.

    PNG and JPEG are in IE because of the license. If they were GPL, all the MS browsers would be supporting GIF and some other alternative for lossy.

    I didn't download IVM, but I decided to take a look at the instruction set. I gave up because it was taking too long to download! It looks like it has thousands of instructions. The JVM has less than 256. Something tells me IVM won't be targeting the embedded market. :)

    Don't get me wrong. There is a market for embedded C or C++ virtual machines. I know because I'm working on one for my own use, and other parties have expressed interest to me. But I don't expect to bring in big bucks with it. MS CLR will probably win on Windows, and the JVM will win every place else. The smart money is on tools and languages that target the installed base. Sound familiar?

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:It Will Never See Widespread Acceptance by Arandir · · Score: 2

      If the libraries for PNG and JPEG were GPL, they would be rare even under Linux.

      But I wonder about IVM and the GPL. Will all programs executing under IVM also have to be GPL? If the programs have to link to an IVM module of some kind, they may have to. I guess it all depends upon how it's done.

      But how in the world will one be able to write a IVM plugin for Mozilla? Or Galeon and Nautilus, which still use non-GPL Mozilla code? If IVM is truly GPL, and with no exceptions, then it may be limited to Konqueror only.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    2. Re:It Will Never See Widespread Acceptance by anarkhos · · Score: 0

      I have to agree 100%

      This is expecially true of, say, libobjc. It's one thing for the build tools to be GPL like gcc is, but for the runtime library to be GPL is suicide.

      --
      >80 column hard wrapped e-mail is not a sign of intelligent
      >life
    3. Re:It Will Never See Widespread Acceptance by bytes256 · · Score: 1
      You have to ask yourself if you would really want a plugin for IVM anyhow...

      It appears to have security that is far too weak for purposes of web applets. (No sandbox.) In fact, if the above mentioned browsers DID include IVM support I would most likely disable it for security reasons.

      --

      Slashdot, the site where everything's made up and the points don't matter
  37. speedy? portable? by Anonymous Coward · · Score: 1, Funny

    "I'm sure a lot of people would be interested in a language as portable as Java but speedier."

    yeah! let's name it C!

    oh, wait....

  38. Re:The TRUTH about September 11. by Anonymous Coward · · Score: 0

    ". But for every "terror network" that is rooted out, another will emerge"
    this is why the head of the snake 'fanatic Islamic leaders' should be eliminated together with the fangs of the snake 'Bin Laden'

  39. More programming languages than programs by WildBeast · · Score: 3, Funny

    It's crazy, at this rate we'll have more programming languages than programs, we'll have more OS's than we can think off, etc.. I don't know if you're getting it but at this rate, the value of software will sink. Supply is much bigger than demand, soon enough developpers will not afford to pay for food. Don't say I didn't warn you.

  40. Is this possible ? by tmark · · Score: 2

    Am I missing something ? How can a language 'support' another language (I assume this means relatively full support), support other languages, and yet still be faster than *any* of the languages ? The only thing I can imagine is that their compilers are better, but somehow I doubt that's the answer.

  41. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    The printing isn't in the scope of the for block.

  42. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    Yowch. I'm mostly in agreement with your post, but I'm wondering a bit about your execution times. Running the two programs at home (on a moderately fast Athlon) gives:

    15969064845312.000000
    0.22user 0.00system 0:00.20elapsed 110%CPU (0avgtext+0avgdata 0maxresident)k

    for C and

    1.59690648E13
    0.01user 0.01system 0:00.32elapsed 6%CPU (0avgtext+0avgdata 0maxresident)k

    for Java. Or roughly 25-30 times as fast as your times. I'm wondering if your 'large Solaris box' is large because it's using vacuum tubes or large because you've got a whole bunch of people banging on it :) If it's under load from other users, you may not be getting the world's most accurate benchmarks (although it's a pretty close ratio in this case).

  43. Re:The TRUTH about September 11. by Anonymous Coward · · Score: 0

    Learn some history.

    Munich-like: refers to PM Chamberlain's 1938 meeting with Hitler, giving him the Sudetenland (and the rest of Czechoslovakia), in order to appease Hitler. Needless to say, it didn't work, and today, Munich and Chamberlain are often used to describe tactics seen as weak, ineffective and pacifist.

    Churchill, Chamberlain's successor, took a more, ahem, proactive approach: declaring war on Germany following the Polish invasion.

  44. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    And unfortunately, this is what is going to make Java. CPUs are getting so fast that the difference between C and Java isn't going to matter anymore. :\

    As a language, Java is a step backward from lisp and C++, but you write in what the rest of the world uses, or sit on the street corner. James Gosling has won, and I have to live with it, I guess.

    My biggest complaint isn't Java the language itself, but the people who write in Java. There are some real dumbasses out there who wouldn't last a minute writing C, but they can write workable code in Java. Granted, it's still stupid code, but it runs. I don't think that's a Good Thing.

    I'd rather hire someone who has C++ on his resume, and let him learn Java than do the reverse.

  45. *BSD by Lina+Cat · · Score: 1

    wheres the *bsd support?
    thats more important than win* support.
    other notes: first post ever. meow :)

    --
    (FreeBSD Devil) *stabs* (Tux, The Linux Turkey)
  46. Re:Faster -- with evidence by Leeji · · Score: 1

    Shame on me...

    "Java is almost as fast as C." I agree, with evidence.

    BS

    "Java is almost as fast as C." I DISagree, with evidence.

    --
    It all goes downhill from first post ...
  47. Ignore above post. by Malcontent · · Score: 2

    Sorry my bad. Same thing

    --

    War is necrophilia.

  48. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    Yikes! Without a "dumbass" at the end of that sentence I had to check whether I was actually at Slashdot.

  49. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    Celeron 400, 396mb, cygwin under win2k, gcc -O3, jdk 1.3. I multiplied the counter<10000000 part by ten to get better looking results on my computer; otherwise, times were around 1 second.
    ./test is the c program, Test is the original Java program, Test2 has the System.out.println changed as per your suggestions.

    Sat Sep 15, 05:13pm. /cygdrive/c/temp
    $ time ./test && time java Test && time java Test2
    562949953421312.000000

    real 0m11.036s
    user 0m10.895s
    sys m0.040s
    5.6294995E14

    real 0m8.522s
    user 0m0.010s
    sys m0.030s
    5.6294995E14

    real 0m8.523s
    user 0m0.010s
    sys m0.030s

  50. As Portable As Java? by TheAJofOZ · · Score: 1
    It strikes me as odd that something as portable as Java only seems to come for Windows and Linux. What about MacOS, Palm, BeOS, etc ad nausium. Now I'm sure that it could be ported but does it really offer any benefits over Java. Sure it's under the GPL but that is not an advantage in and of itself. Yes it supports C++ but you could have just created a C++ to Java bytecode compiler. It strikes me as very odd that people have such an aversion to non-free (speech) software. How about we concentrate on replacing the poor quality non-free software with free alternatives rather than trying to replace the things that already work.

    Just seems like common sense to me.

    1. Re:As Portable As Java? by Anonymous Coward · · Score: 0

      A year ago they were in the news too. There were binaries for a lot of platforms: x86 linux, sparc linux, alpha linux, motorola linux, freebsd, solaris .....

  51. Wish it luck, but... by arQon · · Score: 3, Insightful

    There's a lot to be said of platform-neutral environments. Typically tho, what's said is: "It doesn't f**king work". C++ is standard only as long as you're willing to stay with the language as it was 5 years ago, since we're constantly forced to use (eg) SunCC 4 or MSVC 6 or some other hopelessly broken compiler because of broken legacy code that NEEDS it; and Java has never been anything other than "write once, debug everywhere".
    Being language-neutral on top of that is also a great thing for a VM, although it's no shock that the VM is going to be biased towards one language over the others. But let's face it: anyone using Java doesn't need hard-realtime performance anyway, otherwise they wouldn't be using Java in the first place. Same as if they were VB devs. So it makes sense that the bias would be towards C++.
    The IVM runs DAMN fast, supports a truly open, pretty well-designed, widely-available graphics library: it's got a lot going for it.
    But it'll have to bully its way past Java to get wide acceptance even if it's 10x better; and to truly become a standard it ironically needs to be adopted by, yes, THEM. The people whose browser has 80+% of the market. Of course, since it's GPL'd that's hosed it right there.
    Then there are the same security issues that you see with every inet VM: how sure can I be as a user that some site's little applet didn't just funnel a ton of info back to them, that it won't do nasty things to me, etc. THOSE are the sorts of things that always bother me about "active" content: take a look sometime at how trivial it is to totally ruin someone's machine with an ActiveX control.
    As an "Internet VM", I have as much use for this as I do for ANY objects-on-Web-pages "solution", which is to say, damn close to none. I have ONE site that I'm willing to run Java from: ESPN for it's baseball applet. Every "enabling" technology that people use for this stuff tends to end up meaning "enabling inept web designers to create gimmicky pages that don't work", especially when they end up using scripting and crapplets to mimic the most *basic* HTML functionality like hyperlinks. (No, I'm not joking. I've seen it happen).
    OTOH, for an *intra*net I would definitely consider something like this, and I'd prefer it over Java any day of the week. And for little noddy apps, being able to use my language of choice and still have portability AND much better performance, well, that sounds pretty good to me too.
    So I think it's a useful bit of tech: just that it'll never go anywhere in the role they're pushing for it. That's not necessarily a bad thing though. :)

  52. gah, anyone got a fix for this: by crazney · · Score: 1

    ./icvm bounce
    Inconsistency detected by ld.so: dl-version.c: 218: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!

    --
    stuff
  53. Compiling IVM by gatesh8r · · Score: 1
    Of course doing a compile of this on a Athlon 1 GHz with 256 MB DDR RAM took me quite a while, and also it didn't even finish because of a function statement that was undeclaired (like I'm going to wade through all that code to find it ;-) This is from a pre-wrapped tarball, so YMMV with the CVS...

    --
    Karma whorin' since 1999
  54. java is fast enough by Anonymous Coward · · Score: 0

    unless you are talking about gui stuff...
    I have never seen java go slow unless poorly designed. Gui's and applets will always be slow because of the download time of classes.
    Server side stuff can go almost as fast as C++ in some cases with the right runtime environment. It is always faster than VB in server environments.

    flame me if I am wrong.
    l8,
    ac

  55. Re:Faster -- with evidence by Cassandra · · Score: 1

    In java i was required to read in each individual variable (and yes..there are ALOT of them)


    That is indeed very slow if you dont use buffered streams. If you don't, try something like this:


    FileInputStream file = new FileInputStream(filename);
    BufferedInputStream bis = new BufferedInputStream(file);
    data = new DataInputStream(bis);
  56. this is good but not great by Anonymous Coward · · Score: 3, Interesting
    Having a VM to make C, C++, Obj-C (and Java) alll portable and still fast is great. Java does reduce the need for this and since the VM isn't portable to my platform of choice (OS X) this certainly isn't the answer for me at the moment. If it grows and moves to other platforms, tremendous.

    People here have already started rebutting the need for this as Java is fast, has great libraries and enforces good writing style. In response to that, from a person who makes his living writing Java:

    • Java is fast. It runs close to C/C++ in basic algorithm tests from what I've seen, depending on your runtime settings and VM.

    • Java's lack of direct pointer manipulation (e.g. pointer arithmetic) does help people from hurting themselves and that alone leads to better code. The OO nature helps a bit, but really, not much more than taking C++, removing pointer manipulation and removing huge reliance on globals. Obj-C, which I use in my hobbies for OS X, is just as good an OO language, with some minor quibbles about its syntax being more awkward. The lack of memory control in Java loses out big time to the option of manual or automatic memory deallocation in Obj-C. Big Time Loss, even in 1.4.

    • Java's libraries lead to code bloat. People substitute poor use of OO code and APIs for their poor use of pointers in their C work. Sun encourages this poor use by advertising its APIs' functionality and not their many weak points and the fact that its APIs aren't particularly efficient outside of a limited scope.
      Example: People commonly use a Vector when they just want an array of simple types (e.g. int) that will always be "large enough". Vector implements things that have nothing to do with this functionality and Vector doesn't support simple types. Code using the Vector with an Integer rather than an array with an int runs at less than 2/3 the speed and has a much larger memory overhead. Yes, teaching will help people reduce this error but with many classes the poor API coding is two, three or four parent classes above the class you think about using and oftentimes performance of the code is obfuscated - you don't want to have to write replacement code and test yours by theirs in order to determine if you should write replacement code. Java substitutes interfaces and Object-Orientedness (e.g. "Integer" support but not int) as so-called functionality while sacrificing efficiency and usefulness. Whereas efficient programs like to keep good form while remaining close to the bone, java likes to wrap your whole body in saran wrap and then cover that in tupperware and then let you touch the code through those nice OO pieces of plastic surrounding your hands. People teaching Java generally never tell the students the API code sucks, often because they don't really realize it themselves (in academia) or ..? Or if not that I don't know why they don't. I guess the modus operandi for many Java programmers is to rarely research the code beyond the published docs. It came to heart for me after I had to write an editable text component extending from JPanel as everything they offered was wretched for something requiring complex formatting.

    • Java's libraries are very buggy and often poorly written. In final release versions their code still has questions, e.g. "How should this be handled?". They have some bugswhich are 3 or 4 years old, easily noticeable and in a basic part of their API which aren't even fixed as of 1.4. Leading to...

    • Sun doesn't support community fixes to its libraries. This is the worst thing possible given their oft-shit code. If they simply had a "submit bug fix" section in an easily found place that would help so much. This is the major downfall of them not having truly open source code - you can look, but you can't fix and post so no one else will have to fix. This, above all the other reasons, is why Java still has such a poorly implemented API and thus (through its poorly made API) why it is not automatically the language of choice when considering C++, Java or other OO languages. It's really not the language that is so slow, it's the poor implementations in and the misuse of the APIs.

    So, please, all you fellow Java programmers, realize that Java is far from perfect, and even just among the languages with an OO nature, it is not the best (none of them are). If Sun made it easy to fix its code, and offered more classes with less "functionality" and better performance it would become vastly better. I don't see Sun really making the changes necessary to make Java fast and memory efficient and, well, responsive to programmer's needs. If this VM can become a practical substitute for coding across platforms I would happily make the switch and would certainly hope that my company does the same. Unfortunately for both these paths the promises therein are still well in to the future.

  57. Speedier? by NitsujTPU · · Score: 2

    Ahh, I can tell that you know a language other than JAVA, because people who only know one language seem to want to defend that language to the death. I am so sick of listening to programmers who only know one language, call themselves programmers, and will fight to the death explaining why that language is better than all others without a good grasp on theory to do so.

    I don't see why this should be any quicker though :-P

    1. Re:Speedier? by Anonymous Coward · · Score: 0

      The languages that people tend to know if they only know one language are Java and Visual Basic.

      Fortunately, thanks to the rampant joblessness, we've been able to flat out stop hiring anyone who doesn't show proficiency in at least three languages.

      Work is much more pleasant now that we've gotten rid of the Servlet monkies who seem to think that "EJB" is a language.

  58. Re:Faster -- with evidence by beable · · Score: 1

    >I bet if you change just the "" + x to just x, you'll shave off those extra 4 seconds.

    You lose that bet, because the println is only executed once. Read the code again. I added some
    extra braces for emphasis:

    public static void main(String args[])
    {
    float x = 0;
    int counter = 0;

    for(counter = 0; counter < 10000000; counter++)
    { // added for emphasis
    x += (counter / 3.14159265359);
    } // added for emphasis

    // println is not in the loop
    System.out.println("" + x);
    }

    --
    ...
  59. prayers? by Anonymous Coward · · Score: 0


    > the answer to your prayers is finally here.

    Funny, lately my prayers have been about something different..

  60. Requires RedHat 6.0 or Higher? by Lethyos · · Score: 2

    Does not sound very cross-platform to me. :)

    --
    Why bother.
  61. Re:The TRUTH about September 11. by Anonymous Coward · · Score: 0
    until the injustices and inequalities that produce them are addressed.


    How do you propose we fight the injustice and inequality that exists in the Middle East? Oh, you were referring to us? Fuck off pal, we're not the ones who are injust.


    Yours is an asinine argument. The real injustice and inequality is how the militant Islamic leaders treat their citizens. In Afghanistan, the Taliban government will lop your hand off for stealing. It has stoned to death women who have exposed their ankles.


    Jesus Christ, man, wake up! Perhaps we Americans are hated like a criminal hates "The Man", but that shouldn't stop us from doing the Right Thing.

  62. Java is two things by MushMan · · Score: 2

    The problem with arguing about java is that it is two things.

    1. A language.

    2. A virtual machine.

    There is no need for a virtual machine. Simply a language with a full and developing library which is cross platform. Any language which is defined and left alone is going to become out of date very quickly.

    VM's are always going to be slower than native code. If you want a cross platform language, implement the cross platform ability at compile time rather than at run time.

    HZ.

    ps I'm a Lazy Bastard, not an Anonymous Coward :P

    1. Re:Java is two things by egomaniac · · Score: 2

      "There is no need for a virtual machine?"

      This sort of quote sounds very much like you read it off the net in some opinion piece somewhere, because it's meaningless and you offer no support for your assertion.

      Let's see how you'd define Java without a virtual machine. Firstly, we'd assume that we'd not want to give up any of Java's features or 'niceness', because after all if there's no "need" for a virtual machine it implies that we can eliminate the VM without compromising anything.

      So let's enter an alternate universe in which javac just produces a native executable file. Fine and dandy. Unfortunately, we immediately hit a few snags. How do applets work? Applets are distributed to whatever machine requests them, so unless you already have a compiled version you just can't do it. Hmmm. What about security? Java is a secure language, meaning that untrusted code running in the sandbox can't cause meaningful harm to your computer. You can't make that guarantee about an executable.

      What about Web Start, which distributes code to different computers? That will be a problem too. How about a program which requests a few classes from elsewhere? Same thing.

      Okay, so scrap that idea - clearly we'll have to give some things up. So instead of javac only producing executables, we'll change it to instead produce an intermediate format, and then have it automatically translated into the final representation as soon as we know what that representation is. Well, guess what, genius! VMs have been doing exactly that for five years.

      "VM's are always going to be slower than native code. If you want a cross platform language, implement the cross platform ability at compile time rather than at run time"

      Check out the Java Performance Report, in which Java delivers MS Visual C++ a thorough spanking. (Disclaimer: it does lose to Intel's compiler, but gcc isn't anywhere as good as Intel's)

      The Slashdot community, at least, should be smarter than this. Never, ever say that technology A will never beat technology B without a mathematical proof of its limitations in hand.

      --
      ZFS: because love is never having to say fsck
    2. Re:Java is two things by Glock27 · · Score: 1
      To respond to a few of your points (I agree that a VM is the way to go for applets, for instance):

      Okay, so scrap that idea - clearly we'll have to give some things up. So instead of javac only producing executables, we'll change it to instead produce an intermediate format, and then have it automatically translated into the final representation as soon as we know what that representation is. Well, guess what, genius! VMs have been doing exactly that for five years.

      Yes, but there are deficient things about the current Sun & IBM VM approach. There is no provision for caching translation results, meaning if you restart a program all the same cycles need to be spent on JITC and analysis, again. Every time. Secondly, current VMs are very bad about sharing resources (such as Swing and other class libraries) between different VM instances, meaning (for instance) that Swing programs suffer from long startup times no matter now many other instances are running (not to mention the significant memory hit).

      Personally, I'd like to see the .class -> .exe compilation happen at app install time. Gcj will be able to do exactly that. It would also be nice to have natively compiled shared libraries for Java. However, I'm willing to be impressed with TFM (Total F***ing Magic) dynamic compilation that produces such efficient code by comparison that it can erase the overhead and result in overall faster programs. All that said, the performance of current VMs is pretty amazing.

      186,282 mi/s...not just a good idea, its the law!

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    3. Re:Java is two things by egomaniac · · Score: 2

      I continue to disagree with .class -> .exe being the way to go. After all, native compilation *is* available (there are a bunch of native compilers for java) and for all intents and purposes nobody uses them. I certainly don't. If native compilers were so very desireable, they'd be a lot more popular.

      As for VM sharing, you're absolutely right that multiple VMs are a huge memory sink, and it really sucks. However, research on solving this problem has been in progress for years and is scheduled to be included in version 1.5 (it was originally targetted at 1.4, which is currently in beta, but was pushed back). For the record, I don't understand the difficulty but the people working on the project seem to feel that fixing this issue is a hell of a lot more involved than it would sound at first blush. I don't know the details.

      And yes, the VMs are pretty frickin' amazing right now, aren't they? I honestly never thought we'd reach the point where they were even close to native compilation, let alone beating all but the best C compilers...

      --
      ZFS: because love is never having to say fsck
    4. Re:Java is two things by Anonymous Coward · · Score: 0
      If you trust the Java security model, start one JVM as root at boot time and use the security API that's been there since JDK1.2 to isolate principals' objects. There's no reason to have multiple JVM instances or reload classes.

      If you don't trust the Java security model, you shouldn't be using it at all.

  63. GNUStep? by jcr · · Score: 2

    Has anyone tried building the GNUStep-Base library on this?

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
    1. Re:GNUStep? by Anonymous Coward · · Score: 0

      No one ever has, and I'm sorry to say, no one ever will.

  64. Squeak! by BitwizeGHC · · Score: 2

    Looking for a fast, portable, free-as-in-speech, object-oriented language? Try Squeak, a wonderful smalltalk implementation. It's great. I've been playing with it quite a bit myself, and have been very pleased with it.

    --
    N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
    1. Re:Squeak! by Z4rd0Z · · Score: 1

      After hearing a number of /.ers praising Squeak and Smalltalk, I decided to try it, and I think it's kinda yucky. Its gui is even uglier than java. And it's just a plain funky way to write programs. Besides, if you write a program with it, who will use it? Virtually nobody has the runtime system installed on their machine.

      --
      You had me at "dicks fuck assholes".
    2. Re:Squeak! by mrfrostee · · Score: 1

      ...Its gui is even uglier than java.

      That's true in the default configuration, but it's easy to make it better.

      ...if you write a program with it, who will use it? Virtually nobody has the runtime system installed on their machine

      The "runtime system" you need is actually just the VM, which is usually a single executable file. I think this is one of Smalltalks strengths. It does not depend on having a huge collection of class libraries (with the proper version numbers) installed on an end user's system.

  65. Re:Faster -- with evidence by l_km_n · · Score: 1

    The following modification makes this code much faster:

    int main(void)
    {
    float x = 0;
    int counter;

    for(counter = 0; counter 100000000; counter++)
    x += (counter * (1 / 3.14159265359));

    printf("%f\n", x);

    return 0;
    }

    This works in C and Java! Lazy programming can kill the performance of every language...

  66. Re:Faster -- with evidence by Westley · · Score: 1
    That mini-benchmark is really not a good demonstration. For one thing, you're not taking JVM startup and JIT warmup into account. Try using JBench next time.

    Someone else has pointed out that using ""+x where String.valueOf (x) or Integer.toString (x) would be more appropriate is plain bad programming, and it seems your knowledge is a little lacking if you think that Vector is usually implemented with a linked list - take a look at the source for Sun's implementation some time. Vector is a perfectly reasonable data structure to use, and has a great deal of convenience over a bare array, with very little performance cost on good VMs. (If you use ArrayList, of course, you get slightly better performance in most cases, due to it not being synchronized).

    There are places where Java performs well, and there are places where Java performs badly. Your tests show neither, particularly.

    Jon

  67. Re:Faster -- with evidence by Westley · · Score: 1
    Oh yes, one more thing:

    2) Constants only require "final int foo". The public keyword only makes your constant visible to other classes. You don't need this if you define the constant in the class you're using it. The static keyword simply lets you use the variable without having to instantiate the class.

    There's another difference too, however. If you declare a constant as static, you only take up that memory once. Why would you want constants not to be static?

    Jon

  68. Did I miss something by Westley · · Score: 1
    From the story: supports C, C++, Java and ObjectiveC

    I can't see from the web-site how it supports Java, unless you count cross-compilation as "support". On top of that, there aren't libraries for that cross-compilation, making it nigh on useless. It's fine (-ish) to cross-compile the standard Java library Java sources, but what about the native stuff which will rely on JNI bits and pieces? Is JNI itself supported?

    Either I've missed something, or this offers very little indeed to Java developers. Anyone care to fill me in?

    Jon

    PS The fact that their white paper introduction says that 4 years ago Java wasn't adequate for their 3D game doesn't say an awful lot. Java has come on by leaps and bounds since then...

    1. Re:Did I miss something by Anonymous Coward · · Score: 0

      Actually, what they did was port gcc over to their VM on top of creating their VM. That's how they can support compiling C, C++, Java, and Objective-C. I suppose they could also support Chill. The problem is that Java and Objective-C have no runtime, they can only be compiled. There is also some problems with C++ for some reason (suprising since it is just g++) -- I cannot compile Qt 2.3.1 with it. GTK+ wont compile but that is because libg was not compiled under their gcc. I've tried xpacman and the opengl demos and they are very fast. Granted that is not a test of everything, but it shows some promise. However, the other big problem is the linker. It does not produce dynamic libraries, so everything must be compiled statically which results in huge executables. The overhead for statically linking them is about 85KB.

    2. Re:Did I miss something by StClaraOperationIvy · · Score: 0


      Talking about gcc, it nowadays has that promised 3dnow! support? This is just a question I'm asking here because about 3 or 4 months I've expecting for it and I gave up 3 monts ago.

      If you do want decent support, you still have to go M$ and, obvious, you've to pay VC compiler.

      It's hard to me say this, I like gcc tools, but M$ strives for a rotten open-source and M$ is always leading with some tool inside a box on which it's drawn a puzzle or something like.

  69. Let's re=invent the wheel again! by Zero__Kelvin · · Score: 1


    Why would anyone jump ship to this paradigm when the authors show that they don't have the ability to honestly evaluate all the languages they claim need improvement, especially when they go on to tout their product as great because it let's me use all the lanuages just berated?

    Why wouldn't I just use CORBA (Common Object Request Brokerage Architecture) if I want a mature standard that does all this already and has things like early and late binding, object persitence, run time type discovery, and anything else you would want from an Object Request Broker.

    Don't give me the 'proprietary' argument, because there are GPLed ORBs out there.

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    1. Re:Let's re=invent the wheel again! by StClaraOperationIvy · · Score: 0


      Hmm...I'm thinking of a Quake engine which benefits from CORBA.

  70. Yes, it is true. And you are next. (-) by Anonymous Coward · · Score: 0

    nt

  71. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    Your benchmark is both trivial and does not take into account the time it takes for the VM to load, thus making it worthless as an argument.

  72. How about we replace.. by Dog+and+Pony · · Score: 1

    "How about we concentrate on replacing the poor quality non-free software with free alternatives..."

    How about we replace to poor-quality *free* software as well. It seems as numerous to me. People seems to think that "As long as it is free (and sometimes GPL:ed) it is good enough no matter what it does". No, it is not.

  73. Like small children... by macpeep · · Score: 3, Insightful

    Sometimes, I cannot believe the silly fights I see here on Slashdot. I'm a software engineer myself and I use both Java and C++, but for different purposes.

    At work, we write cross platform C++ code for a large number of platforms in a pretty large scale project. This is amazingly straight forward given a strict set of rules that everyone has to follow, but it also requires that you constantly test on all these platforms. The actual product that we are working on, is C++, like I said, and it would never even occur to us to write it in Java. Even if Java would be 80% as fast as C/C++, we wouldn't use it, because we want all the speed we can get. (yes, some of our inner loops are optimized in assembler - separately for every CPU that we support)

    However.. In order to be able to compile and test on all platforms, we needed a tool so that every engineer could just press a button and have the code compile and test on platform X. To enable this, we built a tool in Java, that checks out code from CVS, compiles it, and sends logs to a server where you can view the build logs with a web interface. From the same server, you can also initiate the compilation remotely on any one of the client machines (one per target platform) that are running the tool. This whole system is coded in Java, and just like would never occur to us to code the actual product in C++, it would never occur to us to code this tool in anything other than Java.

    It seems like everyone here is trying to prove that one particular language is best for all tasks. Guess what - that's not true. I see C zealots try to prove how slow Java is. Well, it's actually way faster than many believe. I see silly proofs that try to show that Java is slow by using benchmark apps that do string manipulation with String objects. If you write your own strcat, strcmp, strstr etc. in Java and use byte arrays, you'll find that string manipulation is about 70-85% as fast as in plain C - and that's fast enough for just about any purpose you can think of. Of course your productivity advantage is now gone.

    Just use whatever you feel comfortable with and whatever works for the application that you need to write. In most cases, you'll find that Java will be very nice forit. In other cases - like graphics and game programming, C++ - used wisely - is your best choice. Some dislike OOP and want to use C instead... Whatever gets the job done for you! I don't see why everyone has to prove that Java is "damn slow" all the time. Obviously, it's fast enough, as evident by the fact that a few millions programmers use it every day for real life tasks.

    1. Re:Like small children... by randombit · · Score: 1

      If you write your own strcat, strcmp, strstr etc. in Java and use byte arrays, you'll find that string manipulation is about 70-85% as fast as in plain C - and that's fast enough for just about any purpose you can think of.

      If you have to reimplement stuff that even comes with normal C libraries just to get decent speed, I don't quite see the point. If Java's String is slow, you should probably just deal with it.

      Of course your productivity advantage is now gone.

      Advantage? If people did what you're suggesting, C would probably be a more productive language to program in! I mean, c'mon! You have to re-implement basic functionality to get decent performance?

      Yes, Java is not as slow as most people think (for the most part). No, that is not a decent way to get better performance, at least IMHO (I would not consider doing something like what you suggest, nor would, I imagine, most other people, and so if String is slow, then you will see it in your application performance).

      Anyway, in the long run Perl has the best string manipulation. So there. :P

    2. Re:Like small children... by macpeep · · Score: 2

      "Advantage? If people did what you're suggesting, C would probably be a more productive language to program in! I mean, c'mon! You have to re-implement basic functionality to get decent performance?"

      I think you misunderstood. I just meant that Java itself isn't slow. It's the class libraries - like the String class - that are the cause of most of the slowdown in your average application. If you are writing a large scale app, implementing a fast string class is completely trivial. If that gets your speed up to Perl & C levels for string handling (which it would), then it's well worth it.

      For most people and most tasks, even String and in particular StringBuffer is fast enough already.

      Personally I find Java's string manipulation really nice API wise.. but that's just me, and I remember that I loathed it at first since it was object oriented string manipulation. Oh well.. :)

    3. Re:Like small children... by ACupOfCoffee · · Score: 1

      ::sigh:: One of the biggest issues with Java, as has been stated in many different ways already are poor coding choices when using it. ie. if you are doing a lot of string manipulation you use StringBuffer instead of String. Just like you don't store your booleans in double precision in C. One of the biggest advanatges to Java is it's API. One of the worst disadvantages to Java are people who don't bother to understand the class they are using.

    4. Re:Like small children... by randombit · · Score: 1

      I think you misunderstood. I just meant that Java itself isn't slow. It's the class libraries - like the String class - that are the cause of most of the slowdown in your average application. If you are writing a large scale app, implementing a fast string class is completely trivial.

      No, I understand what was meant. However, the libraries are fairly intrinsic to the language, especially those in the basic package. If the libraries are slow, or otherwise deficient, the language itself suffers (IMO), because either you take a performance hit (in terms of real application performance), or you have to reimplement basic functionality. Of course, I can reimplement a string type - but why should I have to? Just because Java can do things not involving it's standard library relatively fast doesn't mean a whole lot, if it's libraries are really slow, and thus making virtually every application actually written in Java slower than it needs to be.

      For that matter, why doesn't someone just speed up the damn String class? Has Sun not heard of code profiling?

  74. Re:Faster -- with evidence by pangloss · · Score: 2

    thanks for posting your numbers.
    my only question is what jvm (and version) was used?

  75. Squeak is Smalltalk... by Ungrounded+Lightning · · Score: 2
    Looking for a fast, portable, free-as-in-speech, object-oriented language? Try Squeak

    Squeak is Smalltalk. That means, among other things:

    The is no clear separation between the environment and the program.

    There is a confusion between a pointer and the object itself.

    There is no finalaization (destruction)

    There is a single memory model for instances (heap) versus, for instance, C++es minimum of 4 (heap, stack, static, member-of-another-object)

    There is a single model of memory management (garbage collection over ALL objects - lose them and the memory eventually returns - sometimes after a sudden "freeze" of the program). It is automatic and can't be replaced with improved handling of special cases.

    There is no strong typing.

    The environment is hostile to multi-programmer cooperation.

    The language design allows incomplete programs to appear to run, encouraging the release of incomplete and buggy programs.

    Methods (member functions) of subclasses (derived classes) are executed during construction of the superclasses (base class), invalidating the debugging of the superclass (base class) constructor.

    I could go on.

    Smalltalk is useful for throwing together a program to run once to get an answer to a question or sometimes to test an idea. It is totally unsuitable for the construction of mission-critical or commercial-grade applications.

    Since the problem here is to create an environment for writing code you want to DISTRIBUTE to a large number of people who will use them without being inside their development, it's an amazingly wrong language choice.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:Squeak is Smalltalk... by hding · · Score: 2

      It's hard even to know where to start with that.

      The is no clear separation between the environment and the program.

      Okay, one point in favor of Smalltalk, IMHO. :-)

      There is no finalaization (destruction)

      I can't speak for every Smalltalk, but then what exactly am I telling my objects when I define a #finalize method for them and send them the #beFinalizable message in Dolphin? I'm relatively sure that other Smalltalks implement similar measures.

      There is no strong typing.

      Kindly review the meanings of strong/weak vs. static/dynamic typing. Smalltalk is strongly and dynamically typed. I don't necessarily disagree that strong typing is a good thing (under its correct definition, of course). The whole dynamic/static argument is considerably less clear, however, IMHO.

      The environment is hostile to multi-programmer cooperation.

      Please tell us specifically what is wrong with approaches such as StORE for Visual Works, or even less ambitious tools such as David Gorisek's Source Tracking System for Dolphin.

      The language design allows incomplete programs to appear to run, encouraging the release of incomplete and buggy programs.

      It's unclear that your premise implies your conclusion. It's also unclear exactly what your premise means. As you pointed out above, there is no clear separation between the working programming environment and a developed program. So how is it that an incomplete program is appearing to run? A modification or extension to the existing Smalltalk image actually is running. In contrast to your assertion that this results in buggy code, the typical Smalltalker would observe that this makes it a lot easier to test and correct code incrementally.

      Methods (member functions) of subclasses (derived classes) are executed during construction of the superclasses (base class), invalidating the debugging of the superclass (base class) constructor.

      I have an inkling what you mean by this, but I'm not sure. Would you mind posting a snippet of Smalltalk code to clarify it?

      It is totally unsuitable for the construction of mission-critical or commercial-grade applications.

      I will admit that I only know one massively successful Smalltalk "commercial-grade" application, viz. Visual Age for Java. OTOH, you might want to ask companies such as Sprint, FedEx, and various large banks about the suitability of Smalltalk for mission-critical applications.

      If you don't like Smalltalk, that's fine with me (it's not my first choice for most things either, honestly), but please don't spread misinformation about it.

    2. Re:Squeak is Smalltalk... by Jay+Carlson · · Score: 1
      Why I bother posting to articles that are past the attention horizon of moderators is beyond me, but I'm feeling grumpy today.
      The is no clear separation between the environment and the program.
      Traditional Smalltalk weakness, yes, but it does have some significant benefits, or else it would have been thrown out somewhere in the 29 year history of Smalltalk. It frustrates me and other people immensely, which is why there's active work on modularization and declarative program specification.
      There is a confusion between a pointer and the object itself.
      Confusion by whom? Certainly not the implementation; it works. Confusion in the language specification? No. Confusion relative to other systems? No, there are plenty of other systems in common use with the same semantics; Java, Python, Lisp, are the first to come to mind. Confusion on your part? I can't answer that.
      There is no finalaization (destruction)
      That's just not true. See Object>>finalize.
      There is a single memory model for instances (heap) versus, for instance, C++es minimum of 4 (heap, stack, static, member-of-another-object)
      There is a single programmer-visible allocation model. The implementation may choose heap or stack allocation. If by "static" you mean "gets placed in the initialized data or BSS sections", well, until somebody coughs up a decent image->ELF executable tool, this isn't an issue. :-( Member-of-object could also be an implementation choice, but I'm not aware of people pushing on it.

      Why do you want multiple programmer-visible allocation models?

      There is a single model of memory management (garbage collection over ALL objects - lose them and the memory eventually returns - sometimes after a sudden "freeze" of the program). It is automatic and can't be replaced with improved handling of special cases.
      Most language systems have only a single model of memory management. For instance, C++ as commonly used has malloc-new/free-delete; anything beyond that is up to all of the libraries and user code to agree on. You can have endless fun with C++ class libraries fighting over which smart pointer scheme and container deallocation policy is going to win.

      IMO one of the best multiple model systems I've used is in Modula-3, where normally all references are "traced"---automatically managed. But modules marked unsafe could manipulate untraced references and do all that pointer arithmetic that C jocks think they can't live without. Of course, there was a lot of peer pressure not to mark your modules unsafe unless there was a good reason, which made people carefully consider whether they really had to do risky things to get their part of the job done to the required performance standards.

      Let's get to particulars. Squeak's collector is generational. Object memory is divided into "young" and "old" objects. Since the vast majority of objects are used once and forgotten, we don't need to scan "ALL" the objects to do most collections. Eventually, yes, we need to do a full collect, but this is fairly rare. You're right that this is problematic for realtime apps, and I don't know what people do about it. But given the frequency my Linux and W2k boxes decide to go thrash a little due to background tasks, I suspect it's acceptable for other apps.

      Btw, the GC stats from the random image I pulled up claim 6507 minor GCs at average 9ms, and one full GC (which I explictly triggered) at 627.0ms.

      I don't really feel like getting into the whole "GC is good/bad" flamewar; there are a lot of subtle issues on both sides, and I don't think I can argue either side with authority.

      There is no strong typing.
      Blah blah smalltalk/scheme/etc are strongly typed and latently typed blah blah.

      You're right, in that there are not tools commonly in use to allow programmers to specify that arguments must conform to particular protocols. (You don't want to say "is an instance of class Collection" because subclassing is not subtyping; you want to say "must support the add: and remove: protocol"). That being said there are various type inference systems people are playing with.

      The environment is hostile to multi-programmer cooperation.
      Yes, and this is a serious weakness of most language environments in current use. A lot of energy and dollars have been spent on trying to provide collaboration tools for static languages like C, and even there the results haven't been satisfactory. Witness all of the CVS replacement projects and commercial source control tools.

      Smalltalk's changeset tools are better than nothing, I guess. Other people in the thread have mentioned various multiprogrammer tools for Smalltalk, like ENVY; I haven't used any of them, but I think they're the rough equiv of CVS. That's not good enough.

      Extreme Programming originated as a methodology for supporting multiprogrammer collaborative projects in Smalltalk, so it's not like the environment keeps you from doing this, especially if you have decent policies in place.

      Once the Squeak people come up with a good module system, I suspect the collaboration issue will significantly improve.

      As far as language-level support for multiple programmers goes, the best examples are mud implementation languages; I work on MOO, which might be a good place to mine for ideas.

      The language design allows incomplete programs to appear to run, encouraging the release of incomplete and buggy programs.
      True of many languages in common use, of course. C and C++ force you to have definitions for all symbols referenced at link time, so what people end up doing is writing stub functions defined as die("i'm not written yet"), which gives you exactly the same failure mode as an incomplete Smalltalk program.

      The Squeak environment will complain loudly at you if you compile code that references method names that aren't defined anywhere.

      Those two paragraphs are just a flail at what I'm guessing you mean there. With such a vague condemnation of Smalltalk systems and the people who use them, I don't know how to respond to particulars. If you meant something else, please follow up.

      Methods (member functions) of subclasses (derived classes) are executed during construction of the superclasses (base class), invalidating the debugging of the superclass (base class) constructor.
      Yes, and I think I ran into this one time. Luckily, new instance variables are initialized to nil, so you won't get the disasterous results of following uninitialized C-style pointers.

      IMO there aren't any entirely satisfactory constructor systems in any language I know; I've been bitten by them all. C++ goes to great lengths to try to address these issues, and as a result ends up with a great deal of conceptual complexity, and that cure sometimes feels worse than the disease.

      I could go on.
      If you did, we could discuss those issues rather than handwaving them. OK, OK, yes, this is slashdot and not the right medium for long conversations, and I'm getting tired of typing too.
      Smalltalk is useful for throwing together a program to run once to get an answer to a question or sometimes to test an idea. It is totally unsuitable for the construction of mission-critical or commercial-grade applications.
      Smalltalk is a pretty good prototyping language. Whether it's suitable for a given set of people to use to build a particular mission-critical or commercial-grade application is highly dependent on local circumstances, as is the choice of any other language. Because of its strengths and weaknesses, Smalltalk has been used successfully to produce many bespoke mission-critical applications; for lots of reasons, especially runtime licensing and business models, it has not been successful as a shrinkwrap dev environment. Its poor fit into Unix's process model hasn't helped either. (Lisp and Java have similar problems btw.)
      Since the problem here is to create an environment for writing code you want to DISTRIBUTE to a large number of people who will use them without being inside their development, it's an amazingly wrong language choice.
      I think that's too strong. At this point, systems that in the past were condemned for bulk/model issues, such as Common Lisp, are dwarfed by Java. I mean, if you thought CL had a bunch of thick manuals, you'll be appalled at how heavy the books describing the contents of the Java 2 "Standard Edition" are.

      I'm on vacation from Squeak. I got burned out banging my head against some of the modularity issues, and frustrated by how hard it was to build "conventional" user interfaces in it. I can zap out a simple button/entry/list/dialog box UI in Lua FLTK much faster than in either of Squeak's two UI systems. I'll probably return though. There's something really attractive about Squeak's environment, goals, and its incredible development community.

  76. Other VMs by demoncrat · · Score: 1

    You might check out idel too. It was designed with security in mind from the beginning, and to be easy to compile instead of interpret (so it does have a separation of code and data). OTOH it's not under active development and too underfeatured to be very useful as is -- no C compiler, for example.

  77. Seems good and it should to be widely adopted. by StClaraOperationIvy · · Score: 0


    But IVM tends to support 3D ambients, its utilisation will remain pitched from mainstream until webmasters -by the way most of them still continue as sons of Java- do include massive reformulation of current proven design projects.

    Other hand it's a virtual machine, until it gets refined and providing high level of parallelism, including the alleviation of a big flaw found in Java, that's much of slowness when executing machine operations with intensive use of hardware floating-point.

    The games, which are a "recognised" part of fp-intensive family, they hadn't benefit from Java, which speeds up dynamic execution, but they do benefit of C++ -with some hand enhancements-, and originally C it was just designed for the "static-style" software!

    It's necessary to know that even using an efficient language as C++ is difficult to extract good 3D performance if the software platform hadn't there specific adaptation for specific hardware.

    Combining Java and C qualities and the need of a language capable to supply the end of internet connection as a bottleneck will make IVM really a champ, at least that's my opinion.

  78. Re:Faster -- with evidence by Thorgal · · Score: 3, Interesting

    Ok, I multiplied counters by 100 to get more reasonable times on Athlon1.1Ghz/143MHz SDRAM and to minimize JVM startup overhead. Results:

    fantomas:te/> gcc -v
    Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
    gcc version 2.95.4 20010827 (Debian prerelease)
    fantomas:te/> gcc c.c -o c -O2
    fantomas:te/> time ./c
    9007199254740992.000000

    real 0m19.273s
    user 0m19.220s
    sys 0m0.000s

    fantomas:te/> java -version
    java version "1.4.0-beta2"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
    Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)

    fantomas:te/> time java Compute
    9.0071993E15

    real 0m18.699s
    user 0m18.570s
    sys 0m0.030s

    Well, enough said.

    --
    "Man in the Moon and other weird things" - wfmh.org.pl/thorgal/Moon/
  79. 4 registers? by anarkhos · · Score: 0

    Good grief, talk about x86-centric.

    --
    >80 column hard wrapped e-mail is not a sign of intelligent
    >life
  80. Call to Arms by Anonymous Coward · · Score: 0

    Slashdot Trolls, I hereby call you to service to troll slashdot with anti-US, pro-terrorism trolls. Slashdot is just sitting here, ripe for the picking.

    So get to work boys and girls. Slashdot needs you in this time of opportunity.

  81. Funny thing is... by Anonymous Coward · · Score: 0

    The .NET CLR executes code at about 95% the speed of C, and there is no reason why it can't be ported to any platform you want.

    Plus, it has the added benefit of being language independent, and having a massive framework with a really good class library and common type system.

    But alas, you will all ignore it because it comes from Microsoft.

    1. Re:Funny thing is... by mikera · · Score: 2

      I will not ignore just because it comes from Microsoft. But I probably will end up ignoring it because Microsoft won't port the libraries properly.

      Not much point being able to run the bytecode if it can't access the network, the GUI or the filesystem.

      I will use and support .NET if and only if it results in *any* .NET program being portable to *any* system. That means no COM dependancies, no requirements for a Win32 OS, no MS-only protocols and properly open file formats. I'm not really expecting to see any of these. Are you?

  82. Virtual machine by bvankuik · · Score: 1
    From webopedia:

    VIRTUAL MACHINE - A self-contained operating environment that behaves as if it is a separate computer. For example, Java applets run in a Java virtual machine (VM) that has no access to the host operating system. This design has two advantages:
    • System Independence: A Java application will run the same in any Java VM, regardless of the hardware and software underlying the system.
    • Security: Because the VM has no contact with the operating system, there is little possibility of a Java program damaging other files or applications.

    The second advantage, however, has a downside. Because programs running in a VM are separate from the operating system, they cannot take advantage of special operating system features.
  83. Re:Faster -- with evidence by iapetus · · Score: 4, Informative

    I'm afraid your code is pretty much useless for testing Java vs C++ performance. If you'd checked out the Sun FAQ on benchmarking Hotspot you'd have seen something like this:

    I write a simple loop to time a simple operation and HotSpot looks even slower than Java 2 SDK. What am I doing wrong? Here's my program:

    (Program almost identical to yours snipped, since it's setting off the lameness filters ;)

    You are writing a microbenchmark.

    Remember how HotSpot works. It starts by running your program with an interpreter. When it discovers that some method is "hot" -- that is, executed a lot, either because it is called a lot or because it contains loops that loop a lot -- it sends that method off to be compiled. After that one of two things will happen, either the next time the method is called the compiled version will be invoked (instead of the interpreted version) or the currently long running loop will be replaced, while still running, with the compiled method. The latter is known as "on stack replacement" and exists in the 1.3/1.4 HotSpot based systems.

    --
    ++ Say to Elrond "Hello.".
    Elrond says "No.". Elrond gives you some lunch.
  84. Jamie Zawinksi [was Re:Java is two things] by oops · · Score: 1
    Jamie Zawinski suggests that Java is 4 things.


    This document is quite old, so some of it has been addresed by successive VMs/APIs.

    1. Re:Jamie Zawinksi [was Re:Java is two things] by Anonymous Coward · · Score: 0
      Oh yeah, he's a good one. Part of the Netscape team, whose code was SO fucking great they had to trash the whole mess and start over from scratch.

      Yep, his opinion is worth a LOT...

  85. Use perl... by Anonymous Coward · · Score: 0

    ...to parse his paragraph. Anway, as the creator of Java I'd like you to show more respect for the language.

    Sincerely, Mike Bouma

  86. Re:Faster -- with evidence by angel'o'sphere · · Score: 1

    Nice try:

    [... C program deleted]
    [11:29pm || 24](~)> date && compute && date
    Fri Sep 14 23:29:06 EDT 2001
    15969064845312.000000
    Fri Sep 14 23:29:11 EDT 2001
    (5 seconds)

    And here:

    [java program deleted]
    date && java Compute && date
    Fri Sep 14 23:29:53 EDT 2001
    1.59690648E13
    Fri Sep 14 23:30:02 EDT 2001
    (9 seconds)


    Seems you are not even able to write a solid benchmar, but you allow your self to spread the informations you based on it?

    What did your c program test measure,
    date && compute && date?

    Basicly:
    1)loading a static compiled and (startic or dynamic?) linked c program
    2) and executing it.

    OTOH:
    What did your java program test measure,
    date && java Compute && date?

    1) Loading a jvm
    2) Loading a java class
    3) dynamic loading of referenced classes (java.lang.System, well allready laoded together 4) veryfying static safty of the program (illegal opcodes, illegal access to private data, checking about sandbox, etc.)
    with jvm)
    5) dynamic linking of the laoded referenced class
    6) jit compiling the now veryfied and linked bytecode
    7) executing the main routine

    Well, 6) happends during 7) ....

    So: either you make the calls to date/current-time inside of your programs just before and after your loop, to avoid os and linking overhead to falsify your measurement, or just wrap both loops by an additional loop to execute the inner loop 1000 times.
    Or, the clean way: make an empty C program, just printing: "done" and make an empty java program just printing "done".

    Substract the running time of the empty programs from the programs you are measuring.

    Botom line: in your example teh java program is at elast 2 times faster than the C program, test it by trying the proposed, more exact measurments above.

    Regards,
    angel'o'sphere

    (For the reason why the java program is faster, hint: check what float means in C and what float means in JAVA and how it is compiled to the underlying machine .... )

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  87. Do you even know anything about java? by Anonymous Coward · · Score: 0

    "Really? We're operating on giga- and tera- size datasets, with complex floating-point calculations"

    This is totally bullshit. Here at NASA we tried to use java, and guess what, is pure crap. Java is limited to 64Kb databases and it's floating point performance is really bad, mainly because it's based on old Sinclair ZX Spectrum ROM code (from 1982). Sun took the z80 code away, a crap C++ ripoff and sold it like the best thing since sliced bread. You'll get much better performance with modern languages like COBOL or PL/1.

    Yours sincerely, Mike Bouma (NASA Engineer)

    1. Re:Do you even know anything about java? by Anonymous Coward · · Score: 0

      You don't sound nearly intelligent enough to work at nasa.

    2. Re:Do you even know anything about java? by Anonymous Coward · · Score: 0

      Well, then you'd likely be plugged into the HPC world. So you probably have heard of the JavaGrande project and those wonderful things that Dennis Gannon is working on up in Indiana. You're ranting about the JVM - the language and JVM are independent things. The java language is just fine. The JVMs are what is junk, and if you replace them with a JVM optimized for a parallel system with a big pile of RAM, then Java isn't too bad.

  88. IVM has no source code for generated code by Anonymous Coward · · Score: 0

    There's a ton of generated code in there from what appears to be a grammar file but there is no grammar file, nor a code generator. As I said 6 months ago when this was first aired on Slashdot - this is completely useless non-open code.

  89. Open Source Innovation by richieb · · Score: 2, Interesting
    [...] It is very rare to see an open source project that does not just duplicate features but instead introduces radically new features and paradigms. There are some research projects that use open source to distribute their stuff but these generally play only a marginal role in the open source community. The big open source projects are all about duplicating and imitating the bigger/better (in most cases) propietary counterparts

    This is true in general. It is rare to see a project open source or proprietary that is really innovative and different. That's because it's easy to copy existing ideas than to think up and implement new ones.

    But remember that the Web (http, server, browser) were started as open source projects and today Apache is still one of the best web servers there is.

    If you look around there are number really cool open source projects that are way ahead of anything the propriatary world is doing. Here are two I like:

    Jazz - a Zooming user interface, as discussed in Jef Raskin's book The Humane Interface.

    Squeak - a ground up implementation of Smalltalk-80 which is being used in all kinds of explorations. One of the leaders of this project is Alan Kay (you've heard of him, haven't you?).

    Innovation can come from unexpected places. If more people get to play with the code, then it's more likely that someone will think of something really cool...

    ...richie

    --
    ...richie - It is a good day to code.
    1. Re:Open Source Innovation by jilles · · Score: 2

      Both these projects I would refer to as rather marginal efforts (interesting though). Squeak is essentially a smalltalk clone. I haven't heard of jazz yet (will check it out soon).

      I have heard of Alan Kaye. In fact I was about to listen to a keynote by him only last week(unfortunately it was cancelled at the last moment).

      --

      Jilles
    2. Re:Open Source Innovation by richieb · · Score: 1
      Both these projects I would refer to as rather marginal efforts (interesting though). Squeak is essentially a smalltalk clone. I haven't heard of jazz yet (will check it out soon).

      Squeak is an implementation of Smalltalk by the guys who invented Smalltalk in the first place. It's not the fact that it is Smalltalk that's important, but the kinds of projects they are doing.

      They maybe mariginal efforts because they are trying new things. When web was first implemented it was a "mariginal effort" as well. It's not easy to predict what innovations will take off.

      The point is that innovative open source software is being developed. You just have to look for it.

      ...richie

      --
      ...richie - It is a good day to code.
  90. what?? by Anonymous Coward · · Score: 0

    There's no new language being released here, just a new VM.

  91. What's the point? by iggie · · Score: 1

    I can already program in C/C++/Obj-C for just about any hardware platform and many OSes using a little gem known as gcc. Far more platforms and OSes I dare say than this VM. Now, if I could only invoke gcc to compile my down-loaded source code, then we really would have something. Something like RPM or dpkg, say.

  92. There is already a good alternative to Java by TCM_VA · · Score: 2, Informative

    -It supports many processors.
    -It is based on TAO's Intent.
    -There are currently STABLE "runtimes" for Linux and Windows, with more in development.
    -It's faster than Java.
    -Most programs run faster through the runtime than they would if coded in C for a native OS.
    -It has already been adopted by Sharp.

    It's called AmigaDE.

    1. Re:There is already a good alternative to Java by StClaraOperationIvy · · Score: 0

      AmigaDE can also host Java execution. Amiga software always did for performance, compatibility and less complication -contrary of Windows-, thus why had years ago its platform was been a hit in Europe. Amigas -always using a M68K- were a must for price/performance in business apps, running games, and if you'd some extra buck, you would even do video editing on them!! -- "My shameful troll statement will be rewarded by the laughs of yours."

  93. Java's use in numerics growing all the time... by Glock27 · · Score: 1
    Others have addressed some of your 'points' adequately, so I won't bother, but:

    The fact is, Java is NEVER used in serious numerical compution.

    It is still a young language, but its use seems to be growing all the time. The Java Grande Forum is an active and vocal group of scientists and numeric programmers who certainly seem to think Java has tremendous potential in those areas. A quote from the site:

    Java has potential to be a better environment for Grande application development than any previous languages such as Fortran and C++.

    2) Most scientists are not fancy programers and don't care too much about OO, garbage collection, and other frills.

    Most scientists who do a lot of programming (in my experience, and I work with several PhD physicists) are extremely interested in new techniques and technologies that'll make them more productive and result in robust, predictable programs. Java does a good job in both areas, and performance is very good with modern VMs.

    In short, as far as I can tell, you are clueless. :-)

    186,282 mi/s...not just a good idea, its the law!

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
  94. Distribution-specific Free Software? by John+Hasler · · Score: 1

    I'm resigned to the fact that commercial software usually "requires" RedHat, but I find it more than a little offputting that a Free Software project would do so.

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  95. In defence of c++ by Anonymous Coward · · Score: 0

    >The only place that Java beats other languages is the API. Large enterprises have a Java fetish
    > *not because it's portable*, but because their almighty productivity numbers go through the roof.
    > Where a C++ programmer has to code (or buy) linked lists, b-trees, hashtables, sockets, etc,
    > Java wraps it neatly into the language core.

    Ever heard of STL? A programmer who know STL well beats any Java programmer in productivity. The
    problem is that most people don't. And STL is inherent part of C++.

    As you said most Java programmers (or should i say most of all programmers) have no ideas about data
    structures and don't know how to use em. STL advantages compared to Java:
    1) easier to use. YES.
    2) shorter code to write. YES. And readable.
    3) type safe. No Object-s.
    4) faster. Native code.

    The first time I used Java data structure classes I had a feeling this was some-sort of screwed up
    and minimized copy of STL.

    The problem I see with C++ is that it has no one big entity promoting and advancing it. So there
    is no one huge unified API. But I largely think that C++ is underestimated. Wake
    up people, C++ has evolved during last years, and will do so. It's no VB, it's rocket science
    compared to that. And I'm a rocket scientist. Muahahahaha!

    Regards,
    dedicated C++ fan.

    PS: your benchamark doesn't show much
    PPS: you should try IBM's JDK, it's really fast with loops
    PPSS: In java the bytecode is precompiled during runtime. So to get REAL performance numbers
    you should place the code in main into a separate function and call that function multiple times.
    Now you just have the runtime compilation time in the 9 seconds.. Or don't tell me. You're the kind
    of programmer who's all programs look like that.

  96. MOD PARENT UP by egomaniac · · Score: 2

    What the hell is up with moderating the above post as a troll? There is absolutely nothing in there that any reasonable person could object to.

    The issue with companies shying away from the GPL is a fact. I don't mess around with GPLed code for that exact reason. I'm really hoping I manage to get that moderator in metamod *rubs hands gleefully*...

    --
    ZFS: because love is never having to say fsck
  97. The answer to my prayers.. by lukel · · Score: 1, Redundant
    For those of you out there who admire the portability of Java but want something faster or open source, the answer to your prayers is finally here.

    I've been living in a cave for 5 years praying for exactly this. I like java, the problem is it's so slow it wouldn't even run benchmarks. What's more, without being able to see the source code, how can you be sure Sun isn't using it to spy on you. The other thing I love about free software is how it is always well designed and bug free. Those guys at Sun and IBM think spending billions on R&D will somehow result in better software. It amazes how stupid they are: they just don't get it.

  98. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    Even the old 1.1 java could do math just as fast as C/C++. But, once you start allocating and freeing objects, C++ could be 20-50 times faster.
    If it's 20, that's almost ok, cause 90% of programs don't suffer much from being 20 times slower than they need to be. But when it's 50, it really is often an imposition on the patience of the user and their nerves to make them wait for a response every time they scratch.

  99. The problem with Java is the language by Dwonis · · Score: 2
    My biggest beef about Java used to be that it was slow and not backward-compatible across minor versions. People are saying that Java is faster, and I believe them. However, it is becoming apparent that Java is only a first-generation cross-platform language, and it has many design deficiencies.

    Java's second-biggest problem is that it seems to have been designed to run on a virtual machine (or a piece of custom hardware), rather than being translated to native code. This is what made it inefficient for so long. IBM has done a great job of working around this problem, but if it wasn't a problem in the first place, IBM could have spent the time making Java even faster than it s now.

    The largest problem I can see with Java, though, it that you're tied to the Java language. This is basically assuming that the Java language fits all for anything that needs to be cross-platform.

    My preference right now is the Amiga DE. It's a translated (rather than interpreted) version of assembly language, which means GCC could (at least in theory) have an amigade target. My beef with the Amiga DE is the fact that it's a proprietary standard, which may have been fine 10 years ago, but it certainly doesn't fit into today's reality of open standards.

    IVM looks promising in that it seems to address all the problems I've stated above. I hope it does well.

    (Please excuse me bad English. It's not my primary language in the morning.)

  100. Re:Faster -- with evidence by Steveftoth · · Score: 1

    Thing is, you program will give different results then the other program. Thanks to the inconsistancies of floating point.

  101. Re:Bin Laden's head? by Anonymous Coward · · Score: 0

    this is too big for anal and too small for oral, you moron.

  102. MOD PARENT DOWN by Anonymous Coward · · Score: 0

    The post was correctly marked as "troll" since Java is proprietary software of Sun Microsystems. You live in a dreamland of make-believe if you say otherwise.

  103. Re:Faster -- with evidence by rabidcow · · Score: 1

    So is there any quantitative way to measure the speed difference? Or is everyone just gonna argue back and forth with "My language seems faster than yours!"?

  104. Mod this idiot's misinformed misleading post down! by Anonymous Coward · · Score: 0

    He obviously doesn't know shit about Java OR benchmarking.

  105. Re:Faster -- with evidence by Leeji · · Score: 1

    The problem with what you (and others) suggest about using the HotSpot JVM is that it's not standard.

    If we're talking "pure" Java, I think a fair comparison should use the default JDK's javac, and the default JDK's java. Of course, we could compare times based on optimized JVMs -- but we wouldn't really compare "real" Java. Instead, we'd compare an imlementation of it.

    I agree that optimized JVMs are much more efficient that "pure java", but they convert much of your code to native code. That's a good thing, but drifts from "pure java." At that point, the line becomes fuzzy -- are we comparing "native vs Java" or "native vs (68% native and 32% bytecode)"?

    Also, I'd take the "JVM Initialization" argument with a grain of salt. If a program is slow, users simply say "this sucks. It's too slow." I have enormous amounts of respect for Java, its classloader, and portability -- but those still detract from its performance.

    Performance considerations included, though, Java is still my favourite and most used language.

    --
    It all goes downhill from first post ...
  106. Mod everyone in Slashdot down! by Anonymous Coward · · Score: 0

    They've all become incredibly stupid and dull.

  107. Re:Faster -- with evidence by greenrd · · Score: 2
    Yes, read the rest of the FAQ - but only if you accept that all benchmarks are valid only for certain types of applications. CPU-intensive benchmarks don't mean much for IO-intensive database apps.

  108. Re:Faster -- with evidence by greenrd · · Score: 2
    You don't need to. Write a class which is backed by a RandomAccessFile. Lazy evaluation!

  109. SlashTroll all over again by Osvaldo+Doederlein · · Score: 1

    Slashdot keeps posting articles about "Java killers" even when they are forced to rehash year-old products, articles and so-called benchmarks, that everybody have already seen (and dismissed) one year ago. Other recent example is Curl (which is new and will probably not succeed, but this will not stop Slashdot from posting dozens of "Curl kicks Java" articles in the following couple years until Curl fades into oblivion).

    When it comes to performance, I will not mention the obvious all over again (Java not being slow today etc) but rather point that you can produce an impressive gfx demo even with GW-BASIC, if you have a good interface to OpenGL (or other native, hi-perf graphics library) simply because it's the native code (and better: dedicated HW) that will be doing virtually all the hard work. These demos are worth nothing, unless you can see that the demo app is doing a significant amount of work before piping data to the native engine. But if you are a believer, just fetch JDK1.4.0-beta2 and the JCanyon demo from JavaOne which totally humiliates the tiny "spinning teapot" demos of all "Java killers" I can find.

    1. Re:SlashTroll all over again by StClaraOperationIvy · · Score: 0

      "When it comes to performance, I will not mention the obvious all over again (Java not being slow today etc) but rather point that you can produce an impressive gfx demo even with GW-BASIC, if you have a good interface to OpenGL (or other native, hi-perf graphics library) simply because it's the native code (and better: dedicated HW)"


      Ok. In case of you're wanting for "good performance", I recommend this "dedicated homework":

      - 1GHz+ cpu or G4
      - graphics card from a brand which provides decent API)
      - 256 MB RAM
      - fast SCSI hard drive if you intend your demo to fit it usable in a praxis environment.

      -- "Do you want to see a Win2K bug? Quite simple. Play a CD-ROM on it."

  110. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    "I'd rather hire someone who has C++ on his resume, and let him learn Java than do the reverse."

    We do exactly that where I work. We used to advertise job openings for "Java Developers" but we didn't get a single applicant who could write a function to reverse a linked list (in any amount of time and memory, much less in the optimal O(n)/O(1)).

    Now we advertise positions for people with "multiple object oriented language experience" and we've had MUCH better luck. It usually takes us about 5 days to get a C++ programmer up to speed on Java, since Java is almost a strict subset of C++.

  111. The real benefit of Java by ProtonMotiveForce · · Score: 0

    I'm sure someone mentioned this, but I don't see it. The real benefit of Java (duh) is client-server development. RMI is freaking beautiful and simple. Jini is pretty nice, too. There's no other language where client-server or peer-peer development is as easy as Java.

    A secondary benefit which I did see mentioned is ease of support/development. You go ahead and write your code in C/C++ - we'll see how quickly you can turn out your product and how easily you can extend and bugfix it.

  112. Re:Java *is* open source - if you don't touch it by Anonymous Coward · · Score: 0

    What an incredible piece of BS. Java, as Microsoft has learned the hard way, is the MOST CLOSED language there is. Simply adding a language extension (say, new keyword) might get you sued by Sun. I do not know of ANY other language with similar level of proprietary control.

    "Open source" is something you can actually use in other projects. If your goal is simply to look at the code, almost any company (even Microsoft) will let you do it under some restrictive agreement.

    I looked at the Sun's Java license and I see no principal difference between this license and MS NDA. Once you've seen the code, you are tainted in legal sense and technically unable to work on competing implementations.

  113. Re:Faster -- with evidence by BlackStar · · Score: 1
    If you're going to split hairs, split them on both sides of the part. Is gcc standard C in the object code? Is there such a thing? No. That's why writing ANSI C code, and writing portable ANSI C code are two different beasts as well. Machines are different. If you remove the JIT "Java Implementation" as you put it, then which platform is true Java, as they *all* convert byte code to machine code in the final stage.

    JVMs and the JITs like HotSpot are where things with highly abstracted languages are moving, as the runtime optimizations that are impossible otherwise become staggeringly powerful. It's a package deal. Java with HotSpot, gcc with -O 2 or better. :-)

  114. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    gcc is a shitty optimizing compiler. Try comparing Intel's.

  115. This is a bunch of half true things by georgeb · · Score: 1

    Oh God, you are soo wrong... How come you say "inherent design decisions in the way C programs work inhibit" security? Is not the "security" factor a thing that depends on the virtual machine itself rather than programming language? Do you really think that a badly implemented Java machine isn't a threat to security?

    Let's face it, the Java language is ONE thing, the Java virtual machine is ANOTHER thing! The fact that they share the same name is a historical incident. One could very well be programming assebley for the JVM as well as C as long as there is an assembler/C-compiler for this JVM.

    You keep talking here about the advantages of Java over C and C++ but you really don't seem to get the point: JVM is NOT a programming language! The IVM is NOT a replacement for Java but for JVM. The aspects of Java virsus C and/or C++ is something different and the so-called "security" issues of Java seem irrelevant for the JVM actually.

    1. Re:This is a bunch of half true things by mentin · · Score: 1
      You are also half right. Yes, Java as a language and JVM are different things, but when it comes to security, they are very related.

      Secure VM defines bytecodes and object operations in a way that it can easily verify. Any language that can compile down to these bytecodes and object operations is OK for this VM.

      Restrictions of JVM bytecode make it impossible to compile C++ code to effective JVM-code. On the other hand, Java can be compiled down to these bytecodes (actually they were designed to work together). So while Java and JVM are distinct things, they are very related.

      Pointer operations in C dictate completely different design for secure C/C++ VM. You can't trust any code in user space anymore, and you have to design VM similar to modern OS: trusted kernel + untrusted isolated user process. This will make its performance even more horrible than performance of Java.

      --
      MSDOS: 20+ years without remote hole in the default install
    2. Re:This is a bunch of half true things by georgeb · · Score: 1

      First of all I admit that anything I may say or might have said can be erronous -- I never got too close to this Java thing. But I will ask you to explain me some of your assertions.

      "Secure VM defines bytecodes and object operations in a way that it can easily verify"

      How is that? Do you mean that the Java processor defines concepts like "object"? As in "member of a class"? I'm quite sure that classes are high-level language abstract concepts that have nothing to do with the processor architecture. If what you are trying to say is that pointer operations can be easily be verified in a secure machine -- again I must ask you how is that different from the common page segmentations we see in all modern 32-bit and 64-bit processors?

      "...you have to design VM similar to modern OS: trusted kernel + untrusted isolated user process"

      So, I understand that architectures like i386, sparc, etc are not considered "secure" machines. Is that right? If this is the case and if the security of a machine as defined by the Java folks is so important, then why don't we see any "secure" physical machines?

      Then again, I restate that my knowledge of Java is quite scarce. But the JVM does not run any sort of OS to control parallel processes and stuff. You cannot run multiple processes on the same JVM. Can you? If you cannot have multiple processes, then why bother about security at all?

      Finally, you are stating that the security JVM provides is substituted in modern OSes via kernel restrictions as opposed to hardware architecture restrictions. So, is the Java security issue a matter of "software" restriction via "hardware" restriction? If I build myself a Java processor and run some application on it -- am I more "secure" than if I ported the app to Linux/C++ and ran it on my i386/Linux box? If these two setups are similar in terms of security then what's the point? We all are running secure OSes, aren't we.

    3. Re:This is a bunch of half true things by Anonymous Coward · · Score: 0
      I'm quite sure that classes are high-level language abstract concepts that have nothing to do with the processor architecture.

      An odd thing to say after the disclaimer about how you hardly knew anything about JVM bytecode. You were wrong, of course--a JVM does have opcodes like invokevirtual for calling methods, and only legal operations can be used on each value on the stack (whose type is deduced by the verifier, and must be consistent). RTFS if you'd like to know what you're talking about, but it should suffice that when we say JVM bytecode was designed so that you can statically verify it obeys the rules of the platform, we aren't kidding.

      A JVM mechanically disallows code that could access any private state of any object, with zero execution speed penalty. Using that and some simple ACL framework, the Java security model lets me run code without giving it unlimited access to all my privileges as a user. There are very few systems that offer such control (look up "capability-based"), and none are in widespread use.

  116. Qt/KDE Java bindings - best of both worlds by Anonymous Coward · · Score: 0
    With Qt and KDE bindings for Java, you get the best of both worlds:

    • the speed of Qt/KDE
    • the great language features of Java


    Check out the kdebindings module from KDE 2.2!
  117. you're as misleading as the OP by Anonymous Coward · · Score: 0
    The original post was misleading.

    Java is open source, at least for practical purposes. Sun has released the source to the entire Java standard library. ...
    ...
    I wouldn't put Java and C# in the same boat as far as "proprietary". You can't fork the Java code base directly, but Sun is really responsive to the community. Most new libraries are incorporated from user built packages, and all new features go through a community review. The bug database is open to the public. Sun provides open source repositories like jxta.org to help the community. Sun is the good guy... C# is Java Microsoftified and is evil (although a decent language) because it won't have this kind of community interaction and open source.


    Sun is not the good guy. Sun is not responsive. In fact I've never in my (1,2,3,4...) 5 years of programming Java have had a bug I voted for actually fixed. They're all still there and noticeable, even in 1.4. If you mention your corporations name they'll break functionality for you* but if you're Joe Schmoe they don't give a damn. Sure they show you bugs and let you vote but YOU CAN'T FRIGGIN' FIX THEM. Sun is just too damn proud for that - after all, their talented staff of programmers doesn't need any help.We recently hired a guy who left Sun's java dev. team (of his own volition) - he wrote the worst code I ever saw in my life. Seriously, second year CS students wrote better code than him. It pains me to think that he may be rejoining our dev. team in a couple of months. Looking into the depths of Java's code you see that kind of quality. You also see architectural choices which are extremely poor. Sun tends to either make things way too
    extensible and their sick version of OO or much too inflexible. Rarely do they hit it right. For instance a JFileChooser could be made to work with things outside of Java's implementation of the file system by simply using an interface (for either a JFile or JFileSystem) and instead they write in backdoor methods only available to those classes and completely unextensible - one of the reasons Sun uses the "protected" modifier to limit access by packages and not by inheritance is to help them write this kind of shitty unextensible API code.


    Sun is not the good one, Sun is
    another of the mediocre ones. They are barely above microsoft's use of C#. Calling the OP misleading for saying Java isn't open source is misleading in itself. It is nice to see the source but it would also be nice to fscking change and fix the source too. Right now, Java 's version of open source is only good for helping to determine whether or not to use the libraries and for figuring out how to get around bugs in their code. Oh, also the fact that the source is copyrighted and you promise not to redistribute it (no, really, go look at the agreements for which you clicked "OK") sort of effects that whole open source thing, too.

    *Everyone knows right click on a tree in a standard GUI environment affects selection state - to have it not should have had to have been the workaround, especially since the functionality was already written in there.

  118. Re:Faster -- with evidence by billr · · Score: 1

    I did your test. The java program was slower than the c version. It took an agonizing 370 milliseconds to complete as opposed to 230 milliseconds. I'd be willing to bet that most of the difference was due to jvm initialization.

    C:\>cat foo.c
    #include

    int main(void)
    {
    double x = 0;
    int counter;

    for(counter = 0; counter ntimer foo.exe
    15915492717639.054688

    ContextSwitches - 350
    First level fills = 0
    Second level fills = 0

    ETime( 0:00:00.230 ) UTime( 0:00:00.230 ) KTime( 0:00:00.010 )
    ITime( 0:00:00.000 )

    C:\>cat foo.java
    public class foo
    {
    public static void main(String args[])
    {
    double x = 0;
    for(int counter = 0; counter ntimer java foo
    1.591549271763905E13

    ContextSwitches - 351
    First level fills = 0
    Second level fills = 0

    ETime( 0:00:00.370 ) UTime( 0:00:00.300 ) KTime( 0:00:00.030 )
    ITime( 0:00:00.000 )

    --
    I've finally found the off by one erro
  119. What about AmigaDE? by Jace+of+Fuse! · · Score: 1

    What about AmigaDE?

    It's already got "Write Once" run (almost) anywhere functionality. True, it costs money, but Amiga Inc. isn't aiming for tiny little BS apps with this thing, they're aiming for full scale commercial games and applications. They're trying more to compete with DirectX than they are Java virtual machines, though AmigaDE does Java, too... so it's all win-win.

    Sorry, someone had to say it. :-/

    --

    "Everything you know is wrong. (And stupid.)"

    Moderation Totals: Wrong=2, Stupid=3, Total=5.
  120. I hate the word portability by Anonymous Coward · · Score: 0

    Portability is BS.. for both this and Java.

    What you're talking about is emulation. Gameboy games are more portable than java! (Yes, there are more platforms that have a gameboy emulator than a java interpreter)

    You know what a JVM is? It's a Java Bytecode emulator. So enough with "java is portable" crap. Anything can be as portable as java if you take the time to write an emulator for it.

    1. Re:I hate the word portability by mikera · · Score: 2

      Emulation is a perfectly valid way of achieving portability, so it's patently not BS. Anyway, most Java nowadays is using JIT compilation of bytecode into native machine langauge. So a modern JVM is only emulation in the sense that a C++ compiler is.

      JITs rock because they get you the performance of native code compilers with the portability of bytecode/intermediate langages. JIT, possibly combined with some features stolen from functional langages are the way of the future.

      You're perfectly right in that you can emulate any language using anything else. Therefore what matters using a standard platform that is widely available and efficient. Right now Java fits the bill better than anything else. I may change my opinion if .NET really takes off, but my guess is that it will tumble at the portability hurdle.

  121. Re:Faster -- with evidence by Anonymous Coward · · Score: 0

    wouldn't Integer.toString(x) convert the float to an int and then parse that int to a string?

    And wouldn't that not only be MUCH slower, but also yeld a different result ?

  122. Re:Faster -- with evidence by ameoba · · Score: 1

    Hrmm... a benchmark you say? If you've read Sun's Java licence, you'll have noticed that several things are forbidden; Use in medical equipment, nuclear power generation, aircraft control systems & publication of Java benchmarks.

    --
    my sig's at the bottom of the page.
  123. Objective C by lydic · · Score: 1

    If you use Objective C you eliminate the code & data separation problem, and have an object model nearly identical to Java. OTOH all of the other disadvantages still exist. The security problem isn't a big deal in a generic sense, anymore than any other program running on any computer; unless, you're planning on making this an engine for applets and servlets, like Java. In this case it would IMHO be a requirement.

  124. Realism - Re:Faster -- with evidence by RallyDriver · · Score: 5, Informative

    Your test isn't very comparable, because you are also measuring the startup time of a compiled binary (crt0.o) against the startup time of the JVM and byte-compile. Unless of course part of your point is that Java isn't suitable for writing Unix-style command line data filters and other apps with a short life of only 5-10 secs CPU, which I agree, it isn't.

    A better test would be to put the "date" commands into the code in both cases; perhaps I'll re-run them that way and post the results. Don't get me wrong, C will still win, the gap will just be a bit narrower.

    Having said that, I wouldn't advocate Java (yet) for something compute intensive, you are right on in that respect; however, you must note this:

    - very little software these days has CPU time as its limiting performance factor

    - in terms of the total cost of doing computation, CPU performance is getting cheaper and cheaper (Moore's Law) while developer time is getting more and more expensive.

    The cost in $$ to develop a straight line block of code of the compelxity of your loop body there is literally trillions of times the cost in $$ to execute it once, so unless it is in a place where it will be run trillions of times and performance matters, an easier to code language wins out over a faster one. There is a reason we aren't still all hand coding machine code in hex, and it's not a yes/no thing, it's a sliding scale moving effort form people to machines.

    Assembly -> C -> C++ -> Java -> ???

    We use pure Java for our server side web application. It runs with a servlet runner (Apache JServ) and we typically run a single VM ("java" command) for about 3-6 weeks, accumulating a couple of hundred hours CPU.

    The thing I find most interesting in your test is the speed ratio - despite the disadvantage that you've given Java, it's less than 2:1 which is better than I suspect most people would expect. This is number cruching, it's not what Java does well, althoguh the gap has closed enough for it not to be a concern. I saw a paper about 18 months ago (can't remember the reference)

    Nowadays, very few apps do enough computation to redline the CPU in any useful sense - the limiting factor is I/O.

    The real advantage of Java is not so easy to benchmark, and that is indeed developer productivity; the app is not rocket science, but it has some very useful platform layer caching between itself and the database. There is no way we could have gotten as far as we did with this with so few people in this amount of time if we had to build it in C++ and worry about type issues and garbage collection.

    This productivity advantage far outweighs the 25 to 50% performance penalty of using Java - the limiting factor in our app is not CPU, depending on the individual screen it's either I/O bandwidth to the browser or I/O speed to disk. Not much we can do about the former for end users (though we make sure customers using our admin tool get a cable modem / DSL) and our caching is making good strides at the latter. I have yet to ask a developer to recode an algorithm for **CPU efficiency**, though I do keep a close eye on database and filesystem I/O load, memory footprint (JVM heap), and HTML page weight.

    Assuming we can deliver pages to browsers close to as fast as the users' connections can handle them, the efficiency of the overall system to our business is measured in $$$, and includes the cost of developer time (lots) and the cost of hardware (small) - throwing hardware at it here **is** the right solution.

    For appservers, we use rackmount dual Pentium 3 pizza boxes, running two Sun 1.2.2 green threads JVM's on Linux; I picked up **twenty-two** of these, less than a year old, at the deja.com sell off in Feb 2001 for about 10 grand total. That won't even cover the fully loaded cost (salary, taxes, medical and Mountain Dew :) of one senior engineer for a month.

    Bear in mind guys, I'm not a suit, I'm a techie - I have a Ph.D not an MBA, and my background curiously enough is in one of the few areas where the CPU performance **does** matter, doing compute intensive stuff, mostly FORTRAN and C and mostly on hardware made by Cray Research. This gives me the perspective to know when and where performance matters, and I chose Java with that in mind.

    David Crooke
    Chief Technology Officer
    Convio

  125. More data - Re:Faster -- with evidence by RallyDriver · · Score: 2

    As promised, some tests with the timing rolled into the runtime environment. I did a couple of things:

    1. Tried to get more accurate timing resolution - for this I used System.currentTimeMillis() in Java, which is a wallclock time, and clock() in C which is CPU time, but since this is an approximate, compute intensive test I didn't feel it was a big issue. In 15 mins of man page archaeology I couldn't find a C or POSIX system call which gave sub-second resolution on wallclock, making part of my my point about C :-)

    2. Move the timing inside the programs, so it was only timing the loop (see speedtest.c and Compute.java below)

    3. Tried a couple of different versions of the Java VM - Sun's 1.2 JDK with no JIT, and IBM's 1.3 JDK with JIT, to see the difference there - this is not just JIT but also VM general improvements from version to version.

    4. Did a test of bundling the loop off into a subroutine so it would get the full benefit of the JIT; to trigger this I call it twice and measure the second pass.

    A further baseline observation: your "school's big Sun box" is clearly quite heavily loaded, because I tested using a cheesy old 500MHz P3 and it ran rings around those times. I know the Sun should be faster. This is another problem with benchmarking - what exactly are you measuring? The generally accepted rule is that wallclock on an otherwise idle system is the true measure, but if you're using a shared system, then **for this kind of test** CPU time is a fair proxy.

    I tested on the following platform:

    Intel Pentium 3, 500MHz, 100MHz FSB, 384Mb RAM
    Linux 2.2.12 (Red Hat 6.1)
    Running multi-user system, but largely idle

    I used the following compilers / JDK's:

    [glenfarg:dave]speedtest: gcc -v
    Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/sp ecs
    gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    [glenfarg:dave]speedtest: /usr/local/sun/jdk1.2.2/bin/java -version
    java version "1.2.2"
    Classic VM (build 1.2.2-L, green threads, nojit)
    [glenfarg:dave]speedtest: /usr/local/ibm/IBMJava2-13/bin/java -version
    java version "1.3.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
    Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20001124 (JIT enabled: jitc))
    [glenfarg:dave]speedtest:

    One interesting point - when I first tried Compute2.java, it was 10% slower than Compute.java on the Sun JDK, and about a wash on the IBM JDK. The default setting of Java VM's is to start with a modest heap size and dynamically increase it; I found that with the Compute2.java program, increasing the starting heap size with "-ms32M" improved performance in both cases, and those numbers are quoted below. You might argue that this makes Java seem very memory hungry, but that heap includes a lot of stuff besides your 10 lines of code - it doesn't mean it takes a 128M heap to efficiently run 40 line programs :-)

    The average quoted times over 10 runs each by the code, using the built in measurement, were as follows:


    C version-----------------: 0.78 sec
    Compute.java, Sun 1.2 JDK-: 3.39 sec
    Compute2.java, Sun 1.2 JDK: 3.51 sec
    Compute.java, IBM 1.3 JDK-: 1.24 sec
    Compute2.java, IBM 1.3 JDK: 1.09 sec


    As you can see, the performance once the JIT gets up to speed is not a million miles away from the compiled C - the latter shows about 28% saving in run time; making both use wallclock timing to get a like for like comparison might bring it one or two points closer.

    One might be amused to note that using "gcc -O2" instead of the default option made the C version about 6% SLOWER.

    As ever, a benchmark is only a benchmark - if you want a real test, use real code in a real scenario. YMWV.

    Enjoy
    Dave

    1. Re:More data - Re:Faster -- with evidence by RallyDriver · · Score: 2

      Here's the code I tested - when I posted I thought it wouldn't fit in the above comment, but actually the < signs were being truncated by the Slashcode parser:


      /* speedtest.c */

      #include
      #include
      #include

      int main(void)
      {
      float x = 0;
      int counter;
      clock_t start, end;
      float cpu;

      start = clock();

      for(counter = 0; counter < 10000000; counter++)
      x += (counter / 3.14159265359);

      end = clock();

      printf("%f\n", x);

      cpu = (end - start) / (1.0 * CLOCKS_PER_SEC);

      printf("%f\n",cpu);

      return 0;

      }

      ::::::::::::::
      Compute.java
      ::::::::::::::
      // Compute.java - moves timing inside JVM

      public class Compute
      {
      public static void main(String args[])
      {
      float x = 0;
      int counter = 0;

      long start = System.currentTimeMillis();

      for(counter = 0; counter < 10000000; counter++)
      x += (counter / 3.14159265359);

      long end = System.currentTimeMillis();

      System.out.println("" + x);

      System.out.println("Time: " + ((end-start) / 1000.0));
      }
      }

      ::::::::::::::
      Compute2.java
      ::::::::::::::
      // Compute2 - puts code in method and pre-seeds JIT

      public class Compute2
      {
      public static void main(String args[])
      {
      float discard = do_Compute();

      long start = System.currentTimeMillis();

      float x = do_Compute();

      long end = System.currentTimeMillis();

      System.out.println("" + x);

      System.out.println("Time: " + ((end-start) / 1000.0));
      }

      private static float do_Compute() {
      float x = 0;
      int counter = 0;
      for(counter = 0; counter < 10000000; counter++)
      x += (counter / 3.14159265359);
      return x;
      }
      }



  126. Re:Faster -- with evidence by RallyDriver · · Score: 2

    Horse output.

    What's non-standard about HotSpot? It implements the bytecode perfectly. It may not be the most common JVM, but it's certainly standard.

    That's like saying you have to do all performance tests of C++ using MS-Visual Studio on an Intel P3 running Windows 98, because it is the most common platform for compiled C++ code.

  127. Whole systems - Re:Faster -- with evidence by RallyDriver · · Score: 2

    I once found something kind of similar in a non-trivial case, which demostrates a more realistic scenario.

    A company I used to work for had an object data model stored in an RDBMS, with its own abstraction layer and tools to automatically generate the persister code, demand loading, etc. There were two implementations - one in Microsoft COM, the other in Java. This abstraction layer requires dynamic linkage of the kind not easily possible in plain C++, so it used COM objects for that in the C++/Windows version, and weak references and so forth in Java.

    One of the apps had a batch mode "engine" which ran overnight to do number crunching on the data; this was only avalable in a C++/COM version, hence only for NT (this predates COM porting tools). One large customer found Windows NT Server not to be man enough for the job (in those days, a quad Xeon 300MHz was your limit for Microsoft) and wanted the engine ported to their IBM SP/2,; as an experiment, rather than trying to port all the infrastrcture from COM to plain C++, one of the developers quickly recoded the engine in Java over a weekend (note the development time advantage).

    Well, as you've guessed, the Java version on the SP/2 was much faster and the customer was happy. This was in the days of JDK 1.1.7 when Java performance was not what it is today, but we expected that result with using hardware that was so much more powerful.

    More interestingly the Java 1.1 version was also faster than the C++/COM version on Windows NT - further testing revealed that the cost of the COM dynamic linkage over Java's much more elegant linkage model outweighed the then significant difference in computation performance of the plain compiled C++ vs Java bytecode.

    Clearly this can only have moved further in Java's favour with advances in the garbage collector and things like HotSpot - I don't think COM has advanced much in the last 3-4 years, at least not in performance.

  128. Won't be free if MS has patents by Secret+Coward · · Score: 1
    If a language is posted for standardization that means anyone can write their own compiler and distribute it without paying royalties.

    The royalties aren't for the language, it is for the patents associated with the language. The ECMA doesn't require MS to disclose its patents until two weeks before it goes to a final vote.

    Just because MS submitted it to the ECMA doesn't mean that they won't withdraw their submission (Sun did it twice with Java). Even if MS doesn't withdraw the submission, the ECMA could still reject it.

    The ECMA is completely irrelavent unless and until they accept C# as a standard and the world knows about all the related patents.

  129. Re:Faster -- with evidence by jovlinger · · Score: 2

    well,

    more to the point, hotspot will do very little for this example. Hotspot is a VM implementation in the style of SELF, and does a very bad job at compiling code the first time around; maybe even interpreting it directly. Then, when enough profiling data has been collected, it goes back and recompiles the code agressively, using the full profiling info to specialise code to be fast for the dynamic common case.

    Thus, hotspot is great for servers that have uptimes measured in weeks and programs with long common paths. You aren't going to see much speed in a small program, as your time will be dominiated by profiling costs, rather than payoffs.

    As for the classloading delay, people seem to accept an initial delay when starting an application (which can be augmented by quickly slapping up a splash screen), so this isn't really a real world issue.

  130. Language Issues by rice_burners_suck · · Score: 1

    I once saw an ad for a Java-to-machine-code compiler. (I think it was for Windows.) A free compiler like this would be really useful--imagine if you could bust out 99% of your program in Java, and do the time-critical portions in C. I don't currently do Java, but if something like this came along, I might seriously consider it.

  131. Re:Java is not open source by fizbin · · Score: 1

    Java is NOT open source, and any familiarity with the open source definition would tell you so.

    Yes, open source has a definition, and Java doesn't fit it, any more than PGP or qmail fit it.

    Think that it's "practically open source"? Tell you what - why don't you create an installation of java for some linux distribution your company has just created, and then try to convince your company's lawyers that you can distribute the binaries made by your automatic nightly compilation scripts. The Sun license forbids that. (One of the reasons java2 hasn't made it into Debian)

    Yes, you can (if you sign or click yes on the appropriate license) see the source, and yes that has its distinct advantages, and yes, the advantages of "visible source" (can we agree on that name for things like java, PGP, qmail and pine?) are some of the same ones touted by loud open source advocates, but it's still not open source. For example, you cannot even distribute the jdk to people not in your own organization; only the jre can be redistributed, and that only if you include enough of it.

    Note that I am grateful to Sun for being as open as they have been, and often look at the source myself when the javadoc api fails to answer a question about how a given class really behaves. However, it's not open source and we shouldn't pollute the definition by saying that it is. It's not the traditional "you'll see our source code over our dead bodies" attitude either, but something in-between.

  132. Re:Faster -- with evidence by Westley · · Score: 1
    Indeed - my mistake to suggest Integer.toString instead of Float.toString. This is just one reason why String.valueOf is a better idea.

    Of course, in this case no conversion is needed at all, as println can cope with a float perfectly well.

    (I suspect it wouldn't actually be slower than using String concatenation, but being wrong is definitely more of an issue.)

    Jon

  133. misdirected effort by Anonymous Coward · · Score: 0

    This is bottom up thinking here.

    Problem:

    No language will be widely used if it is not standardized with some open ended license so that Sun, IBM, Microsoft, etc can extend it.

    Sun blew it when they litigated for several years with Microsoft over java extensions. End result, Microsoft said that 'open source' with a restrictive license means you don't have 'freedom' to 'innovate' with your own extensions.

    Java's great, beats C++, and should have replaced C++ for development now. We'd still have platform differences, but they would be an order of magnititude smaller than windows vs unix.

    If Sun had let microsoft 'extend' java, we would have had 1000s of java literate programmers who could much much more easily move to java on unix programming.

    The end result here is that Microsoft will continue to push visual basic and visual c++ instead of pushing visual j++ (Java) and visual basic.

    I really do hope that Microsoft beats sun at sun's own game by fully releasing c# and allowing anyone to extend it without fear of litigation. I'd think we would see a unix port in short order.

    Sun was/is stupid about Java. They passed on XX billions of dollars spent doing java development by many win32 programmers.

  134. Back to school by georgeb · · Score: 1
    Ok, first of all thx for the link you have provided. It has proven useful and I have found a lot of answers there.

    Apart from that I cannot be very happy with the tone of your answer. I can understand your frustration, and I am sorry I am not as aware about the subj as you would expect, but every man/woman has to choose his/her areas of interest. My supposition that classes are abstract high level entities is based on my knowledge of computer architecture wich is not as scarce as my knowledge of the SPECIFIC architecture named JVM. I never said that I don't know anything about JVM, I just said that my knowledge does not excel in this particular area. I never had the opportunity (and admittedly neither the inclination) to study any specs or docs about Java (the machine).

    Further on, may I point out my finings resulting from the reading of these specifications.

    I have specifically looked for security mechanisms within the specifications and I have found the following:

    [Introduction]
    For the sake of security, the Java Virtual Machine imposes strong format and structural constraints on the code in a class file.


    More precisely:

    [Java Concepts]
    The class RuntimeException is a subclass of class Exception. The subclasses of RuntimeException are unchecked exception classes. Package java.lang defines the following standard unchecked runtime exceptions:
    • ......
    • SecurityException: A security violation was detected.

    [Structure of the Java Virtual Machine]
    These restrictions on operand stack manipulation are enforced, in the Sun implementation, by the class file verifier


    May I point that these seem to be the only references to security mechanisms within the specifications (which I take to be the official ones) for the JVM.

    Now, as I understand, .class files are bytecode containers. The more specific javalang.class has no role in defining the machine architecture rather it seems it helps define a special enviroment (how could bytecode contribute to defining the machine it is supposed to run on? does the Linux segfault code contribute to i386 architecture?). In this particular case - a secure enviroment. If these observations are correct then the logical conclusion is that security exceptions are a feature of the enviroment rather than the machine. The same stands true for any security-aware OS.

    The class file verifier -- now this is something more abstract and I find it difficult to understand the verifier's place in the whole mechanism. We know the verifier is run during the loading process. Code loding for any physical machine is done via internal code specific to that machine. For any virtual machine the loading code can be external -- specific to the host machine/enviroment -- or internal as well. Whatever the case -- it seems to me that the verifier is not part of the Java architecture but part of the enviroment, be it the one specific to the machine or to the host. One could easily imagine OSes fitted with various sorts of code verifiers in their code loaders -- similar to what I have deducted Java is doing.

    Now, I restate that my knowledge of Java is only scarce and these are first hand observations of a spec I have just encountered these days. Thx for the observation anonymous has kindly provided, but please understand that I am not trying to be cynical rather I am trying to see the bits I am missing from the whole picture.

    1. Re:Back to school by Anonymous Coward · · Score: 0

      In short (it's late), if code gets past the verifier, we know there's no way for that code to violate the rules of the platform (you can't modify bytecode, construct an object reference from arbitrary bits, invoke methods on objects that don't implement them, or access private state of some other object), so it can be safely executed without any runtime checks (other than downcasts, which are explicit in the bytecode). Objects managing precious resources can simply offer public methods that limit access or walk the stack looking for callers' credentials, because it's known that callers can't cheat. And yeah, one of Java's bigger problems is that Sun's verifier is proprietary.

      There's nothing wrong with not being an expert on everything or admitting ignorance. What's inappropriate is making definite blanket statements you have no basis for certainty on, especially when they're demonstrably false. It's disinformation, and the world is far better off without it.

    2. Re:Back to school by georgeb · · Score: 1

      You still haven't answered any of the questions I had asked. There may be a problem with "definite blanket statements" I "have no basis for certainty on" (for which I had stated my basis of probability actually) which are "demonstrably false" (which you haven't yet proved at all), but I had not made any definite statements either.

      About the verifier -- I know what the verifier DOES, but I can't see how it is part of the architecture at all, rather I can see how it's a piece of environment restriction. Never mind, you ought to read my post again and you should see my questions crystal clear. The Java machine is NOT more security-aware (or class-aware for that matter, BTW) than any other machine. The code loader and some of the basic libraries that are provided give it more security. Then WHY do people say that JVM is more secure and better implemented than any other real or virtual machine?!

      Then again, never mind, I don't think any of the Java gurus are gonna give me any answers -- their time and knowledge seem too important to be shared (cynicism intended).

      georgeb

  135. No Mac != Alternative to Java by mactari · · Score: 1

    Oh for crimminy sake, how many times must an article go up on /. where "Crossplatform" equals "Windows *and* Linux"? Not only is this danged IVM not Java (as http://slashdot.org/comments.pl?sid=21648&cid=2302 283 ably points out), it doesn't run on 5% of the world's computers out of the gate.

    There's no alternative to Java. As others have pointed out, match your tool to your task and you'll be happy campers. If you want Java, use Java, not some generic knock-off. (If you want Java, but love Bill, use C#, etc.) If you want C, use C. Far as I care, it's already crossplatform -- even Classic Mac compiles C. (yes, that was tongue in cheek)

    Ruffin "Wait until the story's cold to get KEEN mod points" Bailey

    --

    It's all 0s and 1s. Or it's not.
  136. Re:Faster -- with evidence by negacao · · Score: 1

    What? The java version took nearly twice as long! I think it's evident that as the complexity of the equation increases, java's computional speed decreases. :-P