Re: Cracking DES with C++ is faster than Java?
From: Bryan Olson (fakeaddress_at_nowhere.org)
Date: 04/30/04
- Next message: Andrew Swallow: "Re: Cracking DES with C++ is faster than Java?"
- Previous message: Calum: "Re: crash during file writing, how to recover ?"
- In reply to: Jerry Coffin: "Re: Cracking DES with C++ is faster than Java?"
- Next in thread: Jerry Coffin: "Re: Cracking DES with C++ is faster than Java?"
- Reply: Jerry Coffin: "Re: Cracking DES with C++ is faster than Java?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Apr 2004 10:52:28 GMT
Jerry Coffin wrote:
> My opinions aren't based purely on looking at code produced by C
> and/or C++ copmilers, but also by various other languages (including
> Fortran). It's true that Fortran has changed since then as well, but
> I'm not particularly convinced that the sub-optimal code is due to new
> language features or anything like that.
>
> Now, how do I, on one hand, say that the situation is worse today than
> it was 20+ years ago, but also agree that optimizer technology has
> gotten better during that time as well?
Hey -- there are more important things to optimize than clock-
cycle counts. I too am old enough to have learned FORTRAN IV,
and let's not kid the kids: FORTRAN IV sucked! Wasting a few
machine cycles is one thing, but don't waste large amounts of my
time and claim to be doing me a favor.
How bad did FORTRAN IV suck? Well, my favorite example is that
a for-loop (actually a "DO" loop in FORTRAN IV) could not
execute its body zero times. Even if the condition was false at
the start, it would go through at least once. Is that as
awkward as it sounds? Absolutely! Why did they do it? Well,
the way most machine instruction sets work, one can save a cycle
or two by testing the condition at the end of the loop, and
using a conditional jump backwards.
We have much more *efficient* languages today. C and C++ are
far from top of the list. Java doesn't crash, but it's still
notably primitive. My hope for the future is with elegant,
polymorphic-type-safe languages, such as the ML family, or
perhaps even more purely functional languages such as Haskell.
They have yet to make a commercial splash comparable to C/C++ or
Java, but when tested in coding-competition, they romp.
In my own grad-school work with ML, I fought long and hard with
the type-checker. I could take an hour or more just to several
dozen lines of my code to compile. Still, I like ML; when
programs did compile, they worked. Logic errors are, or course,
still possible, and I cannot be certain my programs were
entirely correct. Nevertheless, I'm impressed: in about a year
of using ML, *every* known error in my code was caught at
compile-time.
-- --Bryan
- Next message: Andrew Swallow: "Re: Cracking DES with C++ is faster than Java?"
- Previous message: Calum: "Re: crash during file writing, how to recover ?"
- In reply to: Jerry Coffin: "Re: Cracking DES with C++ is faster than Java?"
- Next in thread: Jerry Coffin: "Re: Cracking DES with C++ is faster than Java?"
- Reply: Jerry Coffin: "Re: Cracking DES with C++ is faster than Java?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|