I'm mainly a C dev and I would never ever use C to write a web app. Not because I don't think it could be done, not because I don't think it could be done well but simply because string manipulations in C are a pity. Containers which are not dumb arrays in C are a pity. SQL bindings are much more tedious than the higher-level languages counterparts (I wrote quite a bunch of C interfacing with SQLite, it works well but requires a lot of LoC compared to perl for instance).
Basically 90% of what you do in a typical web framework in your scripting language of choice becomes 10 times more tedious and error-prone in C (and probably 100 times faster but frankly, who cares?)
It's already painful when I need to write sysfs and debugfs interfaces (and the linux kernel has a pretty nice API to write in those).
The only reason I can imagine for using C in a web app is performances but then:
1/ I would try to profile my app and see where the bottleneck is. If it's really CPU-bound and C would really help I'd try to write a small C library for this particular piece of code and bind it in my scripting language.
2/ If I really must write the whole thing in C for some reason I'd try to push for a subset of C++ with at least std::string, std::map, constructors and destructor to ease ressource management and maybe exceptions for error handling. Done well you'll get similar performances and with a bit of luck you might actually come up with something remotely maintainable.
Basically 90% of what you do in a typical web framework in your scripting language of choice becomes 10 times more tedious and error-prone in C (and probably 100 times faster but frankly, who cares?)
It's already painful when I need to write sysfs and debugfs interfaces (and the linux kernel has a pretty nice API to write in those).
The only reason I can imagine for using C in a web app is performances but then:
1/ I would try to profile my app and see where the bottleneck is. If it's really CPU-bound and C would really help I'd try to write a small C library for this particular piece of code and bind it in my scripting language.
2/ If I really must write the whole thing in C for some reason I'd try to push for a subset of C++ with at least std::string, std::map, constructors and destructor to ease ressource management and maybe exceptions for error handling. Done well you'll get similar performances and with a bit of luck you might actually come up with something remotely maintainable.