

Ask HN: Why aren't there enough C & C++ Web frameworks?  - slake

How come there are no nodejs equivalents for C &#38; C++? They're faster, have better libraries and have a larger developer base!
======
rdouble
Because it sucks to deal with strings in C & C++, and the web is mostly
strings.

~~~
slake
Is 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
C 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
Or you could just strdup and malloc a bunch of strings and let the kernel
clean it up when the cgi process exits. ;)

------
niggler
You should investigate "CGI", arguably the simplest such "framework"

------
mschuster91
Easy 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
Well 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.

------
throwaway420
The 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
Yeah but if CRUD alone was what's important, doubt the world would have gone
far beyond PHP, right?

------
stewie2
<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
Sweet I'll check it out.

------
dmm
The OpenBSD news site undeadly.org is written in c. You can grab the source
here: <http://undeadly.org/undeadly-src.tar.gz>

------
yen223
In 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++ :)

