Live data from Hacker News

BCHS stack – BSD, C, httpd, SQLite

learnbchs.org

51–59 of 59 posts

Re: BCHS stack – BSD, C, httpd, SQLite

#51

Earlier quoted context omitted.

Have experience with GO. Feels like C in terms of lack of templates, and feels like Java in terms of "how I avoid world-freezes by GC". Go seems semantically less rich than C++ language makes you write MORE code for the same thing you would write in C++ using your HTTP-framework.

> feels like Java in terms of "how I avoid world-freezes by GC" No… that’s not Go’s GC that you have experience with. I don’t know what language you used that you confused with Go. GC pauses in Go are notoriously tiny, since Go prioritizes consistently low latency. I’ve worked on many Go projects, and GC is not something that I worry about. > Feels like C in terms of lack of templates Are you seriously implying that…

> No…

Yes. I don't need any micro-freezes.

> Are you seriously implying that C was not designed for large projects?

C was designed to move from asm to something highlevel. C made possible to write larger projects than in ASM. That's all. There is no absulute measurement of project size, only relative: larger->smaller. Go goes to "smaller" direction compared to C++.

All that arguments about safe/bugs etc is old. In modern C++ you write with no controlling memory allocation at all and you dont write your own arrays with can be overflown.

Re: BCHS stack – BSD, C, httpd, SQLite

#52
post #12

Writing web-facing code in C in 2021 is seldomly a good idea, even if it runs on OpenBSD in a jail.

Jails are a FreeBSD concept, not implemented in OpenBSD. OpenBSD has a lighter form of sandboxing with `pledge` and `unveil`. My favourite explanation for these system calls is from SerenityOS, which uses similar versions of the calls:

https://awesomekling.github.io/pledge-and-unveil-in-Serenity...

Re: BCHS stack – BSD, C, httpd, SQLite

#54

Earlier quoted context omitted.

> feels like Java in terms of "how I avoid world-freezes by GC" No… that’s not Go’s GC that you have experience with. I don’t know what language you used that you confused with Go. GC pauses in Go are notoriously tiny, since Go prioritizes consistently low latency. I’ve worked on many Go projects, and GC is not something that I worry about. > Feels like C in terms of lack of templates Are you seriously implying that…

> No… Yes. I don't need any micro-freezes. > Are you seriously implying that C was not designed for large projects? C was designed to move from asm to something highlevel. C made possible to write larger projects than in ASM. That's all. There is no absulute measurement of project size, only relative: larger->smaller. Go goes to "smaller" direction compared to C++. All that arguments about safe/bugs etc is old. In mo…

> All that arguments about safe/bugs etc is old. In modern C++ you write with no controlling memory allocation at all and you dont write your own arrays with can be overflown.

People say this, but they never point to any large, popular projects that demonstrate it.

If you write any serious project in Rust, you'll quickly realize how unsafe "modern" C++ is. There's just no comparison. I'm happy for people to pick whatever memory safe language meets their needs, and most of those are garbage collected. Garbage collectors are fine for most software, but Rust exists for situations where they aren't fine.

> C was designed to move from asm to something highlevel. C made possible to write larger projects than in ASM. That's all. There is no absulute measurement of project size, only relative: larger->smaller. Go goes to "smaller" direction compared to C++.

By your definition, everyone should be writing Haskell, because a single line of Haskell can take tens of lines of C++ to express the same code. Haskell is immensely powerful in this way.

Re: BCHS stack – BSD, C, httpd, SQLite

#55

Earlier quoted context omitted.

> feels like Java in terms of "how I avoid world-freezes by GC" No… that’s not Go’s GC that you have experience with. I don’t know what language you used that you confused with Go. GC pauses in Go are notoriously tiny, since Go prioritizes consistently low latency. I’ve worked on many Go projects, and GC is not something that I worry about. > Feels like C in terms of lack of templates Are you seriously implying that…

> No… Yes. I don't need any micro-freezes. > Are you seriously implying that C was not designed for large projects? C was designed to move from asm to something highlevel. C made possible to write larger projects than in ASM. That's all. There is no absulute measurement of project size, only relative: larger->smaller. Go goes to "smaller" direction compared to C++. All that arguments about safe/bugs etc is old. In mo…

> In modern C++ you write with no controlling memory allocation at all and you dont write your own arrays with can be overflown.

The simplest and most straightforward way to access an std::vector item allows OOB read. Literally every smart pointer an be empty and will UB with no warning if deref'd in that state (that includes the brand new std::optional). The rules of X remain a tarpit lined with shit-smeared stakes, Chrome got bit by a GDI leak just a pair of years back because of that (a refactoring in an RAII object removed an operator= overload and started leaking GDI handles by the hundred when using chrome remote desktop).

Re: BCHS stack – BSD, C, httpd, SQLite

#56
post #9

Any one use open BSD to host servers? Last time I checked httpd didn't support http/2.

For most stuff http/2 doesn’t matter. I guess at some point they’ll want to add support for http/2, for now it not important unless your a fairly large site.

Don't Google et al. already penalize your search ranking for not offering http/2?

Re: BCHS stack – BSD, C, httpd, SQLite

#57

I've been ``statically'' compiling my php scripts to HTML. It's marvelous. My build system is a makefile, and it feels like I'm parodying myself and the entire industry. Is this the same?

It could be, but the presumption is that you're not building something that could just be compiled down to a static site at the end.

Re: BCHS stack – BSD, C, httpd, SQLite

#58
post #9

Any one use open BSD to host servers? Last time I checked httpd didn't support http/2.

I host my personal site on OpenBSD and its built-in httpd, though in its current incarnation it's just serving static HTML. No, no HTTP/2, but if I cared about that I could install Nginx and use that instead.

httpd's config syntax is mostly sane and error messages are mostly legible, and that it's written by OpenBSD's core devs inspires confidence. I recommend that system admins at least give it a try, especially if they've already decided to use OpenBSD. It can't do everything but I think it does enough to meet the needs of 80% of the web's sites.

Re: BCHS stack – BSD, C, httpd, SQLite

#59

Doing web development in c and getting that sweet performance boost is very tempting but the time it takes to develop even a simple website is just not worth it. I would rather spend a few pound extra on servers and goto the cinema than the hours of developer time it would take to build PHP sites in C++

You can get the same performance boost without the footgun of C if you use e.g. Go, I've done so for a while now and I'm quite enamoured by it. Possible downside is that it ships with a runtime, so binaries are at least 10MB (before optimizing for size). That said, you mention PHP, I wonder how PHP running in HHVM compares to a more bare metal solution (or regular interpreted PHP).

I agree, Anyone who runs a Go web service would probably concur. Switching to Go for my web applications has not only enabled me to make faster releases but has also increased the capital efficiency from the cost savings for HW resources(Because of efficiency).
Post reply on HN