Re: [Criticism] On the discussion about C++ modules

From: jmcmullan@linuxcare.com
Date: Mon Oct 16 2000 - 23:35:17 EST


Eray Ozkural <erayo@cs.bilkent.edu.tr> wrote:
> I've read a summary of a discussion about C++ module writing on
> this list, and I'd like to make some comments on it. [I'm not
> subscribed to this list, please retain a Cc: to my address]

        I've had the (dubious) opportunity to write a C++
kernel module for Linux 2.2.x earlier this year for a client.
(Code is at:
http://www.smartdisk.com/Downloads/Software/flashpath-0.2.1.tar.gz )

        Anyway, here's my two cents:

        * If you have to port a C++ codebase to run in linux,
          rewrite it in C.
        * If you can't rewrite it in C (politics, size, time, etc)
          make a C++<->C API translation.
        * All kernel calls must go through the translation
        * Use the minimal C++ runtime in flashpath-0.2.1/linux/cppfake.c

        C++ is ugly as kernel code. I do _NOT_ recommend starting
a new project with it. However, if you're porting alien C++
code, it can be done. And it's not pretty.

ObWackyKernelLanguage: Objective C

        If people are interested, I can whip up an Objective C
runtime for the kernel. Will be slow as molasses compared to
C, but should make for interesting driver modularity (and flame wars)...

-- 
Jason McMullan, Senior Linux Consultant, Linuxcare, Inc.
412.422.8077 tel, 412.656.3519 cell, 415.701.0792 fax
jmcmullan@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:10 EST