Most active commenters
  • imiric(3)

←back to thread

488 points levkk | 13 comments | | HN request time: 1.23s | source | bottom

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 #
threeseed ◴[] No.41920442[source]
I develop in Go every day and it's by far the worst language I've ever used.

Having to explicitly handle every type of error immediately without any support for deferring, encapsulating, chaining, manipulating, transforming etc is antiquated and tiresome.

Rust has Option and Result types and all of the niceties along with it.

replies(3): >>41920684 #>>41921745 #>>41921816 #
1. pluto_modadic ◴[] No.41920684[source]
hear me out. golang quality stdlib, with Option & Result types from haskell or rust.
replies(6): >>41920849 #>>41921091 #>>41921126 #>>41921515 #>>41923756 #>>41935907 #
2. threeseed ◴[] No.41920849[source]
Sounds like Scala Native: https://scala-native.org/en/stable
3. hackerbrother ◴[] No.41921091[source]
The dream. Someone posted this, which is designed along these lines, here not long ago. https://github.com/borgo-lang/borgo
4. shepherdjerred ◴[] No.41921126[source]
Native Option/Result types + algebraic data types would solve quite a few complaints I have about Go
replies(1): >>41922365 #
5. jon_richards ◴[] No.41921515[source]
Don't forget enums. And lets get rid of the insane := syntax that makes no sense when basically every function is returning 2 values. Not to mention shadowing bugs like this:

  var cursor int64 = 0
  for {
    rows, cursor, err := db.PaginatedRows(cursor)
    ...
  }
replies(1): >>41922268 #
6. egeozcan ◴[] No.41922365[source]
It would solve many of my complaints as well.

But, to be honest to myself, I don't think anything will be too different in my day-to-day programming, nor that I would produce better code with less bugs.

replies(1): >>41926756 #
7. amedvednikov ◴[] No.41923756[source]
V is Go with Option/Result, enums, ORM etc:

https://vlang.io/compare#go

replies(1): >>41924069 #
8. imiric ◴[] No.41924069[source]
V is half-baked in many ways and shouldn't be considered for anything serious.

Odin[1] is a better alternative in the niche modern language space, and also shares many design choices with Go. It has operators like `or_return` and union types like `Maybe(T)`, which can in practice be used for improved error handling.

Though I honestly don't find Go lacking in this sense. The syntax is a bit verbose, but it forces you to think about how to handle every error, which is a good thing. There are far more important design topics worth discussing than this. Go usually makes more correct trade-offs where they matter compared to other languages, and most of the criticism it receives is unwarranted IMO.

[1]: https://odin-lang.org/docs/overview/

replies(2): >>41925416 #>>41935809 #
9. amedvednikov ◴[] No.41925416{3}[source]
It's not half baked lol.
replies(1): >>41926841 #
10. shepherdjerred ◴[] No.41926756{3}[source]
Adts eliminate certain kinds of bugs like nil pointer dereferencing, and, if you model your types correctly, makes invalid states unrepresentable
11. imiric ◴[] No.41926841{4}[source]
Ah, you're the author. :D

I mean, kudos for sticking to it over the years in spite of the mountain of criticism, but I personally confirmed a few months ago that it's indeed half-baked. :) Certain features work sometimes, but often fail in cryptic ways. The documentation is a mixture of missing, outdated, wrong or aspirational. I've forgotten the specifics, but I remember being frustrated by it relatively quickly, and abandoning it altogether in less than a week. Good luck with it anyway!

12. baranul ◴[] No.41935809{3}[source]
Odin can be considered even more "half-baked". It is not a mainstream "corporate approved" language either. It's one thing to suggest sticking with Go or using C# as an alternative, it is another thing to suggest languages like Odin, Zig, or some other almost unknown like C3. At least V has a place at the table, with being an actual useful alternative to Go. Has a significant following and hardcore fans, because V gives them the missing features that many Go users have been begging or looking for (enums, sum types, immutability, easier C interop...). Same can kind of be said for Zig, with having a significant following, and pushing it as an alternative compiler for C.

Anyone taking a serious look at Odin or C3 (strangely morphed from C2 into being more Jai-like or Odin-like), will know they are both no where near to being production ready or 1.0 (many years far away), despite both being old. Odin has less of a following, less contributors, minimal documentation, no books on Amazon, and many of its good ideals were admittedly "borrowed" straight from Jai. Many consider Odin a Jai-clone, where it would be better to wait on the "real McCoy", which would be Jon Blow's releasing of Jai to the general public. Jai fans[1] are about as hardcore as it gets. When Jai is finally released, nearly everybody will forget about Odin or C3 (even tsoding suggested dropping it for a public release of Jai), and very few people even know about them as it is. Just about whatever Odin (or C3) wanted or aims to do, Jai does.

[1]: https://jamesoswald.dev/posts/jai-1/ (Simplicity, Jai, and Joy)

13. baranul ◴[] No.41935907[source]
That has been around for a long time now. V lang[1], child of Go and Rust, has them. That, and things like enums, sum types, etc...

[1]: vlang.io