Hey Guys,
I am hearing that WDF drivers can be written in C++. I have been doing this in C all the time. I have not seen any C++ samples as well.
Any opinions on this?? Is this documented somewhere?
Thanks
-Aj
Hey Guys,
I am hearing that WDF drivers can be written in C++. I have been doing this in C all the time. I have not seen any C++ samples as well.
Any opinions on this?? Is this documented somewhere?
Thanks
-Aj
This just means you havenāt been paying attention, for quite a long time. Surely itās time for this question to die. Multimedia drivers (audio and video) have been written in C++ for 25 years. Thereās nothing special about KMDF in this regard. Itās just a library. Remember, KMDF itself is all written in C++.
Iām waiting for drivers to be written in Rust. I think that language has great potential.
OP: Search the archives. Weāve discussed this at great length and weāre not going to rehash it here.
Rust: If you are sufficiently motivated, you can write Windows drivers in Rust today, because C interfaces are directly Rust callable. Iāve ādoneā it, if you can call issuing a DbgPrint from DriverEntry having āwritten a Windows driver in Rust.ā
As enthused as I am about the concept of having a modern language for system software programming, I did not enjoy my time using Rust even a little bit. And, yes, I did quite a bit more than just āwriting that driver.ā I found the language enormously cumbersome and frustrating. What was worse, was I found the state of Rust development chaoticā¦ with randomly contributed, supported, discontinued, added and deprecated features and ācrates.ā It made me insane.
My point is, I was all excited about writing drivers in Rust as wellā¦ until I actually spent a few weeks working in the language. Now, not so much.
I still miss āSystem C#āā¦.
Peter
@Tim_Roberts : Yes you are right that I have not been paying attention on this. I have written AVSTREAM drivers in C++ about 14 years back and I know it use to work. At that time it was not advisable to write other drivers in C++. I have not been writing windows drivers since then. So yes, my knowledge is not as up to date as it should be.
Thanks for the information guys. Really appreciate it.
Frustration is not always a bad thing. Rust, like Pascal, puts the focus on a terribly picky compiler. If you can express your solution in a way that satisfies the compiler, then the odds of successful execution are much improved. We C advocates are spoiled because the compiler allows almost any random sequence of characters to compile to something, and itās up to us to refine that at runtime.
That seems like a false note. Making a more fussy or less fussy compiler happy seems like addressing āsingle lineā issues. These are real problems, but usually of the least significant kind.
Being frustrated enough to spend the effort to figure out the answers to big problems never seems like a bad thing though
If you can express your solution in a way that satisfies the compiler, then the odds of successful execution are much improved
I understand that this is the intention. And I agree itās a valuable thing to do. And I really wanted to like it.
Doing it in Rust, howeverā¦ I just found it hard to grasp fully, and entirely no fun. I offer the following simple illustration of the basic precepts of std::result and matching from rust-lang.org:
I really find that unnecessarily annoying.
Ick. This reminds me of Lisp, or from even earlier APL ā¦
I think Iāll let Rust remain the thing I scrape off my grill every summer ā¦
LOLā¦ LOLā¦ APL. No, no, APL is really much worse:
avgā{+/āµĆ·ā“āµ}
Admit though - you still have your APL keyboard
mm
Sent from my iPhone
Admit though - you still have your APL keyboard
Oh, WOULD that I did.
Yep, although the 5100 that it went with has long since been retired ā¦ let a user program both in Basic and APL, still look back fondly at the āquote quadā for printing output ā¦ just didnāt get simpler than that, and the matrix math calculations were simple to set up. There are some versions of APL which are out there still for Linux ā¦ sigh ā¦
Iāve never actually seen one - Iām too young - but my father knew Ken
Iverson a bit. He rode the train with him when Ken was an adjunct or
something (not entirely sure) at Wharton and my father was a student. My
father said clearly brilliant, not entirely a practical sort.
mm
I remember that the APL āterminalā I used was one of those IBM typewriters with a āballā element. Ah, here, and a better picture here. Yup, it was connected to an IBM 360.
the matrix math calculations were simple
I remember being able to write the code to perform a multiple regression analysis in, like, 4 lines or something. Because matrix invert and transpose were native symbols.
There are some versions of APL which are out there
Oh, MUCH better than that. You can try it online: https://tryapl.org/
clearly brilliant, not entirely a practical
And that would describe APL, as well.
Well, we certainly have sucked this thread off into a different universe, havenāt we?
Peter
Well, we certainly have sucked this thread off into a different universe, havenāt we?
My fault, sorry. Itās a bad habit of mine.
No, no, noā¦ not at all. Itās been almost entirely me.
Well, at least we know the mods wonāt yell at us
P
Wow, I am glad that we like to have some fun as well.