C++ is fast, and with modern(C++14/17) features highly productive. I would have thought this would be one of the first choice to design web development frameworks, but that’s not the case. What am I missing?
The choice to design a web development framework depends on the interest and skills of the people who wants to build frameworks. For the most history of web application development people have used "scripting languages" and thats why most of the frameworks are based on those languages, also these languages are "productive" and good enough for implementing the typical CRUD layer over a database which is what most web apps are about.
Check out https://github.com/ipkn/crow for a Modern C++ web framework.
NOTE: I used to do C++ 5-6 years ago and now getting back to it by going through modern C++ and also the idea that learning C++ as a layer on top of C is a bad bad idea to learn C++.
C++ is used heavily in backend web development. NodeJS uses all kinds of native modules written in C++. Also, many people write micro services that require high-performance intensive CPU usage in C++, then interface with them over something like Kafka.
Writing your basic request handling middleware app code is rather pointless in C++ though. You don't really gain anything over a scripting language like C#.
Here is the source code for a lightweight Webserver in Qt C++. It works very similarly to J2EE and Java Servlets. I've personally used this starting block for building my own web services since I am most familiar with C++.
You've listed a lot of great qualities of C++ as a language. But you've also failed to mention that C++ is rarely taught in CS curriculum, most people don't know it, it's got a steep learning curve, and those great features aren't what's necessary to make a web framework to support close to 90% of what web frameworks need to do which is basically serve as 1) a Crud Layer on a database 2) maybe do server side rendering if you decide to go that route. On the other hand, LAMP and MEAN stacks are popular and low barrier to entry and most CS curriculums seem to include either Java, Python or some other scripting language.
Lack of (easy) cross-platform compatibility? With languages running on top of VM, your production OS can differ from what developers are using on their machines. With bare metal languages, it is of course also possible, but requires extra effort.
NOTE: I used to do C++ 5-6 years ago and now getting back to it by going through modern C++ and also the idea that learning C++ as a layer on top of C is a bad bad idea to learn C++.