Hacker News new | ask | show | jobs
by binaryturtle 50 days ago
Wouldn't it be even more ideal to have the webserver and app be one and the same binary, all bells and whistles included? No need for CGI at all. Just one static binary, no extra disk I/O needed to load resources (all compiled in statically). Basically you can make the OS deny this app any additional disk access for additional hardiness.
1 comments

I've done what you described with Rust and 1 dependency. The reason to not do that is because TLS is a pain in the ass.

But more to your point, I think what makes this httpd scheme especially attractive (for C users especially) is that you can't try to "optimize" anything. There is no temptation to lock/mutex/cache yourself into more problems. Its 1 process that then dies. Even 'free' becomes optional in some cases.

What was the problem with TLS you ran into?