As an example, the fossil DVCS is written in C and contains a web server written in C. http://fossil-scm.org/index.html/tree?ci=trunk
See also: http://stackoverflow.com/questions/1453665/what-is-good-fram...
- In web development - for most products - speed of development and maintainability trump out right performance
- Most languages abstract away the machine architecture (Ruby, Java, PHP) and all simply with dealing with higher level primitives
- While garbage collection is available in C, modern languages such as Ruby, Python, PHP and Java have much nicer native implementations
- Web frameworks are far more advanced for other languages then C (RAILS (ruby), Yii(PHP), Django(Python), Grails(Ruby) just to name a few)
- The other languages have a much richer native types/and object models then C
Given these - there is nothing preventing you from using C for web development, given sufficiently experienced and capable developers.
I agree with your post.
Groovy became a clone of Ruby within 2 yrs of its creation, what with similar closure-based functions, the meta-object protocol, the paren-less DSL syntax. The overall syntax is different, being like pre-version 8 Java's, and it must run on the JVM, but besides that Groovy (and Grails) are just clones of Ruby (and Rails). Heck, their names even sound the same, that's because their business purpose is to steal x% market share from Ruby & Rails.
Good info. Thanks.
The biggest influence of why the lines get drawn where they are is simply evolution. Whatever tools and problem domains are hot at the same time get married. The two both influence each-other and continue evolving on their own. Which is why the interfaces on a fantastic framework still might not be as nice in C. Once your database schema is autogenerated from introspection, do you want to go back?
The stickiness of what tools are right for which jobs means that people developing in C++ tend not to make the most of everything available to them. (It's not C, but better for my example where...) On the other side, when I build things in C++ and take advantage of everything at my fingertips, people still assume I'm rubbing two pointers together to create fire.
I did create a few systems in C, using many custom tools and the only way I can describe the final results is that they were rather restrictive.
Even with a template system, plugin abilities and other modern features you are essentially locked into your initial design goals. Code iteration is limited by the change/compile/deploy cycle - with the compile cycle being rather time heavy.
Secondly, the fragility of debugging crash bugs requires a full-blown debugger environment or developing a nice stack-dump system ,which I eventually wrote.
In other words, the biggest problem was lack of tools, a lack of support for quick dev cycles, and support for such a system.
If I had to do it over again today, I'd use an embedded compiler running in a fastcgi like daemon. This would allow you to speed up the dev cycle and be able to contain segfaults, memory leaks, and the like. QEMU or TCC would be a good start. Perhaps even a stripped down docker environment.
Pure C in a fast-paced dev cycle is just too rigid and error-prone.
Sounds like nginx's lua plugin. Anything non-performant can be written in lua. Anything performant can be written and C and called from lua. Best of both worlds.
It would take way to long to accomplish even basic updates and tasks. To me it just makes it the wrong tool for the job, like using a screwdriver to drive a nail into the wall. Just doesn't make sense when better tools exist.
https://golang.org/doc/articles/wiki/
Go is not too far removed from C.
Back in that late 90's early 2000's we wrote ISAPI extensions in C/C++ quite often for performance critical problems, e.g. searching etc. IIRC, ebay was also doing that because performance was so critical. But the difference between writing single extensions versus a full website in C is pretty significant.
Not saying it is impossible, but I just don't think the tooling and frameworks are there yet to make it practical or productive in comparison to say Go/Node/ASP.net/PHP/Python etc. Not saying any of those are better languages, just that they are more setup for the web model.
If C and Go are somewhat similar and Go can be used for web development then perhaps C can be enhanced for web development. Go provides templates and and an http library, for example. People aren't really answering the question.
I think, where it comes to what is useful for web dev, Go is actually pretty far removed from C. OTOH, much of that could be overcome with an appropriate framework, and in fact there are C web frameworks. [0]
[0] e.g., https://embedthis.com/esp/
It's also geared more towards porting existing code right now so the libraries are made to look like POSIX APIs (which are incomplete) rather than Web APIs. Also games seem to be the focus rather than websites.
That plus it's much easier to make some really awful mistakes in C than it is in languages more often used for web development, so why risk using C if what it gains you isn't helpful?
I would guess it's because the web evolve quickly and for most webdevs the 'moving fast' is more important than 'moving the right way'. C is less forgiving language than PHP/Python/JS. Also the bar for C is higher than for PHP.