←back to thread

488 points levkk | 1 comments | | HN request time: 0.207s | source

Hi everyone,

I've been "funemployed" for a few months and with all that free time and idle hands I wrote a full web framework (think Rails, not Flask) for Rust.

It's boring old MVC, has its own ORM, templates, background jobs, auth, websockets, migrations and more. If you're keen but don't feel like rewriting your app in a different language, Rwf has a WSGI server to run Django (or Flask) inside Rust [1], letting you migrate to Rust at your own pace without disrupting your website.

I think Rust makes a great prototyping and deploy straight to production language. Now it has yet another framework for y'all to play with.

Cheers!

[1] https://levkk.github.io/rwf/migrating-from-python/

Show context
imiric ◴[] No.41918890[source]
After years of working with web frameworks in Python and Java, and then picking up Go along the way, I've come to appreciate Go's approach much more. That is, with a rich and capable standard library, you really don't need traditional frameworks. Need an HTTP server, router, etc.? Use stdlib. Need templates? Use stdlib. Need an ORM? You don't, but you may want to consider a small 3rd party query builder library of your choice. And so on.

This avoids depending on a complex framework that may or may not exist in a few years, improves security by minimizing the amount of 3rd party dependencies, keeps the learning curve low for any new developers joining the project, and is more flexible and easier to maintain. I don't have experience with Rust, and judging by the comments here, web frameworks might still be useful for it. Which is a shame, since the batteries included stdlib approach is far superior IME.

Anyway, I don't want to shoot down your efforts. Congrats on the launch and good luck!

replies(13): >>41918959 #>>41919110 #>>41919336 #>>41919738 #>>41919823 #>>41920300 #>>41920442 #>>41921397 #>>41922584 #>>41923056 #>>41923336 #>>41924884 #>>41924982 #
qudat ◴[] No.41918959[source]
Agreed on all fronts. Go has nailed the stdlib and every other language is in its shadow
replies(1): >>41919078 #
t-writescode ◴[] No.41919078[source]
This is a major component of what drew me to love C# so much for a while. It's also one of those Perfect StdLib(tm) languages. Many of the components do need to be downloaded through nuget; but they are a part of the stdlib!
replies(1): >>41920324 #
Nuzzerino ◴[] No.41920324[source]
Would it be a fair comparison? C# didn't have good support for JSON in the standard libraries for almost 20 years[1]. ADO.NET seemed like a failure to me as well, but maybe I just didn't understand it.

The System.Drawing namespace at least as of .NET Framework 4.5 required virtually all of its operations to be done through a System.Drawing.Bitmap, which meant that no matter how your image data was represented, it needed to get rasterized. This wasn't a big deal for most desktop/local use cases, but it's very inefficient, so if you had any servers relying on this, and had a reasonably decent amount of traffic to those servers, you could be getting CPU usages way too high.

As an example, I remember one time we were hosting 30 kb TIFF images (high res, 1 bit per pixel) for download, and generating the thumbnails was done in real time, which caused literally gigabytes in memory churn per request due to the rasterizations... IIRC I fixed it by using emscripten (this was 2015-2016) to do resizing and rendering in the frontend with a small C module using LibTIFF, then the server only needed to send the 30 kb files as is. Unfortunately I've had a hard time finding people to work with these days that give me that kind of room to execute.

Does Go's standard library have these rough edges or is it actually pain-free? I'm on the fence about whether I should learn Go or Rust while I am on a short employment break.

1. https://github.com/dotnet/runtime/issues/27761

replies(2): >>41920504 #>>41922739 #
1. egeozcan ◴[] No.41922739[source]
Declaring a stdlib free of rough edges would be like declaring a complex piece of software bug-free.