March 20, 2006
David Medlock wrote:
> Walter Bright wrote:
> 
>> "Jari-Matti Mäkelä" <jmjmak@utu.fi.invalid> wrote in message news:dvk2v1$1rf1$1@digitaldaemon.com...
>>
>>> Using VMs is not a solution, it's a terribly perverted workaround. The real problem is that current operating systems are far too monolithic and hang/corrupt the whole machine when one unfortunate process dies/does something bad.
>>
>>
>> I agree. The job of the operating system is to sandbox processes so that when one dies, it is isolated from all the others, which it does a reasonably good job doing (but it could do better). The CPU hardware certainly is set up to support this. You can even run Windows entirely in a virtual machine!
>>
> Taking this a step further, look at the massively scalar CELL processor.
> 
> Which do you think could harness that power better?
> A VM or a compiled language? (Note that not every VM needs to be as
> complicated as the JVM).
> 
> Obviously the choice of language itself matters a great deal, but the VM approach certainly has a step up in this reguard.
> 
> This is not to impugn D, just to point out the larger picture...

We can create this next generation VM for CELL-processors using D. :)
March 20, 2006
Dave wrote:
> In article <dvld6m$1f37$1@digitaldaemon.com>, Sean Kelly says...
>> similar semantics and C++ is far more heavily optimized.  If Java could make one performance claim over C++ it would be that manipulating references could be more efficient than passing copies, but D could make the same claim... and can also take advantage of the optimizations that contribute the performance of C++.
> 
> But C++ can also pass (and return) by reference if needed (obviating the need to
> call copy ctors), correct? And it can allocate class objects on the stack, which
> is an option Java doesn't have.

I think the important distinction is that you can do almost anything in C++ as the situation dictates.

Bjarne had a presentation on C++ performance where he presented hard data where C++ was shown to outperform highly tuned C code and even Fortran by multiple orders of magnitude.  This was achieved through the use of templates (implicit template instantiation is basically necessary for this), which were unique to C++ until D came along :-)  He also made a point of saying that when people compare performance between languages they typically compare specific language features, which I don't think presents a very accurate picture of things.  If someone has an example of Java outperforming C++, I suspect it's this kind of example, ie. comparing a tuned Java program to a badly written C++ equivalent using deep inheritance trees, DMA, and tons of virtual method calls with no optimization being performed.  In the hands of experts, I think Java has no chance of competing with C++, and I don't see that changing tremendously with time.  What Java has going for it is utility, not speed.


Sean
March 20, 2006
james wrote:
>> I agree. The job of the operating system is to sandbox processes so that when one dies, it is isolated from all the others, which it does a reasonably good job doing (but it could do better). The CPU hardware certainly is set up to support this. You can even run Windows entirely in a virtual machine! 
> 
> The real test of a language/technology is "eating your own dogfood". And its
> interesting to note that MS seem to be pulling back abit from putting the clr
> very deep into the os. Rather .net classes are just wrappers for c++. A much
> better approach is D plus DMDScript. 

According to Herb Sutter, MS is pushing C++/CLI as *the* language to write .NET code in.  I suppose its rather unique ability to combine managed and unmanaged code in a single assembly has turned out to be more useful than originally anticipated.  So this seems to lend credence to the claim that Windows isn't going to turn into a pure .NET VM any time soon.  It's almost too bad, as I'm still hoping for an undeniable reason to drop Windows for an alternative OS ;-)


Sean
March 20, 2006
Sean Kelly wrote:
It's almost too bad, as I'm still hoping for an undeniable
> reason to drop Windows for an alternative OS ;-)

So do it anyway, like I did, and many others.  It's the little things that hit you daily - cumulatively, they won't let you go back to Windows.

BA
March 20, 2006
"Roberto Mariottini" <Roberto_member@pathlink.com> wrote in message news:dvltsr$2771$1@digitaldaemon.com...
> - Compile once and run everywhere. I write, compile and test my program
> with my
> Windows PC, then download it in a Linux-based CN, a VxWorks-based terminal
> and a
> WinCE one (last two with an ARM processor). The application works the same
> on
> the 4 platform, the user doesn't notice. You only have to care for a few
> things,
> like case sensitiveness for file names, or not using the latest whistles &
> bells
> not present in that particularily old VM.

This portability isn't the result of a VM, it's the result of cleaning up all the undefined and implementation defined behaviors in the language.

D is about halfway in between C++ and Java in this regard. It could be better.


March 21, 2006
Walter Bright wrote:
> I'm no expert on Java programming, but I get this question a lot:
> "What compelling reason does D have that would entice a Java
> programmer to switch to D?"
> 
> I know several of you have come to D from Java, and are expert Java programmers, so you folks' reasons would be very valuable.

(I may write another post in this thread later. Right now I'm thinking of Java vs D in *academic* surroundings.)

"Some" years ago, we had to substitute Java for Pascal as the First Language in my university. It was not like anyone had any solid criticism against Pascal (especially when we were teaching Borland Pascal, which is 1. the de facto standard, 2. pretty usable, both as GUI stuff and CL stuff). It was because the students were about to start a riot against "a passé language forced upon them, on account of the faculty being old moldheads". Who cares if Pascal was actually _invented_ to be the first language.

Now, as a teacher of IT, I always found it hard to stand at the front on the first day, and having to answer questions like:

"Ok, now it says 'public static void main... on the chalkboard. Would you, Sir, mind telling us what that means?'

How am I going to explain that to folks new to programming, on their first day?

----

Some reasons for skipping Java for an "unknown, obscure language that nobody has ever heard of":

 - this language you can use *even* after the semester, for your own stuff and needs

 - it makes standalone programs, so you can do something and copy that to your friends -- and they don't have to install all kinds of VMs or whatever

 - the main *concepts* in programming look the same in D, Java, C, and some other important languages. Therefore, even if you end up programming in any of those others, stuff *will* look familiar to you

 - compared to [most of the "competing" languages] D has a straightforward way of representing the majority of both traditional and the more modern concepts of programming -- thus letting the teacher _and_ the students concentrate on the issue at hand, as opposed to learning language specific quirks or idioms

 - the VM that Java resides upon, is just another burden for the teacher. Especially the smarter students have a hard time visualising or conceptualising what's really going on

 - programming concepts (taken as a whole) manifest themselves more clearly and more straightforward to the students, than e.g. in Java. (Note, here some might argue that C is superior, but nobody in their right mind would teach C as a First Language, and we haven't eve started to talk about C++)

 - if you take the gamut of Programming Abstraction Levels that Java spans and compare it to that of D, you'll find that D now spans the distance logarithmically from C to almost Lisp. (!!!) (( Where Java is half-way, and *stays* there.))

 - blinding compilation speed combined with aborting before 10 miles of error messages, does really make a difference to student comprehension, and motivation

 - copyable and runnable results of compilation, that you can give to your friends or antagonists in the class

 - while knowing several programming languages right from the first year is considered a forte, some teachers forget that *one* language that the students *feel* their own [like a mother tongue], is rather important if one is to entertain a life long understanding, comfortability and handiness with programming as such

 - in CS, a language has to be useful both in _to_the_metal_ classes as well as a vehicle for teaching the more abstract concepts. IMHO, D serves both of these needs excellently -- additionally, with no gap in between

 - some CS classes contain Assembler programming. I have yet to see anything that even comes close to the ease (for the teacher) with which you can let the students concentrate on the assignments at hand, without struggling with all kinds of [to that class irrelevant] obligatories and inconsistencies [with initial setup of the registers, return values, stack handling, etc.] Be it with Windows or Linux.

===

I've said before, that I consider D as an almost perfect First Language. This should *never* be taken as belittling D, or its capabilities!

(There's a law in several European countries that says Driving School cars have to have stick shift. But none of them require that the car is a WW2 Jeep with a non-synchronized gear box. Or separate pedals for left and right brakes. (I've driven a Real Farmer Tractor, it had separate brake pedals for left and right! You don't wanna try that at home when you're on reverse gear.)

Just as nobody in their right mind would push C++ as the first language for *anybody*.

===

(Walter,) anytime somebody doubts D as a superior Academic Language, have them talk with me.

Another thing, if we can get D popular in the academia, both research and teaching will gain a lot. And as an aside, 5 years after that, who'll ever want to do programming in any other language???
March 21, 2006
Andrew Fedoniouk wrote:
> JavaVM + GUI ruintime = 200k.

Hmm. Compared with D "Hello World", I'm getting worried.
March 21, 2006
Walter Bright wrote:
> 
> The presenter confidently predicted that in 10 years, Java will
> outperform C in the general case. Color me skeptical.

The number of languages "faster than C", either "now" or "real soon now" that I've heard at various venues, is more than one hand's fingers.

Somehow I share your skepticism.
March 21, 2006
Brad Anderson wrote:
> Sean Kelly wrote: It's almost too bad, as I'm still hoping for an
> undeniable
> 
>> reason to drop Windows for an alternative OS ;-)
> 
> So do it anyway, like I did, and many others.  It's the little things
> that hit you daily - cumulatively, they won't let you go back to
> Windows.

Right!

Consider, on the one hand, an OS that's from the beginning made just to get everybody's money. And only that. ("We're writing stuff 'for them'!")

And on the other hand, an OS made _by_ the users, _for_ the users. And on top of that, based on Unix, which _from_the_start_ was an OS for software development. And for the able user and not "for the masses".

Oughtta be a no-brainer.

Not to mention licences, payments, and all that crap.

Except that, today Linux is not an Alternative OS.
March 21, 2006
Georg Wrede wrote:
> Brad Anderson wrote:
>> Sean Kelly wrote: It's almost too bad, as I'm still hoping for an
>> undeniable
>>
>>> reason to drop Windows for an alternative OS ;-)
>>
>> So do it anyway, like I did, and many others.  It's the little things
>> that hit you daily - cumulatively, they won't let you go back to
>> Windows.
> 
> Right!
> 
> Consider, on the one hand, an OS that's from the beginning made just to get everybody's money. And only that. ("We're writing stuff 'for them'!")
> 
> And on the other hand, an OS made _by_ the users, _for_ the users. And on top of that, based on Unix, which _from_the_start_ was an OS for software development. And for the able user and not "for the masses".

Doesn't matter if the OS that gets money also has the apps I want to run.  In an ideal world, I be using OSX.  If I wanted to make a practical choice for idealistic reasons, I'd use a Linux or BSD.  As it is, I simply haven't been given enough reason to decide against Windows despite its utility.  Though it's worth mentioning that one of the motivating factors in my decision is which OS has the best games ;-)


Sean