[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] Winograd DCT on my seul.org account



What about CAML or derivatives ? :)

You are speaking only about imperative languages, which, I think, is not very
suitable in huge projects where we need to trust what we code.

Anyway, I don't think C is the most efficient language. Some people considers
it as a super assembler (register allocation, etc.), but in fact, the way you
write a C program is underoptimized compared with an assembler :

For example, to do a left bit rotation, you need to do in C :
   rotated_value = (value << shifter) | (((unsigned)value >> ((sizeof(value) *
8) - shifter)) & ((sizeof(value) * 256) - 1));

There is no C operator for that kind of bit operation and the generated code is
not a 'rotl' but a mixture of 'shl' and 'or' operations. Using inline functions
with asm ? not a standard. Depending on target, GCC is less or more efficient.
Visual C++ or Borland asm directives are definitely bad (cannot tell which
register is allocatable or clobbered in an asm directive).

The way to code in C language is one way to code but not the most efficient :
it is very easy to make buggy code even if each module has no bugs.

----- Original Message -----
From: Juergen Goeritz <goeritz@oekomm.de>
To: <f-cpu@seul.org>
Sent: Sunday, April 21, 2002 3:24 PM
Subject: Re: [f-cpu] Winograd DCT on my seul.org account


> On Sun, 21 Apr 2002, Martin Devera wrote:
> >> >About languages .. try http://tunes.org/Review/Languages.html
> >> >devik
> >> It doesn't help to compare languages. One has to learn
> >> them anyway and only if you practice for quite some time
> >> will the expertise build up. :-]
> >
> >I was not interested in pure compare. At the URL I found
> >interesting info about each language regarding its suitability
> >for concurent programing which is important for f-cpu IMHO.
> >And also well written critique of C lang.
> >
> >Unfortunately C is too widely used and its codebase is still
> >growing. It is probably good for things like kernel programing
> >but seems to have still bigger problems with large userspace
> >projects ..
>
> Hi, I agree with your comment that C is not a good
> language for large userspace projects. C was developed
> as a language to implement an operating system and I
> guess that's why you can also use it as a high level
> assembler. To my experience C++ did not improve that
> situation much but instead it enabled a developer to
> disguise the true program meaning by the possibility
> of redefinition of most of the constructs. In which
> case you end up with source code that is unmaintainable
> without the proper documentation. And by documentation
> I mean including the whole conceptual thoughts behind
> the program.
>
> JG
>
> *************************************************************
> To unsubscribe, send an e-mail to majordomo@seul.org with
> unsubscribe f-cpu       in the body. http://f-cpu.seul.org/

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/