public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Borislav Petkov" <bp@alien8.de>,
	"Måns Rullgård" <mans@mansr.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Christopher Barry" <christopher.r.barry@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: OT: Open letter to the Linux World
Date: Thu, 04 Sep 2014 12:16:47 +0200	[thread overview]
Message-ID: <54083C0F.1040807@ahsoftware.de> (raw)
In-Reply-To: <20140904075453.GK3190@worktop.ger.corp.intel.com>

Am 04.09.2014 09:54, schrieb Peter Zijlstra:
> On Mon, Aug 18, 2014 at 08:15:45PM +0200, Alexander Holler wrote:
>>
>> Hmm, a sane and maintainable solution would use C++ with which people don't
>> have to manually build lists or hashes for every structure like in the
>> kernel (generic programming done right). So you won't find much kernel
>> developers there. ;)
>>
>
> Troll a lot do you? ;-)

Not really.

I just hate all the stuff which is necessary in C when I e.g. want a 
sorted list, map or set for whatever structure I have the need for. I 
had fun doing so 30 years ago, when I started to learn C, but now it's 
just tiring.

E.g. for the dependency based initialization order with DT I would have 
liked it to have a list (or map or set) of strings (sorted) in order to 
find a driver by name (fast). In C++ it would need something < 10 lines 
of source and I would be able to change the sorting algorithm from list 
to map(hash) or similiar by changing a few lines. Doing so in C is just 
a pain. Not to speak about all the possible errors when implementing the 
stuff in C again and again. Ok, the kernel provides some macros for 
lists, but e.g. they can be found only in the kernel (which means many 
people don't know or remember how to use them) and are by far not that 
flexible.

> While I like C++ (and quite a number of kernel people can in fact write
> C++ no problem) we can have a long debate about whether the STL is in
> fact 'done right' :-)

Up to now I haven't seen something really better. Of course, there are a 
lot of other programming languages which do make it easy to use lists, 
maps and similiar, but none of them is as fast and portable as C++ while 
still allowing to do low-level things (if necessary).

> Also, I don't think init (as in PID-1) should be a large program, and
> therefore writing it in C would be entirely reasonable.

It's a myth that C++ ends up in bigger code than C. At least in my 
experience. Especially when the latest additions to C++ are in effect 
(like the move-semantics in C++11 I like quiet a lot and which you get 
almost for free (by changing nothing) when you use the STL). Thread 
support is now also standardized (in C++11), quiet nice to use.

Regards,

Alexander Holler

  reply	other threads:[~2014-09-04 10:17 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 19:38 OT: Open letter to the Linux World Christopher Barry
2014-08-12 20:21 ` Steven Rostedt
2014-08-12 20:44   ` Borislav Petkov
2014-08-12 22:07   ` Måns Rullgård
2014-08-13  8:27     ` Peter Zijlstra
2014-08-13  9:00       ` Borislav Petkov
2014-08-18 18:15         ` Alexander Holler
2014-09-04  7:54           ` Peter Zijlstra
2014-09-04 10:16             ` Alexander Holler [this message]
2014-09-04 14:36               ` Austin S Hemmelgarn
2014-09-04 17:29                 ` Alexander Holler
2014-09-04 17:58                   ` Austin S Hemmelgarn
2014-09-04 18:11                     ` Alexander Holler
2014-09-04 18:27           ` Rogelio Serrano
2014-09-04 18:33             ` Alexander Holler
2014-09-04 19:18               ` Rob Landley
2014-09-05  6:31                 ` Alexander Holler
2014-09-06 20:01                   ` Alexander Holler
2014-09-06 23:44                     ` Lennart Sorensen
2014-09-07  1:42                       ` Alexander Holler
2014-08-13  9:24       ` Måns Rullgård
2014-08-13  9:31         ` Peter Zijlstra
2014-08-13  9:37           ` Måns Rullgård
2014-08-13  9:37       ` Martin Steigerwald
2014-08-13  9:52         ` Peter Zijlstra
2014-08-13  9:59           ` Martin Steigerwald
2014-08-13  9:54         ` Peter Zijlstra
2014-08-13  9:57         ` Måns Rullgård
2014-08-13 10:21           ` Martin Steigerwald
2014-08-13 20:19       ` William Pitcock
2014-08-14  1:08 ` Robert Hancock
2014-08-15 18:41 ` Jaswinder Singh
2015-04-08 13:12 ` Denys Vlasenko
2015-04-09  0:37   ` Rob Landley
2015-04-09 18:18     ` Denys Vlasenko
2015-04-10 12:40     ` Rogelio M. Serrano Jr.
2015-04-10 21:20     ` Aaro Koskinen
2015-04-11  1:08       ` Rob Landley
     [not found] <E1XHxA6-0000ar-2a@feisty.vs19.net>
2014-08-15  8:59 ` Vlad Glagolev
2014-08-15 14:04   ` Gene Heskett
2014-08-16 21:10   ` Rob Landley

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=54083C0F.1040807@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=bp@alien8.de \
    --cc=christopher.r.barry@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /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