Even though we have a lot of web technologies now, why are all WFS and WPS still cgi based? PHP allows tp read from postgres or other db's and HTML5Canvas or SVG can render the maps on the web. C++/Java Web Toolkits are available now which can talk to GDAL. But still, if we need a WPS, it uses cgi. Can anyone answer why?
why are all WFS and WPS still cgi based?
They are not.
HTML5Canvas or SVG can render the maps on the web.
Canvas and SVG are browser technologies for drawing. WFS and WPS are server protocols for retrieval and processing.
Non-cgi WFS/WPS: GeoServer, FeatureServer, ESRI tools, GeoTools. These are in Java, Python, and C++.
Perhaps your concern comes from the fact that CGI is an obsolete technology. However there are improvements like FastCGI or SCGI that work fine. First class HTTP servers like lighttpd or nginx can use these technologies for serving dynamic content.
I have set up WMS and WFS services with MapServer, lighttpd and FastCGI, and this combination has worked correctly.