This is as good an example, as I would bye without any hesitation :-). I’ve seen few C++ windows kernel driver, at the FS filter level, well before WDF/KMDF. Did they ever fly? Not really.
In user mode, as I said, I used many of the C++ features, and on my days - I can get the crap out of it using gdb/lldb or Windbg. Also around 2005 I wanted to read the design behind C++, and never seen any place it is targeting kernel. It was all about large system software. IMO that is where the daemons/services lives…
One of the daemon, I handle sometime is over 80 to 90K C code. And that is where I do the redesign, whenever I get a chance. For example, coming up with a C++ interface and give to 3rd party to implement those interfaces in C++ ( they love C++
), and I can provide c to C++ interface. What I get is to dynamically support many libraries ( just short of IUNKnown () :-). So there is a conscious support to make it C++ where it is needed.
Same with the other infrastructure I mentioned earlier. I took these kind of risk/effort - first to give junior and intermediate engineers to take ownership and something they can put their teeth on, second ownership delegation…
When I do trap like thermal APIC interrupt, or stay on top of VFS or if needed do a blind kernel stack walk on released kernel, etc. I go for C, and not afraid to use ASM. And these things goes to many ( really large) users…
I don’t think it is old mentality ! It is just - experiences taught us what tools to use when needed .
For those in the teaching business, I can understand how important to be C++/Java to be relevant, since most college and university don’t deal much with low levels .
BTW:: I’ve said earlier, and now gain , if some one can refer to an exceptional compiler seminar that would cover modern compiler technology, that would be of real help 
-Pro
On Jul 7, 2018, at 11:11 AM, xxxxx@gmail.com wrote:
>
> Using C++ as a better C; Ok, I can almost buy that argument. I think it comes down to the developer, and getting the job done. I worked on a project where another company was contracted to write a NT 4.0 miniport for a new SCSI controller. The company worked on it for two years, and was under threat of a lawsuit because they could not get their driver working. I was called in to take over the project. I spent 3 days (20+ hour days) digging in to the 500 page spec., and looking over the existing code.
>
> The developers were known for their SCSI knowledge, and had worked on many other SCSI projects. They tried to reuse a lot of that old code. Most of it was related to bus arbitration, and phase changes. The retail driver binary was about 89K. I soon realized that the controller had meta commands. Setup up for DMA, set up your parameter values, and ask the controller to send data to the target (the controller handled all of the bus arbitration, message phase, status phase, etc…). After three days, I had the driver retail binary down to 4K (that was as small as a driver could be.) Checking the map file, I had about 1200 bytes of code and something like 48 bytes of data. I could have very well written that driver in ASM and made it smaller, and faster. But, C is nearly as efficient as ASM, the driver was screaming fast, and the customer was happy.
>
> So, in that case 1) code reuse was BAD, 2) I barely needed C, C++ would have just been silly.
>
> We face different problems in the kernel. Problems that you really don’t solve using C++. Shoot me or whatever, maybe it is just because I am old-school when it come to the kernel. On the flipside, I am really digging node.js and lambda like cloud functions. 
>
>
> On Sat, Jul 7, 2018 at 1:16 PM xxxxx@gmail.com mailto:xxxxx > wrote:
> You know, I mentioned this exactly 10 to 15 years ago, perhaps as a reaction to Alberto’s famous rant about ASM or Peter’s liking of C# 
>
> Functional programming is a powerful tool back in 90s to have proof systems. Of course Kenith Iverson came Weill before with APL :-).
>
> Trusted computing group, as I know, looks at those languages, many because of proof system. I no longer know enough, if there is any effort to have systems implemented using functional programming languages. May be not PRACTICAL !!
>
> But staying on this current thread, I mentioned because Peter loves to see C# :-). Need to avoid departure from the main topic.
>
> I see people screaming about what a beautiful feathers being added to C++ in modern days, and how can you live with C ???
>
> And most kernel codes are still in C, only C, nothing but C :-).
>
> Sure there are some advantages! Was it worth considering ? Is the question.
>
> Like Agile people always thinks — stand up and say your right. Otherwise projects are bound to fail. Then who know how to follow system will create but load of tickets to show they are working really hard.
>
> Coding styles comes from people, I’ve seen easily can create a functions or two with more than 1000 lines, then preach do not use the following format —-
>
> If( cond ) {
> <…>
> }else{
> <…>
> }
>
> But use —
> If ( cond)
> {
> <…>
> }
> Else
> {
> <…>
> }
>
> These are lack of SANITY when they come up with ideas ( when they don’t care about basic senate of software design, like any engineering ).
>
> Then there are people - never hard of Big endian, Aligned memory etc., would come and say I will port your kernel code to C++, more reliable.
>
> I’ve lived, and been living thru this. So it is not surprising some will come with — I’ve a library and publications that will help you code in C++ in the kernel. Oh, BTW only exception safe code can be used …. Dude, kill me now 
>
> -Pro
>
>
>
> > On Jul 7, 2018, at 9:55 AM, xxxxx@hotmail.com mailto:xxxxx > wrote:
> >
> >> Basically, the Platform owner has to push. How about C# ?? Or Java ?? Or Go ??
> >
> >
> >
> > I would rather suggest Haskel - test your code once, and if it works, it is going to work in 100% of cases, without any possibility of a random bug that reveals itself only once in a while. Sounds fantastic, don’t you think…
> >
> >
> >
> >
> >
> > Anton Bassov
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > Visit the list online at: http:>
> >
> > MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
> > Details at http:>
> >
> > To unsubscribe, visit the List Server section of OSR Online at http:>
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
> Details at http:>
>
> To unsubscribe, visit the List Server section of OSR Online at http:>
>
>
> –
> Jamey Kirby
> Disrupting the establishment since 1964
>
> This is a personal email account and as such, emails are not subject to archiving. Nothing else really matters.
> — NTDEV is sponsored by OSR Visit the list online at: MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at To unsubscribe, visit the List Server section of OSR Online at</http:></http:></http:></http:></http:></http:></mailto:xxxxx></mailto:xxxxx>