public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin Brulisauer" <martin@uceb.org>
To: Joshua MacDonald <jmacd@namesys.com>
Cc: neilb@cse.unsw.edu.au, linux-kernel@vger.kernel.org
Subject: Re: type safe lists (was Re: PATCH: type safe(r) list_entry repacement: generic_out_cast)
Date: Wed, 24 Jul 2002 12:50:28 +0200	[thread overview]
Message-ID: <3D3EA294.30758.3567B82@localhost> (raw)
In-Reply-To: <20020724095656.GB11106@reload.namesys.com>

On 24 Jul 2002, at 13:56, Joshua MacDonald wrote:
> The list code is trivial, but when you have 10 classes of list and no type
> safety between independent list classes or even between the list head and list
> item types, there is a strong possibility you will pass the wrong argument to
> some list routine because there is nothing to stop you.
So it is.

At kernel level nothing will stop me to halt() the cpu, if I realy want 
to. It is important to understand that tools (and all compilers are
just tools) will not enable me to write correct code. 
> 
> I can say a lot of good and bad things about C++, but at least it lets you do
> this kind of thing with type safety and without ugly macros.
> 
Yes. That's absolutely true for C++. But the kernel is implemented 
in C and C is "only" kind of a high-level-assembler language. It is
ment to be open - on purpose. There exist other languages that 
have these kinds of concepts you bring in (I would not use C++ as 
the best example - take OBERON/MODULA or EIFFEL). But these 
languages are not made to implement an operating system 
(remember the reason K&R have specified and implemented C?).

What I realy dislike is the approach to bring in any OO concepts 
into the C language the linux kernel bases on. Keep the code as 
simple and homogenous as possible (or try to rewrite it in OO).

The way I see this discussion is: Every software problem has it's 
proper language to be solved in. And for this, Linus decided it to be 
C.

Regards,
Martin


  reply	other threads:[~2002-07-24 10:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-23 11:28 PATCH: type safe(r) list_entry repacement: generic_out_cast Neil Brown
2002-07-23 11:47 ` Jakob Oestergaard
2002-07-23 22:07   ` type safe lists (was Re: PATCH: type safe(r) list_entry repacement: generic_out_cast) Joshua MacDonald
2002-07-24  7:39     ` Martin Brulisauer
2002-07-24  8:24       ` Anton Altaparmakov
2002-07-24  9:56       ` Joshua MacDonald
2002-07-24 10:50         ` Martin Brulisauer [this message]
2002-07-24 11:58           ` Jakob Oestergaard
2002-07-24 16:49             ` John Alvord
2002-07-25  5:29       ` Greg KH
2002-07-25  6:20         ` Roland Dreier
2002-09-04 13:48         ` Alexander Kellett
2002-09-04 14:27           ` DervishD
2002-07-24 12:22     ` Jakob Oestergaard
2002-07-24 12:40       ` Joshua MacDonald
2002-07-24 15:15         ` Hans Reiser
2002-07-23 12:42 ` PATCH: type safe(r) list_entry repacement: generic_out_cast Brian Gerst
2002-07-23 16:29 ` Linus Torvalds
2002-07-24  5:25   ` Thunder from the hill
2002-07-23 16:36 ` Christoph Hellwig
2002-07-23 22:58 ` Kevin O'Connor
2002-07-24 12:38 ` PATCH - mark 2: type safe(r) list_entry repacement: container_of Neil Brown
     [not found] <20020723114703.GM11081@unthought.net.suse.lists.linux.kernel>
     [not found] ` <3D3E75E9.28151.2A7FBB2@localhost.suse.lists.linux.kernel>
2002-07-24 13:23   ` type safe lists (was Re: PATCH: type safe(r) list_entry repacement: generic_out_cast) Andi Kleen
2002-07-24 21:00     ` Linus Torvalds
2002-07-24 23:39       ` Jamie Lokier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D3EA294.30758.3567B82@localhost \
    --to=martin@uceb.org \
    --cc=jmacd@namesys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox