News for hackers. Stuff that matters.
Re:C++ coroutines: Initial implementation pushed to master by jefftk on Sunday January 19, 2020 @07:47AM (#22091156)
I mostly agree with you, but operating systems and web servers are generally written in C and not C++. For example Linux, (the vast majority of) GNU, Apache, and Nginx are all C.

(Though I expect your parent has similarly negative views on C?)

Re:C++ coroutines: Initial implementation pushed to master by dgellow on Sunday January 19, 2020 @08:09AM (#22091240)
To balance with what you say:

Windows is mainly C for the kernel, and C++ for the rest https://en.wikipedia.org/wiki/Windows_NT#Programming_languag.... That's around 90% of the desktop/laptop market.

IIS, Microsoft's web server, is C++ https://en.wikipedia.org/wiki/Internet_Information_Services. I think it is still the 3rd most popular web server in the worldwide.

Re:C++ coroutines: Initial implementation pushed to master by wildmusings on Sunday January 19, 2020 @12:33PM (#22092614)
A significant portion of the C++ code in Windows uses very few C++ features or idioms and is basically C with classes or one or two useful features.
Re:C++ coroutines: Initial implementation pushed to master by gpderetta on Sunday January 19, 2020 @01:08PM (#22092839)
That's impossible. According to half of the comments in every c++ thread on HN, any usage of C++ will immediately converge to using all features!!

/s obviously.

Re:C++ coroutines: Initial implementation pushed to master by pjmlp on Sunday January 19, 2020 @12:34PM (#22092630)
Which is still C++.
Re:C++ coroutines: Initial implementation pushed to master by rleigh on Sunday January 19, 2020 @01:17PM (#22092896)
It is, but I do wonder if a large part of the problem with regard to using C++ features on Windows is the poor support for it in the ancient COFF linker and binary format they support. Lots of stuff like template export is possible with ELF which is impossible or dangerous on Windows.
Re:C++ coroutines: Initial implementation pushed to master by wildmusings on Sunday January 19, 2020 @01:28PM (#22092969)
I can also attest that lots of “modern C++” code exists in Windows.

There is code in Windows that was written yesterday and code in Windows that was written over three decades ago.

Re:C++ coroutines: Initial implementation pushed to master by pjmlp on Sunday January 19, 2020 @02:35PM (#22093442)
COM/UWP is the proper way to use C++ features on Windows in a inter-language way.

While not ideal exporting templates has been possible since Windows 3.1 days, as long as one sticks to a specific compiler.

Re:C++ coroutines: Initial implementation pushed to master by wildmusings on Sunday January 19, 2020 @01:00PM (#22092789)
Absolutely, but that kind of code doesn’t really speak to complaints about modern C++ and all it’s become. I just wanted to chime in with that extra information. I don’t really have a dog in the fight, other than having a lot of love for C and good C code.
Re:C++ coroutines: Initial implementation pushed to master by 72deluxe on Sunday January 19, 2020 @08:06AM (#22091231)
You are correct, thanks. My comment comes across as very irritated, but it's the same argument that will continue to the end of time I guess - "this tried, tested and widely used language is broken because it is not language $x and because it lacks this edge-case invented usage scenario even though it works adequately for 99.9% of all other scenarios as demonstrated by decades of use". It's wearying. Sure, C++ is complicated but so is English!

I thought nginx was C++?

I also thought large portions of Windows are C++? Everybody loves COM!

Re:C++ coroutines: Initial implementation pushed to master by jefftk on Sunday January 19, 2020 @08:15AM (#22091270)
Nginx is C, and the authors really don't like C++.

(I used to work on ngx_pagespeed, which was a C++ server module that plugged into Nginx to rewrite pages so they would load faster.)

Re:C++ coroutines: Initial implementation pushed to master by 72deluxe on Sunday January 19, 2020 @08:32AM (#22091337)
Thanks for the info!

Did they approve of your module?

Re:C++ coroutines: Initial implementation pushed to master by jefftk on Sunday January 19, 2020 @09:29AM (#22091577)
They liked that we were building something cool for their server, but our approach was so different from theirs (in ways that went way beyond the language) that our module wasn't ever going to become officially part of Nginx or anything.
Re:C++ coroutines: Initial implementation pushed to master by gigatexal on Sunday January 19, 2020 @10:14AM (#22091815)
No my terrible grasp of English even as a native speaker is the cause of this confusion. What I meant was: “No I meant that from cppreference using coroutines means you can’t use the features I mentioned not that those features don’t exist in c++20“
Re:C++ coroutines: Initial implementation pushed to master by stjohnswarts on Monday January 20, 2020 @03:59PM (#22102052)
There's no reason that any of those couldn't be written in c++ by good coders. It's just a historical thing.
Re:C++ coroutines: Initial implementation pushed to master by jefftk on Monday January 20, 2020 @04:38PM (#22102289)
My parent was arguing "C++ can't be as bad as you say, look at all these things written that use it". Things written in C are not evidence for this, anymore than things written in assembly.