Re: [linux-audio-dev] [ot] [rant] gcc, you let me down one time too many

From: Erik de Castro Lopo <erikd-lad@email-addr-hidden-nerd.com>
Date: Sun Jun 05 2005 - 03:11:35 EEST

Tim Goetze wrote:

> Frailty, thy name is GCC
>
> A Modern Drama in Three Scenes.
>
> Dramatis Personae: An ardent programmer and a popular C++ compiler
>
> -*-
>
> Prologue:
>
> Appalled by the rat race commonly known as the proprietary software
> business, our young and gifted hero joins the light side, deeply
> inspired by the manifold yet subtle qualities of free software.
>
> Scene I:
>
> Our hero in day-and-night-long sessions optimizes the hell out of a
> SSE2-based n*4-band IIR equalizer. Of course in assembly, and mixed
> with C++ templating. The final code is about 10% faster than floats on
> AMD, probably a fair bit quicker yet on P4 systems.
>
> Enter gcc version 3, which drops multi-line inline assembly support.
> Said assembly code becomes effectively unusable and dies a quick and
> unsung death.
>
> Scene II:
>
> Our hero puts years of work into an all-round realtime audio and MIDI
> library that expands the Python programming language. While having its
> flaws, it's a versatile, surprisingly stable and immensely capable
> system, partly thanks to a very clever (according to our hero) design
> that subclasses Python's C types in C++.

Sound to me like that was relying on "undefined behaviour".

> Enter gcc version 3, moving the vtable member to memory offset 0 of a
> derived type even if the base type is in C which doesn't know about
> vtables.

Relying on undefined behaviour will, sooner or later, result in tears.

> Scene III:
>
> Our hero bundles his DSP efforts into a free plugin library, once
> again saving himself much work and improving code readability by using
> C++ templates, resulting in quite an elegant object system and source
> code, hethinks.
>
> Enter gcc version 4, which requires the templated types' constructor
> code be rewritten in the most nonsensical, misleading and ugly fashion
> possibly imaginable this side of Hungary and Redmond, WA, according to
> our (now not so very young anymore) hero.

Hmm, C++ bites again. I know little about C++, but maybe this last
change was due to some requirement of some C++ standard.

> Our hero has completely and permanently lost his faith in the popular
> compiler.

Two out of the 3 above were C++ related and did not affect
the GNU C compiler.

> Disillusioned and indecisive, he resigns himself to
> henceforth reluctantly write C++ only to support his miserable life.

Can I sell you an Ocaml:

    http://www.ocaml.org/

Erik

-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam@email-addr-hidden-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"... a discussion of C++'s strengths and flaws always sounds 
like an argument about whether one should face north or east 
when one is sacrificing one's goat to the rain god." 
-- Thant Tessman
Received on Sun Jun 5 04:15:07 2005

This archive was generated by hypermail 2.1.8 : Sun Jun 05 2005 - 04:15:08 EEST