OT: programming languages (was: More pens (was Re: Phoneme winnowing continues))
From: | Henrik Theiling <theiling@...> |
Date: | Tuesday, June 10, 2003, 19:39 |
Hi!
Stone Gordonssen <stonegordonssen@...> writes:
...
> >As a matter of prejudice, I tend to agree with you. But rationally,
> >I know that assembly-language application programmers sang the exact
> >same tune when they saw whippersnappers coding in Fortran and Lisp and
> >Cobol.
>
> And not unjustifiably so - assembly language does enable one to write very
> tight code (how else can one write a 2 byte infinite loop? :) ).
In C/C++:
for(;;)
:-)
It works with good compilers.
In Clean:
f = f
And then evaluate f. (Clean is lazy, so it does not crash immediately,
although that's no recursive function, but only a recursive value).
Again, if the compiler is usually clever enough to remove all function
call overhead needed for lazy evaluation, this produces only one
instruction. (If it is too clever, like Haskell sometimes is, you get
an error message about a black hole...)
> The move to higher-level languages was a tradeoff - efficiency
> versus maintainability (though some C code is contrary to the
> latter).
Well, but, definitely is not anymore. The aim is to have a good
compiler and a programmer who tries to feed it with code it
understands well.
Modern languages (*NOT* C or C++ or Java (new, but still
old-fashioned)) aim at having type systems that find a lot of
programming errors early and at the same time producing extremely fast
code. I once tried a Clean compiler against gcc in a simple loop,
programmed in the natural way in both languages: recursive on Clean,
iterative in C. Clean was faster.
The problem is that people don't believe this and use C++ when they
want it fast. C++ is extremely slow due to bad design: too many
things are dynamic if you use it extensively. Java tries to be
better, but, of course, usually is even slower. Really modern
languages would cure two problems: Segmentation Faults/Buffer
Overflows... and slowliness.
Point&click is aweful, I agree. Programs for MS products are
exclusively developped under Linux where I work. Otherwise we would
lose our hair too soon. (I have, actually, but for other reasons, I
suppose. :-))
No offence against any programmers, to be honest, I use C++ most of
the time, too. And Lisp and Perl, too. :-)
**Henrik
Reply