DEV Community

Jesse Bennett
Jesse Bennett

Posted on

Curb your enthusiasm for tech

Part of going online and saying things is that you tend to want to make them a reality. It was some time ago I really put my foot in my mouth claiming that I wanted to make a "streaming web server with foundationdb as a backend". Wow! I had no idea what I was getting into. Originally I wanted to use C# but, as it's pretty obvious, I use BSD so porting and building entire languages was a non-option when scaling down to minimal embedded hardware. I, unfortunately, unloaded on the FDB forums much of the turmoil in my soul.

Image description

Rather than completely stew about it I actually took the suggestions given to me in the FreeBSD forums. What I did was do the research comparing all the different languages discussed which were C#, C++, GoLang, and Rust. I even took a sharp turn into F# and Bosque. Still though, the main target was the web server. The web server has not seen many changes IMO since the days of DHTML and Perl other than a slew of extra options. I proudly use NGINX it's really good and have even reviewed it's internals when I was messing around with C++. With NGINX and it's module system it is possible to make just about anything which is why it has been so popular. I use it all the time as a proxy and for interactive stuff that is mainly how it is configured. What if this could all be done in one place? Enter the streaming web server.

Image description

It's actually such a broad idea it doesn't mean much is what I learned. Really, from the web developer perspective what is needed are "buffers". These buffers should work like they do in Kakoune or Emacs. Ok, so now an idea is starting to emerge let's see what all the research yielded.

C# .Net Core
I was able to make a very simple web server but all the more important methods for the MS web stack became more and more private creating a web of dependencies. I could not hoist my code into anything reasonably efficient on an alternate OS despite getting really far. I did create a working web server on FreeBSD.

Image description

F# .Net Core
Somehow this ended up being a better choice than C#? Not sure why that is but probably has more to do with it being a non-mainstream language so more of the features are there. I forked MiTLS to create a modern F# web server which was pretty cool but, again, the tooling was a problem on an alternate OS.

Image description

C++
I actually got pretty far with C++ using Kqueue and Sendfile(2) but realized over time that I could not be productive enough to build out all of the internals. I got the performance I wanted and really settled in but this whole thing about "memory safety" guarantees was really bugging me.

Image description

GoLang
GoLang, as I discovered, was really fun and refreshing. I would have completely chosen it if it hadn't had been for some changes to the base system which had me feeling like I was just at the wrong place at the wrong time. At this point with GoLang and C++ I'm on the ARM architecture and embedded is getting closer and closer.

Image description

Image description

Bosque
I fell in love with Bosque but when I found myself writing my own internals and major shifts to the ecosystem began arriving I had to back down from Bosque. In terms of running on an alternate OS it's perfect. I got Bosque running on my freaking iPhone via the Ish app! It's one to look out for but a little too early in the game.

Image description

Rust
Rust was the only language I could feel productive enough in, have those memory safety guarantees, build on ARM without any hassle all while being on an alternate OS. Server Sent Events arrived last year and the "streaming web server" has been created with FoundationDB as a backend. It was a long journey but I guess it was worth it in the end to give all of this consideration to each and every language.

Image description

Top comments (0)