Um, those shitty installers are a step backwards. I showed Portage to my 13 year old brother, and he thought it was great that you could install software just by typing one command, rather than taking several minutes to go find an installer, go find where you downloaded it, double click it, click next a dozen times, and finally start it. The portage CLI is easy, but the same thing can be achived with KPortage in a pointy-clicky fashion. Similar tools exist for urpmi and apt-rpm. In particular, the SuSE distro mentioned in the review includes the excellent YaST installer tool.
Tech support has been useless to me since I was in middle school. I've actually been told to *reinstall Windows* by a couple of techs! How is that possibly a solution to anything?* And I'm sure half the people here have had to pretend to go to "My Network Places" while running ifconfig from their Linux box.** Techs are so completely clueless these days. I remember back in the day (early '90s:) techs would be able to sit and debug IRQ conflicts with you. These days, its IR-Qwho? Now, if I have a problem with hardware, I usually just get an RMA on the POS and ship it back to them. Some places have online RMA forms, which makes it so you never have to deal with a tech.
*> And on top of that, how do they know I'm running Linux? **> MS is trying to trip me up, those bastards. I made the mistake of saying I was running XP, but unfortunately, they changed enough stuff from 2k that I couldn't remember where everything was...
although they say it's for our own good >>>>>>>>>> Its not so much for *your* good, as for the good of everybody else. You taking BSD code, and closing it up benifets only you. You developing GPL'ed code and being forced to release the changes helps everyone else. The original poster's analogy is exactly correct --- allowing indiscriminant killing helps whoever is strongest, but hurts everyone else. You supress the rights of the few for the good of everyone else.
Which is why Reiser4 is so great. While it may yet have some bugs (understandable for a brand-new FS running on a development-series kernel!) it was designed with robustness in mind. It does data-journaling in addition to metadata-journaling, so your file data is protected as well. And it does all this while being really fast!
Okay, I'll grant that most of the functional languages are too esoteric for a COBOL replacement, and C++ is too hard for a COBOL replacement. But what about Dylan? Its more OO than Java (OO like Smalltalk), more powerful (in a way) than C++, faster than Java (most of the time), and easier than Java (the prefix notation was dumped in favor of an infix notation). The thing missing is a large standard library.
Heh. The SAT II Math is so easy you can pretty much let a TI-89 take it for you. The 89 will do pretty much every problem on that test without any thinking on the part of the user.
Lots of languages are natively compiled, but fully portable. Its really more a matter of minimizing the cases of undefined behavior and providing a sufficient standard library, than running in a VM.
Isn't this a good thing? Don't you want to think about everything that wants to use register()? >>>>>> Okay, thought about it. Decided that all the objects that could get passed to that function support an appropriate register() method. In Python, I'm done. The solution works. In Java, in addition to thinking about it, I have to now go and modify all those classes to add an interface to it. Now the there is talk about adding optional type declarations to Python, to both allow better code generation and better type checking. In a language like Dylan (Lisp less so because the type declaration syntax is a bit kludged on) you can use dynamic typing for rapid prototyping, and tighten up the type declarations when you've got a stable interface. Coming from a C++ background, I was skeptical about dynamic typing at first, but in my experience using Python, I've found that the type checking usually doesn't buy you much. A bigger problem in Python than dynamic typing tends to be Python's tendency to auto-vivify class members. So a typo can result in a new member being attached to an object.
Java tends to not trust the programmer and forces the programmer to code in a standard fashion. >>>>>>>> I'm well aware of Java's tendency to babysit the programmer. This is a good thing?
If 2 languages have classes, inheritance, data-hiding, and polymorphism, I would say that they are at the same highness. Am I missing other features of python? I am not a python guru. >>>>>>>>>> Actually, Python doesn't have data hiding. In OOP you're not suppoed to ever access data members directly, so the odds of accidentally modifying a data member are rather minimal. Java sometimes crosses the line between assuming fallible programmers and assuming actively hostile programmers! Anyway, Python has a lot of features beyond Java: list comprehensions, lambdas, first-order-functions, dynamic compilation, a transparent iterator protocol, genericity, etc. If you look at languages like Dylan (which is more OOP than Java ---- even integers and doubles are full fledged objects!) you find additional features like multimethods, macros, and additional features to improve performance, like limited types, auto-boxing, type inference, etc.
If you're looking for the strengths of Java, I think you should ask what was Java created for in the first place? >>>>>> Not looking for the strengths, but why it requires a VM.
Flexibility? Once more, it's not about the type-system. It's about loading arbitrary code into your application server without shutting it down, or worrying too much that the code will crash your system. >>>>> But why does it require a VM? C/C++ can do the dynamic code loading via dlopen() and kin, and Lisp (and kin) do dynamic class loading while being safe. Both do this without a VM.
It's about then taking that code and running it somewhere else, in other hardware, without making any changes. >>>>>>>> How useful is this? If the code is source portable (something achieved by many languages) what's the big deal about one compile per platform? Or even a compile-at-install time setup?
Safety? The JVM is not there to check you're not messing up your pointers. It's there to check your bytecode is valid, has permission to do what it's supposed to do, and doesn't mess with anything it shouldn't. >>>>>>>>. Permissions is usually the domain of the OS kernel, not the language runtime. How is putting the thing in a VM any more secure than putting the code on a secure kernel?
Python is totally dynamic. Python functions can be completely generic. For example:
class bar(object):
def foo(self, obj):
obj.register(self)
bar::foo() is completely generic. It can register itself with any object, as long as that object supports the register() method. In Java, you'd have to define an interface and have all possible objects you're interested in registering with implement that interface.
Object oriented languages have similar capabilities, but they do *not* all offer the same abstraction capabilities. Java is a lowest-common-denomenator OO language. Its got classes, single inheritence, single-parameter polymorphism, and that's about it. It certainly doesn't have the abstractive capabilities of C++ (with templates) much less something even higher level like Python.
I hate you slashdot. Now, let's try this with the code samples in place?
I don't think 'Dynamicity' is a word. But hey, enlighten me? >>>>>>>> It's not a word. But I'm referring to how dynamic the language is. In Java, dynamic method invocation is very limited --- just basic single argument polymorphism. Other languages have much greater dynamic capabilities: For example, in Dylan (chosen because its syntax is easier for most people to follow), I can do the following:
let vec = make(<vector>, size: 100); //...fill vector... for(i from 0 below 100) do-foo(vec[i]); end;
Now, this will go through the vector, and call the appropriate version of do-foo for each time in the vector. The cool thing is that it doesn't matter what the types in the vector are, or how they're related. If they have a do-foo() defined for their class, the runtime will do the right thing automatically. In Java, to get the same effect, you'd have to use check to type of each variable, cast it to the right type, then call do-foo() for each type that could be in the vector.
Nup, not even. See 'instanceof' - which, although considered hackish among OOP elites, gives volumes compared to using void pointers in C. Then there's the whole polymorphism thing, but hey - C is procedural. >>>>>>>>> I said "almost" as inflexible as C. Certainly, its not any more flexible than C++. But either way, its not what I mean by flexible. Now, let's continue the previous example. The last Dylan example would run rather slowly, about at the speed the "giant switch on types" Java version would run. Now, if you don't need to store multiple types in the same vector, you can simply use a limited type. Just change one line to:
let vec = make(limited(<vector>, of: <integer>));
Now, as long as there is a do-foo() method defined for integers, the compiler will automatically specialize <vector> (think templates in C++) for the type, detect it can now statically dispatch the do-foo() method (because the argument will always be an <integer>) and most likely inline the do-foo() method into the loop. As a result, the loop will benchmark within spitting distance of C++ using the vector<int> template.
Someone correct me if I'm wrong, but AFAIK the JVM acts as a sandbox for Java applications/applets, stopping those which don't have the necessary permissions for privileged operations. This adds volumes to safety. >>>>>>>>> It only needs to do security checks because it is a platform as well as a language. In a natively compiled language, those security checks would be handled by the underlying OS. The main thing the underlying OS can't do is memory checking, which is why the JVM does bounds checks and whatnot. But compiler technology has advanced so far that you don't need something like the JVM to look at each memory access before allowing or disallowing it. Lots of safe languages (again, Lisp, Dylan, even C in the case of the SAFEcode project) are compiled to native code, with the compiler emiting only a few bounds checks here and there.
You also forgot the biggie: portability. C and C++ are portable to a degree, but require recompilation. >>>>>>> Lots of languages are natively compiled and fully portable at the same time. The requirement for portability isn't running on a JVM, but preventing platform-specific pointer manipulation, as well as specifying sizes for various objects. Again, there are lots of other languages that do this! Heck, even C++ is pretty good at this, as long as you avoid "implementation specific" operations (which are clearly marked as such). The only reason that Java seems more portable is the giant standard class library. You can get largely the same result by using Qt and some well chosen libraries like ACE.
If you want speed, get Linux and gcj it (never actually tried gcj trolls - sue me if it sucks
I don't think 'Dynamicity' is a word. But hey, enlighten me? >>>>>>>> It's not a word. But I'm referring to how dynamic the language is. In Java, dynamic method invocation is very limited --- just basic single argument polymorphism. Other languages have much greater dynamic capabilities: For example, in Dylan (chosen because its syntax is easier for most people to follow), I can do the following:
let vec = make(, size: 100);//...fill vector... for(i from 0 below 100)
do-foo(vec[i]); end;
Now, this will go through the vector, and call the appropriate version of do-foo for each time in the vector. The cool thing is that it doesn't matter what the types in the vector are, or how they're related. If they have a do-foo() defined for their class, the runtime will do the right thing automatically. In Java, to get the same effect, you'd have to use check to type of each variable, cast it to the right type, then call do-foo() for each type that could be in the vector.
Nup, not even. See 'instanceof' - which, although considered hackish among OOP elites, gives volumes compared to using void pointers in C. Then there's the whole polymorphism thing, but hey - C is procedural. >>>>>>>>> I said "almost" as inflexible as C. Certainly, its not any more flexible than C++. But either way, its not what I mean by flexible. Now, let's continue the previous example. The last Dylan example would run rather slowly, about at the speed the "giant switch on types" Java version would run. Now, if you don't need to store multiple types in the same vector, you can simply use a limited type. Just change one line to:
let vec = make(limited(, of: ));
Now, as long as there is a do-foo() method defined for integers, the compiler will automatically specialize (think templates in C++) for the type, detect it can now statically dispatch the do-foo() method (because the argument will always be an ) and most likely inline the do-foo() method into the loop. As a result, the loop will benchmark within spitting distance of C++ using the vector template.
Someone correct me if I'm wrong, but AFAIK the JVM acts as a sandbox for Java applications/applets, stopping those which don't have the necessary permissions for privileged operations. This adds volumes to safety. >>>>>>>>> It only needs to do security checks because it is a platform as well as a language. In a natively compiled language, those security checks would be handled by the underlying OS. The main thing the underlying OS can't do is memory checking, which is why the JVM does bounds checks and whatnot. But compiler technology has advanced so far that you don't need something like the JVM to look at each memory access before allowing or disallowing it. Lots of safe languages (again, Lisp, Dylan, even C in the case of the SAFEcode project) are compiled to native code, with the compiler emiting only a few bounds checks here and there.
You also forgot the biggie: portability. C and C++ are portable to a degree, but require recompilation. >>>>>>> Lots of languages are natively compiled and fully portable at the same time. The requirement for portability isn't running on a JVM, but preventing platform-specific pointer manipulation, as well as specifying sizes for various objects. Again, there are lots of other languages that do this! Heck, even C++ is pretty good at this, as long as you avoid "implementation specific" operations (which are clearly marked as such). The only reason that Java seems more portable is the giant standard class library. You can get largely the same result by using Qt and some well chosen libraries like ACE.
If you want speed, get Linux and gcj it (never actually tried gcj trolls - sue me if it sucks) - otherwise, live with it. >>>>>>>>> GCJ is pretty bad, not any faster than most JVMs.
I never really understood the whole point of the JVM. Why load this big program at every application launch? JIT still has more overhead than AOT compilation, in the real world, and most importantly, the huge memory footprint of the VM wreaks havoc on your caches.
What's the purpose of the JVM?
Dynamicity? No. Java is a aggressively static language. Meanwhile, highly dynamic languages like Lisp, Dylan, and Scheme (among others) can be efficiently compiled to native code.
Speed? While in theory a JIT can be faster, its not the case in practice. In the "Great Computer Language Shootout" (which isn't bad, as far as these things go) Java has an average CPU rank of 14, behind other static languages like C, C++, Ocaml, and SML, and behind dynamic languages like Scheme and CL as well! In reality, Java can only get within 90% of the speed of C for inner-loop numeric-type stuff (which lends itself to JIT optimization).
Flexibility? Java is highly inflexible. Its almost as as inflexible as C. It requires you to manually specify pretty much everything. You even have to do manual boxing/unboxing! Java is so highly structured, it should be compilable to native code that hits 90% the speed of C, without a very smart optimizer at all.
Safety? Given Java's lack of pointer types, it shouldn't need a JVM monitoring it to be safe. Again, there are lots of safe languages (Haskell, Clean, and the aforementioned dynamic languages) that don't require a runtime monitor.
Actually, I don't see much of a point in Java at all. Its got statically typed, but can't use that advantage to be as fast as C++. It runs in a VM, but can't use that advantage to be as dynamic as Python. Its syntax isn't any easier to use than something like Dylan (kinda like Lisp with a Pascal syntax) or Python. It doesn't have the development environment advantages of Smalltalk. Heck, its not even a very good compromise language ---- Dylan is as easy, often faster, and more powerful, Python is much easier (and thanks to Psyco) often as fast, C++ is much more powerful, as well as much faster, etc.
Interestingly, Python is a much higher level (as a language, not necessarily libraries) language than Java, yet the Python VM takes no time at all to start up.
There are lots of things you can't do with Java. Little CLI apps like 'ls', 'cd', etc, would be painful to use if they were written in Java, because of the startup costs of the VM. It takes GCC 0.004 seconds (ie: within measurement error) to startup and give me the usage message. It takes javac 0.330 seconds to do the same.
You can get most of the benifets of that from profile-guided optimizations. It would be unusual to see something whose flow patterns were too irregular to benifet from PGO, but were regular enough to allow the JIT to make good optimizations.
I second that. I don't use Gentoo because I think I can get a minscule 0.5% extra performance by compiling myself, but because of Portage, and the Gentoo community. Portage is awesome, and the source-based nature means that ebuilds come out extremely quickly, and are less subject to distro-specific "customizations" (read: quirks) than binary packages. All the ebuilds BreakMyGentoo.net, as well as the ebuilds posted to the bug tracker are a phenomenal example of how the power of portage allows a relatively small community to maintain a large software library. The Gentoo community is also one of the nicest out there (forums.gentoo.org, rocks).
That's not really a valid argument. In 300 years of existence, the US has built many cultural icons. The culture of America is brought from all places. >>>>>>>>>>>>&g t; I you look at it in terms of breadth, or depth, then its a valid argument. America has built many cultural icons, but to tell the truth, few are original. Most of our philosophy is imported wholesale from Europe. Our vaunted democracy already had a great deal of precedence. Sure, we've been remarkably successful in incorporating cultural patterns from all over the world, and we're good at executing the philosophy we think is useful, but I'd hardly say that this is reason enough to rank the US very highly on the scale of richest cultural heritage.
I define success as leading the pack. >>>>>>>>>>>>&g t; Thats a recursive argument. Leading the pack means being the most successful. The most successful by what measure? We've got the most money, yes, and the strongest military, and we're politically influential. That's about it. Now, if you define success as most Americans do (who has the most 'stuff') then yes, America is the most successful. But the standard money-power scale is an awfully limited definition of success.
PS> I don't want to seem overly critical. I do love the USA. Its one of the many great countries in the world to live in. We've got our problems, and other people have their problems. But the impression that I got from you (because of the 'sheep' comment) was the same one I get from those people who spout of "America is the greatest country in the history of the world!" Yeah right...
Re:Remarkably frank ...
on
In-Flight Reboot?
·
· Score: 2, Insightful
You're just restating the problem, without fundementally changing the situation. Why are your kids any more important than any other kids? Most importantly, why is it more important for you to have a toy (and you do buy toys, I'm sure) than for these children to have food? No matter how you approach it, you're justification comes out to "I'm a pussy-footed self-serving jackass" because, in reality, that's all our civilization lets us be.
It doesn't make me at all uncomfortable. It just disgusts me to see people treat human life with no dignity. Sometimes you have to kill people, which is something most people accept. However, being callous about it just shows how little you understand the gravity of the situation.
PS> And by "our civilization" I don't mean the "kill 'em all" hicks that have suddenly made a comeback in the US. I'm talking about human civilization as a whole --- the thing that seperates us from mere animals.
I think most millitary people would disagree with you, find find the statements about "killing machines" to be distasteful. Its a tradition in the military to behave honorably about these things.
The subtlety and tact isn't to make anyone feel better, or protect some people's delicate sensibilities. Its about showing respect for human life, even if you sometimes have to take it to protect yourself.
At least Americans live in the most successful country. >>>>>>>>> Depends on what you measure it by. Do Americans live the longest? Nope, the Japanese have that one. Are American's the most educated? America regularly ranks amoung the lowest in k-12 testing. Do they have the strongest families? Most American families struggle to just eat dinner together once a week. Do they have the richest cultural heritage? Some great stuff in DC, but if you're terribly impressed by that, you've never been to Paris, Rome, or any of a number of spectacular places in the world. Do they have the best public services? The US healthcare system is terrible --- in the inner cities, critical statistics like immunization rates are closer to those of developing nations.
There are any of a number of important criteria under which the US isn't at the top. Now, if you define "successful" as which nation has the largest GDP, then yes, the US is the most successful. But you could just as easily define sucessful in terms of the number of sheep...
Look at it this way: the next time you buy a nifty gadget, think about all those kids who could eat for months with the money you're spending on it. Think about the thousands of children dying, through no fault of their own, from starvation. Think about why you're not sending that money, instead, to those children.
Of course, that's unreasonable to ask. If we thought about that stuff all time, we wouldn't be able to live our lives normally. As human beings, we sometimes have to insulate ourselves from the darker side of our civilization. If you don't need that insulation, than I'd hate to meet you in person...
No, when he says install it, he means "type emerge " on the CLI.
Um, those shitty installers are a step backwards. I showed Portage to my 13 year old brother, and he thought it was great that you could install software just by typing one command, rather than taking several minutes to go find an installer, go find where you downloaded it, double click it, click next a dozen times, and finally start it. The portage CLI is easy, but the same thing can be achived with KPortage in a pointy-clicky fashion. Similar tools exist for urpmi and apt-rpm. In particular, the SuSE distro mentioned in the review includes the excellent YaST installer tool.
Tech support has been useless to me since I was in middle school. I've actually been told to *reinstall Windows* by a couple of techs! How is that possibly a solution to anything?* And I'm sure half the people here have had to pretend to go to "My Network Places" while running ifconfig from their Linux box.** Techs are so completely clueless these days. I remember back in the day (early '90s :) techs would be able to sit and debug IRQ conflicts with you. These days, its IR-Qwho? Now, if I have a problem with hardware, I usually just get an RMA on the POS and ship it back to them. Some places have online RMA forms, which makes it so you never have to deal with a tech.
*> And on top of that, how do they know I'm running Linux?
**> MS is trying to trip me up, those bastards. I made the mistake of saying I was running XP, but unfortunately, they changed enough stuff from 2k that I couldn't remember where everything was...
although they say it's for our own good
>>>>>>>>>>
Its not so much for *your* good, as for the good of everybody else. You taking BSD code, and closing it up benifets only you. You developing GPL'ed code and being forced to release the changes helps everyone else. The original poster's analogy is exactly correct --- allowing indiscriminant killing helps whoever is strongest, but hurts everyone else. You supress the rights of the few for the good of everyone else.
Which is why Reiser4 is so great. While it may yet have some bugs (understandable for a brand-new FS running on a development-series kernel!) it was designed with robustness in mind. It does data-journaling in addition to metadata-journaling, so your file data is protected as well. And it does all this while being really fast!
Okay, I'll grant that most of the functional languages are too esoteric for a COBOL replacement, and C++ is too hard for a COBOL replacement. But what about Dylan? Its more OO than Java (OO like Smalltalk), more powerful (in a way) than C++, faster than Java (most of the time), and easier than Java (the prefix notation was dumped in favor of an infix notation). The thing missing is a large standard library.
Heh. The SAT II Math is so easy you can pretty much let a TI-89 take it for you. The 89 will do pretty much every problem on that test without any thinking on the part of the user.
Lots of languages are natively compiled, but fully portable. Its really more a matter of minimizing the cases of undefined behavior and providing a sufficient standard library, than running in a VM.
Isn't this a good thing? Don't you want to think about everything that wants to use register()?
>>>>>>
Okay, thought about it. Decided that all the objects that could get passed to that function support an appropriate register() method. In Python, I'm done. The solution works. In Java, in addition to thinking about it, I have to now go and modify all those classes to add an interface to it. Now the there is talk about adding optional type declarations to Python, to both allow better code generation and better type checking. In a language like Dylan (Lisp less so because the type declaration syntax is a bit kludged on) you can use dynamic typing for rapid prototyping, and tighten up the type declarations when you've got a stable interface. Coming from a C++ background, I was skeptical about dynamic typing at first, but in my experience using Python, I've found that the type checking usually doesn't buy you much. A bigger problem in Python than dynamic typing tends to be Python's tendency to auto-vivify class members. So a typo can result in a new member being attached to an object.
Java tends to not trust the programmer and forces the programmer to code in a standard fashion.
>>>>>>>>
I'm well aware of Java's tendency to babysit the programmer. This is a good thing?
If 2 languages have classes, inheritance, data-hiding, and polymorphism, I would say that they are at the same highness. Am I missing other features of python? I am not a python guru.
>>>>>>>>>>
Actually, Python doesn't have data hiding. In OOP you're not suppoed to ever access data members directly, so the odds of accidentally modifying a data member are rather minimal. Java sometimes crosses the line between assuming fallible programmers and assuming actively hostile programmers! Anyway, Python has a lot of features beyond Java: list comprehensions, lambdas, first-order-functions, dynamic compilation, a transparent iterator protocol, genericity, etc. If you look at languages like Dylan (which is more OOP than Java ---- even integers and doubles are full fledged objects!) you find additional features like multimethods, macros, and additional features to improve performance, like limited types, auto-boxing, type inference, etc.
If you're looking for the strengths of Java, I think you should ask what was Java created for in the first place?
>>>>>>
Not looking for the strengths, but why it requires a VM.
Flexibility? Once more, it's not about the type-system. It's about loading arbitrary code into your application server without shutting it down, or worrying too much that the code will crash your system.
>>>>>
But why does it require a VM? C/C++ can do the dynamic code loading via dlopen() and kin, and Lisp (and kin) do dynamic class loading while being safe. Both do this without a VM.
It's about then taking that code and running it somewhere else, in other hardware, without making any changes.
>>>>>>>>
How useful is this? If the code is source portable (something achieved by many languages) what's the big deal about one compile per platform? Or even a compile-at-install time setup?
Safety? The JVM is not there to check you're not messing up your pointers. It's there to check your bytecode is valid, has permission to do what it's supposed to do, and doesn't mess with anything it shouldn't.
>>>>>>>>.
Permissions is usually the domain of the OS kernel, not the language runtime. How is putting the thing in a VM any more secure than putting the code on a secure kernel?
Python is totally dynamic. Python functions can be completely generic. For example:
class bar(object):
def foo(self, obj):
obj.register(self)
bar::foo() is completely generic. It can register itself with any object, as long as that object supports the register() method. In Java, you'd have to define an interface and have all possible objects you're interested in registering with implement that interface.
Object oriented languages have similar capabilities, but they do *not* all offer the same abstraction capabilities. Java is a lowest-common-denomenator OO language. Its got classes, single inheritence, single-parameter polymorphism, and that's about it. It certainly doesn't have the abstractive capabilities of C++ (with templates) much less something even higher level like Python.
I hate you slashdot. Now, let's try this with the code samples in place?
...fill vector...
I don't think 'Dynamicity' is a word. But hey, enlighten me?
>>>>>>>>
It's not a word. But I'm referring to how dynamic the language is. In Java, dynamic method invocation is very limited --- just basic single argument polymorphism. Other languages have much greater dynamic capabilities: For example, in Dylan (chosen because its syntax is easier for most people to follow), I can do the following:
let vec = make(<vector>, size: 100);
//
for(i from 0 below 100)
do-foo(vec[i]);
end;
Now, this will go through the vector, and call the appropriate version of do-foo for each time in the vector. The cool thing is that it doesn't matter what the types in the vector are, or how they're related. If they have a do-foo() defined for their class, the runtime will do the right thing automatically. In Java, to get the same effect, you'd have to use check to type of each variable, cast it to the right type, then call do-foo() for each type that could be in the vector.
Nup, not even. See 'instanceof' - which, although considered hackish among OOP elites, gives volumes compared to using void pointers in C. Then there's the whole polymorphism thing, but hey - C is procedural.
>>>>>>>>>
I said "almost" as inflexible as C. Certainly, its not any more flexible than C++. But either way, its not what I mean by flexible. Now, let's continue the previous example. The last Dylan example would run rather slowly, about at the speed the "giant switch on types" Java version would run. Now, if you don't need to store multiple types in the same vector, you can simply use a limited type. Just change one line to:
let vec = make(limited(<vector>, of: <integer>));
Now, as long as there is a do-foo() method defined for integers, the compiler will automatically specialize <vector> (think templates in C++) for the type, detect it can now statically dispatch the do-foo() method (because the argument will always be an <integer>) and most likely inline the do-foo() method into the loop. As a result, the loop will benchmark within spitting distance of C++ using the vector<int> template.
Someone correct me if I'm wrong, but AFAIK the JVM acts as a sandbox for Java applications/applets, stopping those which don't have the necessary permissions for privileged operations. This adds volumes to safety.
>>>>>>>>>
It only needs to do security checks because it is a platform as well as a language. In a natively compiled language, those security checks would be handled by the underlying OS. The main thing the underlying OS can't do is memory checking, which is why the JVM does bounds checks and whatnot. But compiler technology has advanced so far that you don't need something like the JVM to look at each memory access before allowing or disallowing it. Lots of safe languages (again, Lisp, Dylan, even C in the case of the SAFEcode project) are compiled to native code, with the compiler emiting only a few bounds checks here and there.
You also forgot the biggie: portability. C and C++ are portable to a degree, but require recompilation.
>>>>>>>
Lots of languages are natively compiled and fully portable at the same time. The requirement for portability isn't running on a JVM, but preventing platform-specific pointer manipulation, as well as specifying sizes for various objects. Again, there are lots of other languages that do this! Heck, even C++ is pretty good at this, as long as you avoid "implementation specific" operations (which are clearly marked as such). The only reason that Java seems more portable is the giant standard class library. You can get largely the same result by using Qt and some well chosen libraries like ACE.
If you want speed, get Linux and gcj it (never actually tried gcj trolls - sue me if it sucks
I don't think 'Dynamicity' is a word. But hey, enlighten me?
// ...fill vector...
>>>>>>>>
It's not a word. But I'm referring to how dynamic the language is. In Java, dynamic method invocation is very limited --- just basic single argument polymorphism. Other languages have much greater dynamic capabilities: For example, in Dylan (chosen because its syntax is easier for most people to follow), I can do the following:
let vec = make(, size: 100);
for(i from 0 below 100)
do-foo(vec[i]);
end;
Now, this will go through the vector, and call the appropriate version of do-foo for each time in the vector. The cool thing is that it doesn't matter what the types in the vector are, or how they're related. If they have a do-foo() defined for their class, the runtime will do the right thing automatically. In Java, to get the same effect, you'd have to use check to type of each variable, cast it to the right type, then call do-foo() for each type that could be in the vector.
Nup, not even. See 'instanceof' - which, although considered hackish among OOP elites, gives volumes compared to using void pointers in C. Then there's the whole polymorphism thing, but hey - C is procedural.
>>>>>>>>>
I said "almost" as inflexible as C. Certainly, its not any more flexible than C++. But either way, its not what I mean by flexible. Now, let's continue the previous example. The last Dylan example would run rather slowly, about at the speed the "giant switch on types" Java version would run. Now, if you don't need to store multiple types in the same vector, you can simply use a limited type. Just change one line to:
let vec = make(limited(, of: ));
Now, as long as there is a do-foo() method defined for integers, the compiler will automatically specialize (think templates in C++) for the type, detect it can now statically dispatch the do-foo() method (because the argument will always be an ) and most likely inline the do-foo() method into the loop. As a result, the loop will benchmark within spitting distance of C++ using the vector template.
Someone correct me if I'm wrong, but AFAIK the JVM acts as a sandbox for Java applications/applets, stopping those which don't have the necessary permissions for privileged operations. This adds volumes to safety.
>>>>>>>>>
It only needs to do security checks because it is a platform as well as a language. In a natively compiled language, those security checks would be handled by the underlying OS. The main thing the underlying OS can't do is memory checking, which is why the JVM does bounds checks and whatnot. But compiler technology has advanced so far that you don't need something like the JVM to look at each memory access before allowing or disallowing it. Lots of safe languages (again, Lisp, Dylan, even C in the case of the SAFEcode project) are compiled to native code, with the compiler emiting only a few bounds checks here and there.
You also forgot the biggie: portability. C and C++ are portable to a degree, but require recompilation.
>>>>>>>
Lots of languages are natively compiled and fully portable at the same time. The requirement for portability isn't running on a JVM, but preventing platform-specific pointer manipulation, as well as specifying sizes for various objects. Again, there are lots of other languages that do this! Heck, even C++ is pretty good at this, as long as you avoid "implementation specific" operations (which are clearly marked as such). The only reason that Java seems more portable is the giant standard class library. You can get largely the same result by using Qt and some well chosen libraries like ACE.
If you want speed, get Linux and gcj it (never actually tried gcj trolls - sue me if it sucks) - otherwise, live with it.
>>>>>>>>>
GCJ is pretty bad, not any faster than most JVMs.
As for living with it, I
I never really understood the whole point of the JVM. Why load this big program at every application launch? JIT still has more overhead than AOT compilation, in the real world, and most importantly, the huge memory footprint of the VM wreaks havoc on your caches.
What's the purpose of the JVM?
Dynamicity? No. Java is a aggressively static language. Meanwhile, highly dynamic languages like Lisp, Dylan, and Scheme (among others) can be efficiently compiled to native code.
Speed? While in theory a JIT can be faster, its not the case in practice. In the "Great Computer Language Shootout" (which isn't bad, as far as these things go) Java has an average CPU rank of 14, behind other static languages like C, C++, Ocaml, and SML, and behind dynamic languages like Scheme and CL as well! In reality, Java can only get within 90% of the speed of C for inner-loop numeric-type stuff (which lends itself to JIT optimization).
Flexibility? Java is highly inflexible. Its almost as as inflexible as C. It requires you to manually specify pretty much everything. You even have to do manual boxing/unboxing! Java is so highly structured, it should be compilable to native code that hits 90% the speed of C, without a very smart optimizer at all.
Safety? Given Java's lack of pointer types, it shouldn't need a JVM monitoring it to be safe. Again, there are lots of safe languages (Haskell, Clean, and the aforementioned dynamic languages) that don't require a runtime monitor.
Actually, I don't see much of a point in Java at all. Its got statically typed, but can't use that advantage to be as fast as C++. It runs in a VM, but can't use that advantage to be as dynamic as Python. Its syntax isn't any easier to use than something like Dylan (kinda like Lisp with a Pascal syntax) or Python. It doesn't have the development environment advantages of Smalltalk. Heck, its not even a very good compromise language ---- Dylan is as easy, often faster, and more powerful, Python is much easier (and thanks to Psyco) often as fast, C++ is much more powerful, as well as much faster, etc.
Interestingly, Python is a much higher level (as a language, not necessarily libraries) language than Java, yet the Python VM takes no time at all to start up.
There are lots of things you can't do with Java. Little CLI apps like 'ls', 'cd', etc, would be painful to use if they were written in Java, because of the startup costs of the VM. It takes GCC 0.004 seconds (ie: within measurement error) to startup and give me the usage message. It takes javac 0.330 seconds to do the same.
You can get most of the benifets of that from profile-guided optimizations. It would be unusual to see something whose flow patterns were too irregular to benifet from PGO, but were regular enough to allow the JIT to make good optimizations.
I second that. I don't use Gentoo because I think I can get a minscule 0.5% extra performance by compiling myself, but because of Portage, and the Gentoo community. Portage is awesome, and the source-based nature means that ebuilds come out extremely quickly, and are less subject to distro-specific "customizations" (read: quirks) than binary packages. All the ebuilds BreakMyGentoo.net, as well as the ebuilds posted to the bug tracker are a phenomenal example of how the power of portage allows a relatively small community to maintain a large software library. The Gentoo community is also one of the nicest out there (forums.gentoo.org, rocks).
That's not really a valid argument. In 300 years of existence, the US has built many cultural icons. The culture of America is brought from all places.
>>>>>>>>>>>>&g t;
I you look at it in terms of breadth, or depth, then its a valid argument. America has built many cultural icons, but to tell the truth, few are original. Most of our philosophy is imported wholesale from Europe. Our vaunted democracy already had a great deal of precedence. Sure, we've been remarkably successful in incorporating cultural patterns from all over the world, and we're good at executing the philosophy we think is useful, but I'd hardly say that this is reason enough to rank the US very highly on the scale of richest cultural heritage.
I define success as leading the pack.
>>>>>>>>>>>>&g t;
Thats a recursive argument. Leading the pack means being the most successful. The most successful by what measure? We've got the most money, yes, and the strongest military, and we're politically influential. That's about it. Now, if you define success as most Americans do (who has the most 'stuff') then yes, America is the most successful. But the standard money-power scale is an awfully limited definition of success.
PS> I don't want to seem overly critical. I do love the USA. Its one of the many great countries in the world to live in. We've got our problems, and other people have their problems. But the impression that I got from you (because of the 'sheep' comment) was the same one I get from those people who spout of "America is the greatest country in the history of the world!" Yeah right...
You're just restating the problem, without fundementally changing the situation. Why are your kids any more important than any other kids? Most importantly, why is it more important for you to have a toy (and you do buy toys, I'm sure) than for these children to have food? No matter how you approach it, you're justification comes out to "I'm a pussy-footed self-serving jackass" because, in reality, that's all our civilization lets us be.
It doesn't make me at all uncomfortable. It just disgusts me to see people treat human life with no dignity. Sometimes you have to kill people, which is something most people accept. However, being callous about it just shows how little you understand the gravity of the situation.
PS> And by "our civilization" I don't mean the "kill 'em all" hicks that have suddenly made a comeback in the US. I'm talking about human civilization as a whole --- the thing that seperates us from mere animals.
I think most millitary people would disagree with you, find find the statements about "killing machines" to be distasteful. Its a tradition in the military to behave honorably about these things.
The subtlety and tact isn't to make anyone feel better, or protect some people's delicate sensibilities. Its about showing respect for human life, even if you sometimes have to take it to protect yourself.
At least Americans live in the most successful country.
>>>>>>>>>
Depends on what you measure it by. Do Americans live the longest? Nope, the Japanese have that one. Are American's the most educated? America regularly ranks amoung the lowest in k-12 testing. Do they have the strongest families? Most American families struggle to just eat dinner together once a week. Do they have the richest cultural heritage? Some great stuff in DC, but if you're terribly impressed by that, you've never been to Paris, Rome, or any of a number of spectacular places in the world. Do they have the best public services? The US healthcare system is terrible --- in the inner cities, critical statistics like immunization rates are closer to those of developing nations.
There are any of a number of important criteria under which the US isn't at the top. Now, if you define "successful" as which nation has the largest GDP, then yes, the US is the most successful. But you could just as easily define sucessful in terms of the number of sheep...
Look at it this way: the next time you buy a nifty gadget, think about all those kids who could eat for months with the money you're spending on it. Think about the thousands of children dying, through no fault of their own, from starvation. Think about why you're not sending that money, instead, to those children.
Of course, that's unreasonable to ask. If we thought about that stuff all time, we wouldn't be able to live our lives normally. As human beings, we sometimes have to insulate ourselves from the darker side of our civilization. If you don't need that insulation, than I'd hate to meet you in person...
None of the thousands of civilians who died in the US war on Saddam were mindlessly resorting to terrorism.