Re: Cracking DES with C++ is faster than Java?

From: Bryan Olson (fakeaddress_at_nowhere.org)
Date: 04/30/04


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


Relevant Pages

  • Re: reading more data than the record size (RECL)
    ... end snip ... This overhead is there to allow Fortran ... compile the original source code with g95, ... Think of it as a variant on the ASCII vrs ...
    (comp.lang.fortran)
  • Re: Fortran programmerss favorite report-writing tools
    ... preprocessing to compile so it's easy to add to existing code. ... same input method as when fortran was first invented. ... and the compiler is then translating it into machine code. ... a good candidate for a formulat translator seems to be texmacs. ...
    (comp.lang.fortran)
  • Re: what is wrong with this code?can someone walk me through this?
    ... i dont know anything abt fortran or coding..this is my project at ... You CAN get your program to compile if you ... What are reasonable ranges for the input variables? ...
    (comp.lang.fortran)
  • re: Upgrading an OLD (Fortran Powerstation 4.0) compiler
    ... convert and compile as f90 and fix any errors ... compiler options for windows - most vendors have 30 day demo versions. ... ivf - Intel Visual fortran, ... SUBROUTINE FortranCall ...
    (comp.lang.fortran)
  • Re: Toward a Forth thats easier to learn
    ... Barriers cease to be barriers once you're past them. ... For variables, what emerged as a style in the early days was a compromise: LSE users put in more variables than a Forth purist, but fewer than a Fortran programmer. ... Compile a line and either save it or execute it and throw it ...
    (comp.lang.forth)