Why hasn't Sun done this?
on
Java for EGCS
·
· Score: 1
Because Sun knows that the best part about Java is that you can load classes into a running program. That cannot be done with a compiled version of Java.
Yes it can... how do you think native methods get loaded.
Instead of compiling foo.bar.MyClass to foo/bar/MyClass.class, a native compiler could compile it to foo/bar/MyClass.{so/dll}, and let the runtime link it in as needed vi dlopen()/dlsym() (or whatever dll api the machine you are compiling for supports).
To a real OO programmer, multiple inheritance separates the Javas and ObjC's of the world from the C++'s of the world. C++ is simply superior for this reason. =)
I found myself wishing that Java had multiple inheritance once... then I thought about the problem a little bit and realized that single inheritance + multiple interfaces was a much cleaner solution.
Plus, in some cases, you can actually do multiple inheritance of sorts... you can have an inner class the extends a class, while the outer class extends a different class. This usually results in better encapsulation... (Am I the only one who things inner classes are the best thing since sliced bread?)
Not me. Getting read of pointers renders Java fairly useless as a systems programming language.
Have you actually used java? Java has references which for all intents and purposes are pointers, but without all of the potential to be abused.
Maybe lack of pointers limits java's usefulness if you are writing device drivers, but other than that, why do you need pointers?
(I've done plenty of C/C++ and Java, and I have yet to find myself thinking that I could do something better with a pointer than I can with a reference.)
spell checkers for slashdot...
on
Slashdot:Mark 2
·
· Score: 1
Which brings up a good point... because everyone knows hackers can't spell (or maybe it's just me?), It would be cool if slashdot had a spell checker for articles submitted.
better 4/1 idea... but a little late I suppose
on
Slashdot:Mark 2
·
· Score: 1
slashdot should have replaced there main page with one of the MS database query error pages that you see so often from sites running MS web server + database....
It is sad that the world does not have very many people that can handle powerful tools like manual memory management.
I don't see what is so hard about it. If you allocate something, you should free it. If you don't allocate something, you had damn well better not try to use or free it.
For the less clueful, try static arrays. They are friendly and fast.
If I take that argument to the extreme, then I would arrive at the conclusion that real hackers should program in assembly. (or even machine language!)
Yes GC makes it harder for idiots to make mistakes, but I don't think that limits its usefulness to real hackers.
GC is of more use than simply memory management. In an OO language that supports destructors, GC can handle resources other than memory. For example, if you had an class that mixed audio streams together and wrote them to the audio device, your class's constructor could detach from the audio device freeing it for use by other programs. There would not be an easy way to do this without GC besides reference counting... and what hacker wants to waste time re-inventing the wheel!
BTW, I can't see any good excuse for using static arrays, other than perhaps real-time embedded systems where you can't afford the overhead of GC.
that would violate C++'s "no overhead" rule - you only pay for what you buy. If you don't want GC, you don't pay for its performance hit.
FWIW, there is a variant of C++ called EC++ (embedded C++), which strips out many of the less well though out "features" of C++, like exception throwing (other than in constructors, where it is required to deal with error conditions, because you can't return a value), templates, etc.
I have heard that it helps reduce the C++ code bloat a lot...
My point is exactly that. If you have bad program design, GC is necessary, but well thought out design makes it unnecessary.
Well, you could probably do without GC, but the question is whether you can do it better without GC.
Without GC, there are situations where you either need to (a) implement reference counting (which is a form of GC) in order to know when to free some data, or (b) make duplicate copies of objects so each object can be freed by the code that receives a reference to the object when it is done with it. I am really not convinced that either approach is better than just using GC in the first place. (FWIW, the example I am thinking of is a multithreaded application that communicates between threads via message passing, where you would like to be able to have multicast messages. The objects passed are treated as read-only, so side effects are not an issue. I am sure that given a couple minutes I could come up with a better example.)
The most hideous bugs can lurk in memory management. You get memory leaks if you are lucky or segfaults if you are not. GC frees you from a whole class of bugs and permits leaner, more legible code.
I think I'd rather have the segfaults... sometimes memory leaks can be tricky to track down. At any rate, gc is the way to go.
GC was a revelation to me when I switched from C/C++ to Perl. Of course Perl's memory management goes beyond GC, but that's another story.
Rapid Application Development is nearly impossible without GC -- you can't develop rapidly when you are hunting down memory leaks and illegal pointers.
This, IMHO, is one of the really nice things about java, and perhaps a feature that really should have made it into C++ but didn't. It seems to me that properly handling exceptions w/o gc can make life real hairy for the C++ compiler.
I think GC is an interesting topic, and I am glad to read about it on/.
I beleive so, or something like it. I'm thinking that simple requests could be recognised as normal file requeses and just handed off to the filesystem, with the web server `root' somehow configured (/proc/.../web_root or somesuch, probably).
But wouldn't the web server still have to process the URI... open() the requested page and then make the fd to fd copy system call?
I guess this is what I was confused about. To have the kernel be able to handle HTTP requests would seem to go against linus's philosophy... I suppose you could have a web server kernel module, though, but that just seems like something that should be running in user space.
I have to say, that was a very well written article. I enjoyed reading it.
I was interested in what Linus had to say about web serving, but I am a little curious what he means about the kernel handling requests for static pages. Does he mean something like a system call that could directly copy from file descriptor to file descriptor?
If you have a good network connection, you will really appreciate how easy it is to upgrade debian systems. Simply run dselect, select [U]pdate, then [I]nstall. Go to sleep/eat lunch/read slasdot/whatever while dselect does it's thing. No more downloading rpms, figuring out missing dependencies, and repeating as needed!
Redhat, on the other hand, has put a lot of work into making linux easier to use, such as GUI config tools.
I really think it comes down to the user/admin of the machine... if it is someone relatively new to linux, go with Redhat... if it is an old unix/linux hack then go with Debian.
FWIW, I use redhat on my desktop at work, but debian on both of my home systems: an alpha and a powerbook.
I am not going to speak for perl, because I don't care for it too much, and don't claim to be any sort of perl guru.
I like java because it is a cleaner language than C++, and it provides features that require some trickery to emulate in C. (ie all that dynamic linking, and the reflection API stuff). Plus it is a very nice language. I really like features like inner-classes. Also gc, objects references rather than pointers, and threads being part of the standard java base classes are a plus.
When I was still in school, I used a lot of C/C++... I implemented a (not-quite-full-featured) JVM in C++, so I knew quite a bit about the underlying JVM, but I hadn't actually used Java to implement anything other than some silly test programs. At my current job, I have implemented are reasonably good sized application (sorry for being vague, but NDA and all...), and I have come to appreciate the java language (and realize how brain damaged C++ is).
I have found that my development time for stuff implemented in java to be lower than equivelent projects implemented in C/C++. Plus, application speed hasn't really been as much of an issue as I had initially anticipated. There definately is a speed penalty, but I think for most things the difference in development time more than makes up for that.
I probably left out some features that I like...
BTW, I used apache + mod_jserv for my little servlet.
I doubt that I am going to convince a perl hacker to switch to java, but I gotta try:
Have you played around with the java servlet stuff. It rocks. I implemented a "slashdot-like" message board in it, and it only took a couple days. It lacks all the features of slashdot, but it was fast. It was more responsive than static pages, in many cases... (ie all the "nodes" index info was already in memory, so the server didn't have to load anything from disk.) It would probably be even faster with a JIT.
Hmm, about 10 months ago, I was one of those linux using students. Then I graduated and went to work for a place that had NT on all the desktops. (Most of the development actually happens on the solaris servers, because we use clear-case, and the compilers we use are available for solaris.)
After about a month I was using linux on my desktop, occasionally rebooting to NT to use word/excel. Now, there are at least 3 linux servers at work, 2 of which I set up, and we have several more in the works. (One of those linux servers in the work will replace our last NT server.) Also, several of my co-workers have switched to linux on their desktop, and there are some others who are playing with linux at home.
So, if every one of the current linux using students graduate and have this sort of impact, M$ has really got something to worry about!
No, actually they would be doing me a favor... and I am sure I am not the only one who uses a perfectly good linux box as an X-server half the time because we need solaris to use clearcase.
Well, those kernel mods let you use non-clearcase aware tools to do development. If you have ever used clearcase, you would appreciate it despite the required kernel mods.
The kernel mods needed should be pretty minimal, because as I understand it most of the work is done by a daemon. With linux's VFS layer in the kernel, it should not be too hard to implement the kernel support. In fact I even volunteer to help, if they are looking for help! (It would be a fun project, I think...)
I have to say that ClearCase is the coolest thing since sliced bread! With clearcase for linux I would be able to use my linux box for more than just an x-terminal!
Because Sun knows that the best part about Java is that you can load classes into a running program. That cannot
be done with a compiled version of Java.
Yes it can... how do you think native methods get loaded.
Instead of compiling foo.bar.MyClass to foo/bar/MyClass.class, a native compiler could compile it to foo/bar/MyClass.{so/dll}, and let the runtime link it in as needed vi dlopen()/dlsym() (or whatever dll api the machine you are compiling for supports).
To a real OO programmer, multiple inheritance separates the Javas and ObjC's of the world from the C++'s of the
world. C++ is simply superior for this reason. =)
I found myself wishing that Java had multiple inheritance once... then I thought about the problem a little bit and realized that single inheritance + multiple interfaces was a much cleaner solution.
Plus, in some cases, you can actually do multiple inheritance of sorts... you can have an inner class the extends a class, while the outer class extends a different class. This usually results in better encapsulation... (Am I the only one who things inner classes are the best thing since sliced bread?)
Not me. Getting read of pointers renders Java fairly useless as a systems programming language.
Have you actually used java? Java has references which for all intents and purposes are pointers, but without all of the potential to be abused.
Maybe lack of pointers limits java's usefulness if you are writing device drivers, but other than that, why do you need pointers?
(I've done plenty of C/C++ and Java, and I have yet to find myself thinking that I could do something better with a pointer than I can with a reference.)
Which brings up a good point... because everyone knows hackers can't spell (or maybe it's just me?), It would be cool if slashdot had a spell checker for articles submitted.
slashdot should have replaced there main page with one of the MS database query error pages that you see so often from sites running MS web server + database....
now that would have been funny!
It is sad that the world does not have very many people that can handle powerful tools like manual memory management.
I don't see what is so hard about it. If you allocate something, you should free it. If you don't allocate something, you had damn well better not try to use or free it.
For the less clueful, try static arrays. They are friendly and fast.
If I take that argument to the extreme, then I would arrive at the conclusion that real hackers should program in assembly. (or even machine language!)
Yes GC makes it harder for idiots to make mistakes, but I don't think that limits its usefulness to real hackers.
GC is of more use than simply memory management. In an OO language that supports destructors, GC can handle resources other than memory. For example, if you had an class that mixed audio streams together and wrote them to the audio device, your class's constructor could detach from the audio device freeing it for use by other programs. There would not be an easy way to do this without GC besides reference counting... and what hacker wants to waste time re-inventing the wheel!
BTW, I can't see any good excuse for using static arrays, other than perhaps real-time embedded systems where you can't afford the overhead of GC.
that would violate C++'s "no overhead" rule - you only pay for what you buy. If you don't want GC, you don't pay for its performance hit.
FWIW, there is a variant of C++ called EC++ (embedded C++), which strips out many of the less well though out "features" of C++, like exception throwing (other than in constructors, where it is required to deal with error conditions, because you can't return a value), templates, etc.
I have heard that it helps reduce the C++ code bloat a lot...
My point is exactly that. If you have bad program design, GC is necessary, but well thought out design makes it unnecessary.
Well, you could probably do without GC, but the question is whether you can do it better without GC.
Without GC, there are situations where you either need to (a) implement reference counting (which is a form of GC) in order to know when to free some data, or (b) make duplicate copies of objects so each object can be freed by the code that receives a reference to the object when it is done with it. I am really not convinced that either approach is better than just using GC in the first place. (FWIW, the example I am thinking of is a multithreaded application that communicates between threads via message passing, where you would like to be able to have multicast messages. The objects passed are treated as read-only, so side effects are not an issue. I am sure that given a couple minutes I could come up with a better example.)
The most hideous bugs can lurk in memory management. You get memory leaks if you are lucky or segfaults if you are not. GC frees you from a whole class of bugs and permits leaner, more legible code.
/.
I think I'd rather have the segfaults... sometimes memory leaks can be tricky to track down. At any rate, gc is the way to go.
GC was a revelation to me when I switched from C/C++ to Perl. Of course Perl's memory management goes beyond GC, but that's another story.
Rapid Application Development is nearly impossible without GC -- you can't develop rapidly when you are hunting down memory leaks and illegal pointers.
This, IMHO, is one of the really nice things about java, and perhaps a feature that really should have made it into C++ but didn't. It seems to me that properly handling exceptions w/o gc can make life real hairy for the C++ compiler.
I think GC is an interesting topic, and I am glad to read about it on
Yup:
# du -sk linux-2.2.1/*
20 linux-2.2.1/COPYING
54 linux-2.2.1/CREDITS
2401 linux-2.2.1/Documentation
19 linux-2.2.1/MAINTAINERS
14 linux-2.2.1/Makefile
15 linux-2.2.1/README
3 linux-2.2.1/REPORTING-BUGS
8 linux-2.2.1/Rules.make
8655 linux-2.2.1/arch
27993 linux-2.2.1/drivers
3945 linux-2.2.1/fs
6298 linux-2.2.1/include
36 linux-2.2.1/init
63 linux-2.2.1/ipc
253 linux-2.2.1/kernel
55 linux-2.2.1/lib
258 linux-2.2.1/mm
3959 linux-2.2.1/net
355 linux-2.2.1/scripts
I beleive so, or something like it. I'm thinking that simple requests could be recognised as normal file requeses and just handed off to the filesystem, with the web server `root' somehow configured
(/proc/.../web_root or somesuch, probably).
But wouldn't the web server still have to process the URI... open() the requested page and then make the fd to fd copy system call?
I guess this is what I was confused about. To have the kernel be able to handle HTTP requests would seem to go against linus's philosophy... I suppose you could have a web server kernel module, though, but that just seems like something that should be running in user space.
I have to say, that was a very well written article. I enjoyed reading it.
I was interested in what Linus had to say about web serving, but I am a little curious what he means about the kernel handling requests for static pages. Does he mean something like a system call that could directly copy from file descriptor to file descriptor?
What versions of E & gnome were you using? I have been using gnome-1.0 + E 0.15 snapshots for a while, and it has been pretty stable.
It does use some memory, but that could have more to do with the themes I am using...
If you have a good network connection, you will really appreciate how easy it is to upgrade debian systems. Simply run dselect, select [U]pdate, then [I]nstall. Go to sleep/eat lunch/read slasdot/whatever while dselect does it's thing. No more downloading rpms, figuring out missing dependencies, and repeating as needed!
Redhat, on the other hand, has put a lot of work into making linux easier to use, such as GUI config tools.
I really think it comes down to the user/admin of the machine... if it is someone relatively new to linux, go with Redhat... if it is an old unix/linux hack then go with Debian.
FWIW, I use redhat on my desktop at work, but debian on both of my home systems: an alpha and a powerbook.
I am not going to speak for perl, because I don't care for it too much, and don't claim to be any sort of perl guru.
I like java because it is a cleaner language than C++, and it provides features that require some trickery to emulate in C. (ie all that dynamic linking, and the reflection API stuff). Plus it is a very nice language. I really like features like inner-classes. Also gc, objects references rather than pointers, and threads being part of the standard java base classes are a plus.
When I was still in school, I used a lot of C/C++... I implemented a (not-quite-full-featured) JVM in C++, so I knew quite a bit about the underlying JVM, but I hadn't actually used Java to implement anything other than some silly test programs. At my current job, I have implemented are reasonably good sized application (sorry for being vague, but NDA and all...), and I have come to appreciate the java language (and realize how brain damaged C++ is).
I have found that my development time for stuff implemented in java to be lower than equivelent projects implemented in C/C++. Plus, application speed hasn't really been as much of an issue as I had initially anticipated. There definately is a speed penalty, but I think for most things the difference in development time more than makes up for that.
I probably left out some features that I like...
BTW, I used apache + mod_jserv for my little servlet.
I doubt that I am going to convince a perl hacker to switch to java, but I gotta try:
Have you played around with the java servlet stuff. It rocks. I implemented a "slashdot-like" message board in it, and it only took a couple days. It lacks all the features of slashdot, but it was fast. It was more responsive than static pages, in many cases... (ie all the "nodes" index info was already in memory, so the server didn't have to load anything from disk.) It would probably be even faster with a JIT.
later
yeah southpark!
Hmm, about 10 months ago, I was one of those linux using students. Then I graduated and went to work for a place that had NT on all the desktops. (Most of the development actually happens on the solaris servers, because we use clear-case, and the compilers we use are available for solaris.)
After about a month I was using linux on my desktop, occasionally rebooting to NT to use word/excel. Now, there are at least 3 linux servers at work, 2 of which I set up, and we have several more in the works. (One of those linux servers in the work will replace our last NT server.) Also, several of my co-workers have switched to linux on their desktop, and there are some others who are playing with linux at home.
So, if every one of the current linux using students graduate and have this sort of impact, M$ has really got something to worry about!
No, actually they would be doing me a favor... and I am sure I am not the only one who uses a perfectly good linux box as an X-server half the time because we need solaris to use clearcase.
Well, those kernel mods let you use non-clearcase aware tools to do development. If you have ever used clearcase, you would appreciate it despite the required kernel mods.
The kernel mods needed should be pretty minimal, because as I understand it most of the work is done by a daemon. With linux's VFS layer in the kernel, it should not be too hard to implement the kernel support. In fact I even volunteer to help, if they are looking for help! (It would be a fun project, I think...)
I have to say that ClearCase is the coolest thing since sliced bread! With clearcase for linux I would be able to use my linux box for more than just an x-terminal!
Couldn't an ethernet card's hardware address be used to track folks... If that was the case, then it is true that you don't have any privacy as-is.
just a thought...