6 ms·
Ask HN: Why aren't there enough C & C++ Web frameworks?
How come there are no nodejs equivalents for C & C++? They're faster, have better libraries and have a larger developer base!
- niggler 14y agoYou should investigate "CGI", arguably the simplest such "framework"
- mschuster91 14y agoEasy for C, getting shit done (tm) is something for pros. The subtlety of getting malloc, free, and pointer arithmetic in general, right just isn't easy for a novice coder. C++ suffers from the same problem, just to a lesser degree. node.js on the other hand has the advantage that nearly everyone who knows a bit of JS from his latest website gig can also do a node.js application.
- slake 14y agoWell isn't that really because nodejs has the V8 engine behind it which has created enough helper functions and libraries to make it easy to make a webapp on. Otherwise there isn't much on the barebones JS language itself to build a webapp is there? If C/C++ got those frameworks wouldn't they have had these libraries built as well.
- slake 14y agoYou're right on the pointer arithmetic though. But JS callbacks are pretty confusing too. But ppl learn it because they have to.
- throwaway420 14y agoThe average website essentially boils down to a CRUD app of some sort. You're creating, reading, updating, and deleting text in a database. Does using C really benefit the average new business with this task? I'd love to do more C web-development, but it's sort of logical that C web frameworks aren't as common as other languages.
- slake 14y agoYeah but if CRUD alone was what's important, doubt the world would have gone far beyond PHP, right?
- rdouble 14y agoBecause it sucks to deal with strings in C & C++, and the web is mostly strings.
- slake 14y agoIs C & C++ really worse than Java at strings? Don't think so but I'm not sure. Can't imagine they're far apart.
- mschuster91 14y agoC definitely - strlen() not binary safe, you have to deal with malloc()/free()/strdup() etc. by hand instead of letting a highly optimized GC do the job...
- dmm 14y agoOr you could just strdup and malloc a bunch of strings and let the kernel clean it up when the cgi process exits. ;)
- wmil 14y agoYes. C & C++ strings are so bad that most large libraries ship with their own string functions.
- stewie2 14y agohttps://bitbucket.org/futurapp/swiftly https://bitbucket.org/futurapp/swiftly This is a C++ web framework I wrote. It's a work in progress. I could beat go and nodejs in some simple perf test.
- slake 14y agoSweet I'll check it out.
- yen223 14y agoIn a way, all web frameworks are written in C - at least, the Python, Ruby, and PHP interpreters are written in C, and the V8 engine is written in C++ :)
- dmm 14y agoThe OpenBSD news site undeadly.org is written in c. You can grab the source here: http://undeadly.org/undeadly-src.tar.gz http://undeadly.org/undeadly-src.tar.gz
- deleted 14y ago[deleted]