

Interview With James Gosling 216
Def Mango Raygun writes "There is an interview with James Gosling of Sun. He talks about some language features and why they happened. It's short, but informative"
"I've got some amyls. We could either party later or, like, start his heart." -- "Cheech and Chong's Next Movie"
more information (Score:5, Informative)
length (Score:5, Funny)
Re:length (Score:1, Offtopic)
info(text)=negigible
He's right you know!
Decimal arithmetic (Score:1, Redundant)
sPh
Re:Decimal arithmetic (Score:3, Informative)
Sorry, Java is more based on C then on Cobol.
Re:Decimal arithmetic (Score:1, Informative)
Java does not have a built-in arbitrary precision rational type. You could make one in 2-3 minutes though. No, it doesn't matter that it's not built-in because there's no helpful static optimizations you can do to make it faster. That's also why I chuckled at your "native data type in Common Lisp" since that's meaningless as a feature unless you've got hardware support for rational storage.
Re:Decimal arithmetic (Score:1)
Sorry, I don't get it. What does hardware support have to do with it? What about it renders rational numbers in Lisp meaningless?
Re:Decimal arithmetic (Score:2)
Nor does COBOL. Perhaps you're thinking of Scheme [schemers.org]?
Anyway, COBOL users that have a clue (e.g. the UK Revenue Service) use 128 bit integers for monetary amounts - decimals are, er, pointless.
Re:OT: Visual COBOL Lives! (Score:2)
Huh? (Score:5, Funny)
Next week on Slashdot: Taco interviews himself.
Re:Huh? (Score:5, Funny)
Next week on Slashdot: Taco interviews himself.
The difference is this interview is interesting, and James Gosling knows how to spell.
Where will Java be in five years? (Score:2, Interesting)
I myself code just about everything in a server-sided web application. I can extend this to the desktop using Java, but to date have not seen a need. I know it takes more time this way than to fire up Visual Basic and create an application that way, but I don't run Windows, and my programs work on just about any system.
As for the imbedded market, Java has the capabilities, but I don't know if developers are going to embrace it much with licensing issues, code changes between releases, and the increasing number of non-Java tools that effectively get the job done.
Five years? Java will be with us, and there will be more of it out there. That might really be its peak usage before it falls like RPG, COBOL and other great languages that revolutionized computer program development.
Re:Where will Java be in five years? (Score:5, Insightful)
What are you using for web development?
-jon
Re: what are you using for web development? (Score:1)
Re: What are you using for web development? (Score:2)
Short, informative, and funny! (Score:5, Funny)
So, personally, you could delete [the] JDBC [API] from [the] J2SE [platform] and it would not affect any code that I've ever written.
And this:
That would make [the] Java [programming language] much more flexible.
And this:
Is it possible to submit the Java [technology] bytecode specification to a standards body like ECMA [and the like]?
Sheesh. This interview was brought to you by the letters "[" and "]".
Re:Short, informative, and funny! (Score:2, Interesting)
Your post is funny but this is a real issue. The company I work for wantJAVA [wantjava.com] had to change all their content to be In accordance with Sun's Trademark Policy. So now our site is covered with "[TM]". We also can't even use the name wantJAVA anymore.
From our Espresso Pricing page:
J2EE[TM] 1.3.1
JMS[TM], CMP[TM], JNDI[TM]
JMX[TM] Based
JCA[TM], JTA[TM]/JTS[TM]
I guess they need to protect their trademarks.
Re:Short, informative, and funny! (Score:2)
That's how we do it, anyway.
Re:Short, informative, and funny! (Score:2)
That would make [the] Java [programming language] much more flexible.
Actually I didn't read this as marketing speak at all. I thought they were making real technical distinctions. As Gosling pointed out in the interview, there are important technical differences between Java the language and Java the set of frameworks.
In the quote above, for example, the speaker was talking about only the language, not the frameworks. The added words disambiguated the question so that its technical meaning was clear for those who don't yet understand the different things that the term "Java" alone can mean.
Re:Short, informative, and funny! (Score:3, Funny)
which is why they're all called Java (TM).
Re:Short, informative, and funny! (Score:1, Funny)
In response one of the developers sent out a spoofed message about name changes to popular parts of the platform:
java -> java[tm]technologybytecodeinterpreter
javacc -> java[tm]programminglanguagecompiler
and so on.
The powers in change where not amused.
ECMA repot? (Score:1, Redundant)
Java as ECMA standard? (Score:5, Interesting)
From the article:
JDC: Is it possible to submit the Java [technology] bytecode specification to a standards body like ECMA [and the like]?
JG: Well, we actually tried to do that; to submit it to ECMA. And that exploded and turned into a rather bizarre episode. And actually, after that exploded, ECMA did an internal investigation and published a report, which is very interesting reading.
Does anyone know what he's talking about? I saw this interview a while ago and have looked around in vain for the report he mentions. This would certainly be interesting, especially if, as I somehow suspect, Microsoft did something to prevent Java from becoming a standard.
Re:Java as ECMA standard? (Score:2)
JavaWorld story (Score:5, Informative)
The March 2000 JavaWorld [javaworld.com] has an interview with ECMA officials that, as Gosling says, makes for interesting reading:
"They just don't want to give up control" of Java, said Jan van den Beld, secretary-general of ECMA. "It is 100 percent my opinion that Sun is publicly saying they want to make Java a standard, but privately not making it happen."
Re:Java as ECMA standard? (Score:3, Insightful)
Nevertheless, I'll hazard a guess.
There is the old joke about a camel being a horse designed by a committe. Java is Sun's "baby" and if left to the vagaries of the standards body, somebody, sometime, somehow would manage to sabotage the integrity of the design. It's gotta be real easy to change Java to be more "programmer friendly", a la Virul Basic, and lose the integrity in the process.
Re:Java as ECMA standard? (Score:2)
That's has to be the funniest thing I've heard all week.
Java has some very nice featues, but design integrity is not one of them. It's supposedly an OO langanguage, but not everything is an object. Nor can you extend many basic types (such as String or Integer). You are often forced into a declarative programming style where an OO-style would be more natural (e.g., try getting the absolute value of an Integer). You can't iterate over collections without explicitly creating a superfluous, temporary Iterator object. There are numerous inconsistencies among class methods named 'add' and 'put'.
Anyway, the bloated Java class collection couldn't do much worse under ECMA than the JCP.
better codes (Score:1)
"try getting the absolute value of an Integer"
int x = y;
if(x < 0)
x *= -1;
System.out.println("The absolute value of x is " + x);
"You can't iterate over collections without explicitly creating a superfluous, temporary Iterator object."
ArrayList arl = arl2;
for(int i=0;i<arl.size();i++)
{
String s = (String)arl.get(i);
System.out.println(s + " was retrieved without the use of a superfluous, temporary Iterator object.");
}
As you could see, these codes are easy to do. If you are having more questions then ask.
Re:better codes (Score:2)
Which is fine until you get handed a linked list instead, and your algorithm goes from N to N^2. I like to write iterators like this:
for(Iterator i=list.iterator(); i.hasNext(); ) {
SomeClass obj = (SomeClass)i.next();
}
So there is a temporary iterator object, but it's only in the scope of the for loop so it doesn't really bother me. I'm actually more annoyed with the cast, hopefully the generics in 1.5 will take care of that.
Re:Java as ECMA standard? (Score:2)
However, you can't get an absolute value of an Integer? Ever try Math.abs(Integer)? It takes the absolute value of an integer. Perhaps you wanted it back as an object? Well, since int is not an object, you can always wrap it inside another Integer. Like "new Integer(Math.abs(Integer))". In both clases, replace "Integer" with your Integer object. This may not have the syntactic sugar as some languages, but its exactly what goes on under the covers if ints are not objects. Seems pretty straightforward to me.
Of course, if Java had real generics, you could add these methods to the generic number class. Then the math functions wouldn't have to be in a separate class. But that's a different story. (yes, generics likely will be flawed when released, too, due to some design details concerning the JVM).
Re:Java as ECMA standard? (Score:2)
Re:Java as ECMA standard? (Score:2)
That made my day. Now I *know* I'm on the right track.
Related information (Score:4, Informative)
http://www.computerworld.com/storyba/0,4125,NAV
Gosling on netbeans -- (03/2002)
http://www.netbeans.org/articles/inter
An old interview from 2000 -- more on java http://www.devx.com/judgingjava/articles/gosling/
Another from 1999 --
http://www-106.ibm.com/developerworks/features/
S
[The] editing [job] (Score:5, Funny)
What Java really needs... (Score:2, Interesting)
It's not a general purpose platform or language, imho, however. But there is one thing that would make it that way... hardware VMs... which would be JavaMs, of course, since they wouldn't be virtual.
Where are the processors that run the java code on the chip directly?
Re:What Java really needs... (Score:2)
I dunno. I can do the same without having to recompile every time I make a change [php.net].
And it's open source :)
two words (Score:1)
Re:What Java really needs... (Score:2)
Do you care if you have a Transmeta or Intel chip to run x86 ops, aside from sheer performance?
Or put this way, so what if it's dynamically translated?
Secondly, picojava (?) chips do this. You can buy the core from Sun, and put them on your own chips. So, they actually do exist, but because they're all stack-based and in other ways fairly odd, you could probably do better with a dynamic translator than a silicon implementation, especially once you factor in volume.
-Dan
ARM and others do this already (Score:2, Informative)
If you want good realtime with java... (Score:2, Informative)
It runs on linux too!
I may be a little biased though...
Don't see any cost or license information there (Score:2)
Also, it wasn't clear whether or not it was entirely aimed at embedded systems, or whether it supported some kind of Swing-equivalent library. Or, perhaps Swing was what you were supposed to use. But would it work? You mention that you have your own JVM, but you don't say anything about "binary compatible" etc., and even awt contains a lot of compiled code.
Java features (Score:4, Insightful)
1) Why are classes like Integer so weird? It is such a pain to, for example, increment them... Change of this would conflict with absence of operator overloading, true (I don't like that too much either, but at least can imagine why it's (not) there). However, why not make them magical like String's "+"?
2) Several times I got caught on the fact that there is no way to pass an int by reference. And I don't like Integer (see aboive)...
3) One (public) class per file. This especially bugs me with small interfaces. Such a waste of screen space and disk space (each file takes up 4k on the file system)... Why not allow to put a hierarchy of interfaces (and, preferably, classes) in one file?
This wasn't intended to be troll, even if it looks and feels like one.
--
I like '...' (and (nested) parens)...
Re:Java features (Score:3, Insightful)
3) One (public) class per file. This especially bugs me with small interfaces. Such a waste of screen space and disk space (each file takes up 4k on the file system)... Why not allow to put a hierarchy of interfaces (and, preferably, classes) in one file?
Well, this is really a classloader limitation... there's no restriction to loading classes from a databse, across the network, from your back pocket, etc, as long as you've got an appropriate classloader.
Besides, there are those things called JAR files... have you used Java much?
Re:Java features (Score:3, Informative)
2) I Agree with this, but some people argue that you should use the return value or create your own mutable wrapper of int.
3) Try using Inner classes. I like the idea of the filename matching the classname as it makes it easier to browse trough code and reduces source control conflicts.
Re:Java features (Score:4, Informative)
Why are classes like Integer so weird?
Because they're an afterthought. Java was originally designed without the primitive equivalent reference types and they were tacked on later to solve some problems which emerged. Basically, the problem was that there was no type that included both Object and the primitive types, which made reflection and collections hard to deal with.
The original decision not to make the primitives objects is one of the Great Mysteries of All Time. Sun say its for "efficiency reasons", but Java's antecedent languages (Smalltalk, Lisp, etc) solved the same problem using type tags, so primtives look like objects even though they are implemented differently, and indeed the best VMs actually do this internally for other reasons.
Essentially, its a mistake, IMHO.
Several times I got caught on the fact that there is no way to pass an int by reference. And I don't like Integer (see aboive)...
Java's basically an OO language. You can use it in non-OO ways, but you tend to run into problems like this. Basically, if you want to return more than one value from a method, you should probably group them together in their own class. If you want to use the return value to return an error code, you should learn about exception.
I program in Java every day, and the inability to return multiple values is not a problem for me in practice.
One (public) class per file.
.class files act as header files as well as binaries. In order to preserve the sanity of programmers, the compiler builds any unbuilt sources. To do that it has to find them. Hence the "file must have the name of the public class" rule.
Re:Java features (Score:1)
public class NAMESPACE1 {
static public class NAMESPACE2 {
static public class MyClass {
public String toString(){ return "hah!"; }
}
}
static public void main(String [] a) {
System.err.println(new NAMESPACE1.NAMESPACE2.MyClass().toString())
}
}
I frequently code small standalone apps this way. Everything in a single wrapper class, just one big file.
Joe
Re:Java features (Score:3)
I'm pretty sure you can't change the value of an Integer, just like String. This is for efficiency. I'm sorta of two minds about not including operator overloading in the language, I love it in C++, but it can be good to have code that novices can read.
2) Several times I got caught on the fact that there is no way to pass an int by reference. And I don't like Integer (see aboive)...
Create your own container class. But passing int's by reference doesn't sound very object oriented, perhaps a change in style would be more appropriate. I have never run into the problem myself. I sometimes do it in C++, but I consider it a bad habit...
3) One (public) class per file. This especially bugs me with small interfaces. Such a waste of screen space and disk space (each file takes up 4k on the file system)... Why not allow to put a hierarchy of interfaces (and, preferably, classes) in one file?
I couldn't disagree with you more. Having a file per public class makes browsing other people's code much easier. It's a habit I have adopted in C++. grep is a wonderful thing, but it can break the flow when you're reading code in an editor. Wasting 4k on the file system isn't much of a problem, even on embedded systems. If it really really bothers you use a compressed file system or make you're inodes smaller, remember class files are minute compared to compiled code so you end up using much less space overall.
Why Bill Joy still doesn't like templates puzzles me the most. I'm sure it could be done elegantly in Java.
Re:Java features (Score:2)
Create your own container class. But passing int's by reference doesn't sound very object oriented, perhaps a change in style would be more appropriate. I have never run into the problem myself. I sometimes do it in C++, but I consider it a bad habit...
Agreed, its a bad habit. Its a case of a function/method doing two or more things at once, improperly designed. If you need a return value to determine success, switch to a function that returns the changed/new value and fire an exception when failure happens. And just get used to catching exceptions.
try {
...
i = nextIntFromDatabase(i);
} catch (SomeDatabaseException e) {
}
Re:Java features (Score:2)
Suppose I could write my own primitive model/view framework... but that kinda kills the point of using a feature rich language in the first place
Re:Java features (Score:2)
Re:Java features (Score:1)
It's because they're immutable wrappers, just like String is.
[T]here is no way to pass an int by reference.
There's a kinda lame way: int[] intReference=new int[1];
One (public) class per file.
It's so you can swap implementations of individual classes in and out without disturbing the rest of a project. Given, of course, that the class signature doesn't change...
When in doubt, quit your job.
Re:Java features (Score:2)
Ummmm, what decade are you living in? A 120G drive, which would hold about 31 million of those 4K source files. Each million source files costs you about 15c. You must be one hell of a prolific programmer!
Ohhhh, wait a minute, you're probably buying your disk drives from Sun, where it's $1400 for a 36G drive. I guess at 18x the price, that would make a difference
hjava? (Score:1, Funny)
from the learning-more-about-hjava dept.
And I thought to myself, what is this new fangled hjava that I have heard nothing about and what is there to learn?
Then in my excitement, I realized it was just a typo...
Questions left unanswered... (Score:5, Funny)
2. Why do so many Java developers get so upset when you point out how damn slow Java really is?
3. Why is it so much fun to pick on Java developers when there really are slower languages out there?
4. If you could make Java fast, would you voluntarily leave it slow just so we could give Java developers apoplexy by mentioning how fast even PHP is for certain tasks?
Preemptive "faster than C" counter-troll (Score:3, Insightful)
Re:Preemptive "faster than C" counter-troll (Score:2)
SMALL CORRECTION (Score:2)
Answers... (Score:3, Informative)
2. They're not upset; that's the sound of Java developers rolling around in the large piles of money they make writing software that people actually use.
3. Because it's easier to nitpick the best product than it is to find all of the memory leaks and bad pointer refs in the C++ code written by l33t hax0rs.
4. Yes; if you can amuse your inferiors at no cost to yourself, why not bring some joy into their sad lives?
-jon
You work for Sun, dont you? (Score:1, Flamebait)
The real answers are :
1. So that Sun (and IBM) can sell more hardware in order that Java developers can even run a "Hello World" type program.
2. This is human nature. The Catholic church behaved the same way when Galileo pointed out the error in their doctrine.
3. Everyone has their own reasons. I like picking on the unthinking masses.
4. Thats a bit like asking "If you could make a perpetual motion machine...."?
Re:Questions left unanswered... (Score:2)
2) Because Java is still the fastest OO language for server-side programming. Perl & PHP are faster but not object oriented. Servlets and JSPs are fast in large part due to extensive object pooling (although they've got some architectural flaws. tag libraries are my answer--all the performance of JSPs & Servlets with true separation of Model & View). And, besides, for loops that get executed frequently, HotSpot doesn't do a bad job with runtime optimization (and it's a *lot* easier than writing apache modules, the only way you'll get superior performance under Apache with C++).
3) FUD? See #1, 2?
4) See #1, 2.
Look, people don't choose Java because it's the tightest language available. They do it because it's the best tool for the job. I don't know about you, but I get paid for proper design, not for optimization. I can get orders of magnitude performance improvements through proper design. This more than makes up for the loss in performance of a JIT interpreter.
I write code faster in Java than in other languages (no, haven't tried C#...it does look like a nice language, though). They have fewer bugs. I get products to market quicker. It's slow? Then buy a new computer. Today, $500 will buy a computer nice enough to run Java comfortably.
Java isn't the right answer for every job. However, for rapid application development and server side coding, it's a pretty damn good choice. It's slow? Yes, v1.0-v1.3 were slow with client code. Yes, v1.4 is slower with client code than C++, although it's close enough that I don't care. Java is a good language for getting things done, though. It's not pure OO. It's not perfect. But is is good at what it does. Choose the right tool for the right job.
Two (Score:1)
Re:Questions left unanswered... (Score:2)
Re:Questions left unanswered... (Score:1)
Java code generation (Score:3, Informative)
Another way to enhance productivity is to manipulate the Java source code itself (rather than generate code from the outside.) A good example of tool doing just that is Moka [sf.net]. In short, Moka is a Java-to-Java translator which allows you to extend Java in many interesting ways. For instance, there is a plug-in that allows you to remove any method or class whose name begins with 'debug'. There are other examples on the web page. I believe it's easy to use, and it makes up for various shortcomings of the language itself.
Sun come back please! You are in DANGER! (Score:1, Offtopic)
Sun is deep shit. For example, the successful integration of GNU, particularly GNOME into Solaris is imperative - yet they fail to do this continually, with any measure of aptitude or efficacy.
I run both Solaris SPARC and X86. I am appalled at how this has turned out. I used to run SunOS 4.1.4, and now I've been through Solaris from 2.6 to now.
On top of this all is Java, whose IDEs are severely lacking. I see more Java crap out there. In fact, I work with Java now. It's such a kluge, so close, yet they missed the mark, badly. I can't explain it. I don't see why the OO programmers ever liked this stuff. Its confusing bloated, and the abstraction makes the developers dumber and dumber every day. They wave this GARBAGE COLLECTION flag all over, and they have ceased to understand what garbage collection even is.
We have this one guy who doesn't use an IDE when using Java swing. The windowing he created is useless. It's inconsistent as hell, and it takes him forever to implement anything. I'm not a big fan of this stuff. I don't understand if he a bad programmer or not, but I though the point of this OO stuff was to recycle classes and reduce work, but it seems only to create it.
Back to Sun. SPARC is so far behind at this point, they need to do some serious work. We benched out some Alphas, SPARCs, AMDs and Intel's here, and let me tell you, the price performance for Sun is a joke. It's laughably horrible. This Opteron will make Sun's life very difficult.
I once found a show stopper bug in Solaris, and I couldn't figure out how to call them to report it. I remember when the Cobalt support was free, it is no longer.
Sun is full of dead wood. I know several alumni and a few people still work there, these are my friends, I live in the Valley. We all think Sun is screwing up so bad.
Only time will tell. I hope Sun lives. They have a tact for doing things well, or t least they did. At this point, as the stock points out, the future looks grim. They have a huge opportunity to trail blaze now that Compaq and HP will be floundering around, Opteron isn't out yet, IBM is having some problems delivering, and Dell isn't quite there just yet, almost.
I will bet they will squander this opportunity. They will let Dell catch up, and supercede, as dell already has in the 1U department. They will let IBM finish Linux and start being the ones that define Java. They will let HP and Compaq figure out how to not go out of business. They have no good leadership.
I think its high time Solaris be thought of as a Kernel, and GNU needs to start pouring in. Solaris x86 needs to come back. Suns forte should be free. Its not worth much to tell you the truth. The compiler frankly sucks. They should write optimizations for GCC. They should bank on GNU. This resistance to and this adherence to this completely ridiculous System V is pathetic.
They also need to start getting the Java community more involved in making Java and stop changing the APIs every 5 minutes.
We tried talking to sun about being a VAR, as we are already a Dell VAR. The sales and marketing people there are pathetic. They know nothing.
I'm still in shock that they have made support for Cobalt suck badly, and that I could never tell them about that show stopping bug I found in Solaris. I know former employees who will tell you this: "I don't know how to file a bug against them when you don't work inside the company, and I worked there."
Sun, wake up. Start making use of that GNUish thing you bought Cobalt, and start acting like you give a shit about the little people. Your disgusting arrogance has pissed everyone in the Valley off. And get a new CEO for Christ's sake. I love McNeely, but he has the WORST case of ADD *ever*. He is good at shitting on MS, but the sad thing is. Microsoft is more in the bank than Sun's whole Market Capitalization. Yes, MSFT has more in the BANK as CASH, than all the shares of SUNQ multiplied by the current price.
Now, if that isn't a sign for Sun to get OFF their high horse and start doing WORK, I don't know what is.
Sun's inability to execute, to be competitive and to be innovative and to be connected INTIMATLY with even its TINY customers will kill it in the end. I know I wouldn't buy SUNW right now.
Re:Sun come back please! You are in DANGER! (Score:1, Insightful)
It's the Business Model, Stupid!
my thoughts (Score:1)
Re:my thoughts (Score:2)
Whereas the VM is remarkably innovative - bytecode verifier, security domains, JIT compilers, advanced GCs.
Care to rethink those thoughts?
My Favorite Java Quote... (Score:3, Funny)
Re:My Favorite Java Quote... (Score:1)
Wasn't the real father of Java... (Score:1)
Funny how Sun revises its history after all their execs get busted for raping 13-year-old girls!
Does anyone understand... (Score:4, Insightful)
Java is actually very good, and yes, very fast. I fail to understand why anyone would prefer Microsoft's poor imitation. Java is still growing very fast and getting better all the time.
Ignore it at your peril. Or better yet, just laugh at it...that is until you're in the unemployment line because you don't know it.
Re:Does anyone understand... (Score:2, Insightful)
What Java Is and Isn't (Score:3, Interesting)
I think Java is going to own the embedded market. A cell phone company can create Java software and it can happily switch around the cell phone hardware as much as they want and still use the same single piece of software.
Palm Pilots are still popular for this same reason. There are tons of Palm apps that run on them and the new Pilots are software compatible with the older ones.
.NET appears to be different than Java in that it makes no attempt at being platform neutral, rather it tries to be language nuetral. Python.NET, VB.NET, C++.NET all compile down to the same CLR. And a VB.NET developer can use Python.NET libraries.
I think this will dominate the application market.
Re:What Java Is and Isn't (Score:2)
I beg to differ [gamespy.com]
Re:Does anyone understand... (Score:2)
But how many people appreciate that Linux is in peril?
Right now, cross-platform code isn't a major issue because
a) embedded or non-x86 Linux isn't that big yet
b) people are used to compiling source
but neither of these assumptions will be true in ~4 years. Linux will need a VM, but only Dotnet/Mono and Java will be available, and with the ridiculous hype that Mono is getting, MS could well be in drivers seat. Not a pleasant prospect...
Re:Does anyone understand... (Score:2)
Re:Does anyone understand... (Score:2)
When I get some little music toy app for my PDA, you can bet it's not going to be pre-compiled for all existing platforms. 11 is the starting point, it's going to get a lot more diverse from now.
I really don't think kernel emulators are in the running here - PDAs are constrained enough as it is without the overhead of x86 emulators. Nokia and other phone makers are setting the trend for small devices and compiled binaries are not part of the picture.
Re:Does anyone understand... (Score:2)
Your PDA may run Linux, but I seriously doubt it runs a full GNU/Linux distribution. You're going to be running a completely different set of apps.
11 is the starting point, it's going to get a lot more diverse from now.
Why? It's ported to pretty much every chip in production that can run it.
PDAs are constrained enough as it is without the overhead of x86 emulators.
But somehow they can deal with a JVM emulator, eh?
(Note I never mentioned x86; there are many chips Linux runs on it would be much nicer to emulate.)
Nokia and other phone makers are setting the trend for small devices and compiled binaries are not part of the picture.
Then GNU/Linux is out of the picture for them. Linux may work, but it's not going to look like any Linux you use, nor is going to run the same programs.
Re:Does anyone understand... (Score:2)
>>11 is the starting point, it's going to get a lot more diverse from now.
> Why? It's ported to pretty much every chip in production that can run it.
Nonsense. First you talk about porting apps, then about porting the OS. It doesn't matter how widely the OS is ported, it's the apps that will be separately distributed that count.
Yes, I can confirm that PDAs and phones are already running JVMs. I can also confirm that no PDA or phone anywhere is running a CPU emulator.
I won't bother attempting to convince you that PDAs will be running the same programs as mainstream Linux as you can find that out for yourself with a quick search in Slashdot.
Don't bother coming back with more airy-fairy arm-waving - I'm not interested in vacuous assertions and I'm pretty sure no one else is.
Re:Does anyone understand... (Score:2)
As for drag 'n drop, I'd really like you to build a production website with drag 'n drop. Really. Graphic designers everywhere are hanging up their BBEdits forever as we speak.
What the heck is autoboxing? (Score:2)
(Yes, I can use Google [google.com], but that didn't seem to be much use. Oh, but did find this googlewhack [google.com] while trying to get info.
Re:What the heck is autoboxing? (Score:2)
This is similar to how Javascript handles strings... Javascript has both a string literal type and a String object type.
var lit = "my string literal";
var obj = new String( "my string object" );
Now the cool thing is, lit isn't an object, but you can still call methods on it from the String class, like lit.substring(4) and stuff, just like you could with obj. This is because Javascript automatically creates a temporary object for the literal (ie, autoboxing?)
Once again, let me state I don't know for sure what the term actually means, I've never heard it either. But from the name itself and the context of the discussion, that's what I'd guess he's talking about.
Anyone have more of a clue than us?
Re:What the heck is autoboxing? (Score:1)
Such a feature does not exist in Java and I feel it would be useful if implemented correctly and carefully.
Re:What the heck is autoboxing? (Score:4, Informative)
int i = 2,j=1;
Integer result = Math.max( i,j);
and it would magically convert the result of the Math.max to an integer. Or if the Math.max took Integers instead of ints, it would create Integers for you.
The details need to be worked out because as of right now, an Integer is unmodifiable and things like
i == result
would be problematic. Since == tests equality, but it only works with objects if they are actually the same reference. You can't do
i.equals( result )
Also, what if you do
int i= 2;
Integer j=i, k=j;
++j;
If you are using object semantics, then k should probably be changed to reflect the new value of j, since j and k both point to the same object. It comes down to, should the value of j change? or the value of the object that it represents?
Re:What the heck is autoboxing? (Score:3, Insightful)
int i = 1;
Integer I = 1;
does i == I?
casting a float to an int ( and back ) is completly different as when you cast a float to an int, the number will probably change.
3.999999 -> int -> 3
should it goto 4? probably, it should be rounded.
but autoboxing is supposed to keep the value of the original type.
Regardless I'm not too sure how this will help performance much.
The feature that I want to see added to java is that I want to be able for the java vm to create objects on the stack. Then if they get assigned to a member pointer, get promoted to the heap. This way you could keep objects on the stack where they could be easily collected when the function that created them ends scope.
Re:What the heck is autoboxing? (Score:2)
That's already part [sun.com] of Hotspot:
"A generational collector takes advantage of the fact that in most programs the vast majority of objects (often >95%) are very short-lived (i.e. are used as temporary data structures). By segregating newly created objects into an object "nursery", a generational collector can accomplish several things. First, because new objects are allocated contiguously in stack-like fashion in the object nursery, allocation becomes extremely fast, since it involves merely updating a single pointer and performing a single check for nursery overflow. Secondly, by the time the nursery overflows, most of the objects in the nursery are already "dead", allowing the garbage collector to simply move the few surviving objects elsewhere, and avoid doing any reclamation work for dead objects in the nursery."
Here's [javaworld.com] an in-depth explanation with pictures.
Re:What the heck is autoboxing? (Score:2)
I'm saying that they change the class file format. Such that all methods have their parameters marked. So you have a method
myMethod ( Rectangle r );
now the coder does nothing, but during compile time , the rectangle r is tracked, and determined if r is only used locally, if the code keeps a reference to it, or passes the reference to a function that then keeps a reference to it.
If the reference is never actually stored ( the reference is only used locally) then the object is marked as possiable for stack creation.
In your code, if you create an object, it is by default created on the stack, unless it is determined by the compiler that the reference to the object is stored somewhere in your code.
The object would be destroyed when it goes out of scope.
This would speed up and reduce memory consumption of the VM IMO. Firstly , it would get rid of the huge penality for temporary object creation in loops. Usually this can be avoided by clever programming, but not always. Secondly, you can get rid of the static 'rendering objects' that many Swing components use. Rectangles being probably the biggest offender of this policy. Many times you just need a simple data structure in a loop ( for rendering to the screen) and you don't want to call a function to create it everytime. Or what about in a http server, you end up creating the same object over and over, the penality for this could be reduced.
AFAIK, lisp does this already so this is not voodoo science we are talking about. What sucks about this approach is that changes to the JVM bytecode are required. Since object cannot be create on the stack.
Re:What the heck is autoboxing? (Score:2)
A 'complete' mark and sweep is not fast (one that doesn't miss anything). Eden uses a fast, but incomplete algorithm. That destroys all the easy temporary objects (and moves the rest to long term storage which gets the full GC). I don't see why your approach would be so much faster.
Re:What the heck is autoboxing? (Score:2)
I don't care how fast you say this 'eden GC' is, there is no way it's faster then this solution, cleaning the stack is so fast. The live section of the stack has a MUCH higher chance to be in the cache, while eden starts out being megabytes large. So no matter what you are going to have page faults with eden. With the stack approach, objects simply go out of scope, no thinking on the vm is required to determine if an object is no longer live. Just like with a primitive.
The only problem with this solution is that you have to have a way for objects to be promoted from the stack to the heap in the case of classes that change after you compile a class that depends in it.
The whole reason for this argument is that time and time again, people want speed, and if speed can be added through VM changes only, and maybe a recompile, then why not do it?
Re:What the heck is autoboxing? (Score:2)
Java, Microsoft and James (Score:4, Interesting)
At the same time I read how SUN marvelousy manages to fuck things up with respect to their favourite language on the client side. Granted, it is huge on the e-commerce side of things, but things like JSP are too complex for simple backend applications that are far more easily handled in PHP or ASP. The mobile market seems to like it and it might become big there too, given that ARM and others are making processor core that handle bytecode natively, but that's not yet a given.
What stresses me is that, from the beginning, SUN mishandled Java and played into MS' hands for a number of reasons:
1.When it first came out it became very popular very quickly because of it's ability to provide pixelated aliased dancing Dukes and and sound to web pages. However Sun never bothered to push the point and try to improve performance and load times. People got very tired of seeing pixelated images floating across the screen that took minutes in some cases to load on early modems. They just sat there on their butts and ignored the fact that AWT was hideous, ungainly, and in no way worked very well across platforms (I mean on the Mac or Unix for example) and lacked important controls.
2.One of the things that played into MS' hands was the above and the fact that SUN made Java native interaction very difficult or at least non-trivial to implement, so that people who would have otherwise been able to make GUI controls and interface in C/C++ were put off having to slog through JNI. Along came MS with their JRI (or whatever it was called) which enabled all the hordes of MS developers to easily call MFC and other Win32 stuff directly from the classes. It was an easy picking and whose fault was it. It was or should have been obvious that MS would try to scupper anything that anyone else did (Custom ActiveX never became very popular but it did serve the purpose of making more FUD enter the arena) and the need for easy native access was defintely there. I know that it might have neccesitated changes in the security model but SUN didn't listen or was too confident or just too plain stupid when you look at the ugliness of their desktop for example.
3.Eventually they did listen and came up with Swing, which was so slow on machines of the time (ever run the Swing demo stuff on a 223MHz x86?) that it put off many companies and developers, who just carried on using VB because it was a no contest in terms of GUI response. And this although Swing looked very good.
Why did SUN ignore all the compaints? Why did they make native access so difficult? Why didn't they just improve AWT? Why didn't they try to look at it from a consumer point of view, which is what all those people watching the moronic applets of time were. Applets have all but dissapeared on the web and 99% of interactive shit is done with Flash today. Why didn't they try a trick from the MS book and try to implement things like the JVM starting up on boot or browser launch to make Applets start faster? Why did SUN make such a huge fuss of MS ignoring Java in XP when they couldn't even be bothered to make a marketing push for, IMO, some pretty neat stuff like WebStart?(who actually uses this?)
MS may be an abuse monopoly but SUN has it's head in the clouds up with the bosses of big banks etc and seems too dumb to try to see things from a consumer point of view.
(Sorry for the rant. I think they need it.)
Hey Taco (Score:2)
here have Java related issues and questions...
Java and good design (Score:2, Informative)
Go there and take a look at least. It's a java gamin g site on the basis of applets. Register (horror!) and take a look at the games. There are two 3D games last time I looked and a host of single and multiplayer tetris, galaxis and backgammon knockoffs etc.
This site is very interesting for a number of reasons:
1.It is immensely popular. When you play a game a window of all the other users online at the time pops up, and it blew me over to be honest.
2.The games look extremely good visually, are based on simple premises that make them adictive and are playable even on slower hardware.
3.It works best in Explorer's MS JVM of all things. JDK1.2 Browsers are not supported well and don't even work in some cases. This raises the question as to where they will go now that MS has dropped having it's own JVM in XP?
sumea [sumea.com]
Go here and see what you can do with a well written ava 3D engine that needs no hardware acceleration. Take note of the site design. It makes an impression on consumers.
And Mind you (Score:1)
Re:Does Java use Pointers? (Score:1)
*foo = 5;
That will most likely cause your program to crash... unless you are running windows and you might get away with it... but then your computer will crash for seemingly no reason about a half hour after running the program.
Re:Does Java use Pointers? (Score:1)
char *null_ptr = NULL;
strcpy(null_ptr,"Set_System_Speed=TURBO");
on some systems you might need to use the word LIGHTNING instead of TURBO.
Re:Does Java use Pointers? (Score:3, Informative)
The equivilent code in java would be:
Integer a = NULL;
int b = a.toInt();
Java uses references, not pointers. The difference is twofold: one, if you attempt to dereference a null pointer in java using the code above, you get a well-handled exception which either launches an error routine defined by the programmer or causes the program to terminate politely (as opposed to the messy crash you will get if you pull this in C++). Secondly you cannot do math with references-- with a reference, you can point it to something another reference already points to, or you can point it to a new object, or you can point it to NULL. With a pointer, you can just point it to any old thing anywhere in memory, or even just iterate over memory like the code at the top of this post does, and when you read the any-old-thing in question you'll just get garbage-- but your program will *think* it's reading a valid value, and operate on the garbage as if it was something important. Sometimes this results in catastrophe.
The downside to java's way of doing things is it's a bit simplistic-- you cannot have references to ints, floats, or other "base types" unless you put them inside a "wrapper object". This simplifies coding and reading but is a bit limiting at times.
Note, for the record, in C++, the term "null pointer" generally refers to any pointer that points to garbage-- in practice it doesn't always refer to NULL, which is memory address 0. Perhaps you should read some of the other documents on the "everything2" site i link above-- it has lots of good definitions of things. Hopefully that helps a little
super ugly ultraman
Re:"messy crash" (Score:2)
You are obviously a retard. You can try {
I'd call that well handled... or maybe you were being sarcastic?
Re:I think... (Score:1)