Hacker News new | ask | show | jobs
by sgt 3288 days ago
It's not obvious - because I bet most of HN is wondering right now. It's not necessarily all wrong to be coding microservices in C - it has been done, and has been done in C++ as well. I like the pledge approach.

I would like to see nginx support here instead of just OpenBSD's web server. Perhaps this is because nginx won't work with pledge?

2 comments

For a specific example, iMatix had DSL's that outputted C which they used for high-performance server apps. If doing that for web apps, one would need a web framework for C that the code could call. I believe I've also seen both a C and C++ framework in the past. Both bragged about efficiency with the servers cheap.
The difference being that C++ offers the language features and standard libraries to write safer code, while C....
>C++

>Safer code

Not really. I mean, using vectors and strings is nice, but that's about it for safety. You'll still get a shit-ton of memory leaks which isn't great for long-running web apps.

It seems you haven't updated yourself on C++11, C++14, C++17 best practices.

If the code has any explicit new/delete or malloc/free, then something is wrong with the design.