Choosing a Rust Web Framework

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 75

  • @jaysistar2711
    @jaysistar2711 Год назад +40

    If you go to other languages and frameworks, the Bevy ECS-like query that you're talking about is called "dependency injection" in this context. I like it as well.

    • @ValAllenSamonte
      @ValAllenSamonte Год назад +4

      yeah i was like "isn't just dependency injection?"

    • @josearmas1511
      @josearmas1511 Год назад +2

      I was looking for a nestJS-like framework in rust, thanks for the context

    • @usmanjamil3934
      @usmanjamil3934 Год назад +1

      @@josearmas1511 have you find similar to nestjs in rust ?

  • @realsong-fake
    @realsong-fake Год назад +35

    Most of the rust web frameworks are similar. They only have tiny difference on surface level api and under the hood they are mostly hyper/tokio.

    • @artemxyi
      @artemxyi Месяц назад

      Youre the first youtube user?

    • @growwithanshuman
      @growwithanshuman 13 дней назад

      @@artemxyi I think so haha

  • @altairbueno5637
    @altairbueno5637 Год назад +15

    Axum is hands down the best web framework for rust. Its also fast to compile and iterate

    • @romanstingler435
      @romanstingler435 Год назад +5

      Absolutely and David (developer) is a great guy

    • @LolLol-ig5tb
      @LolLol-ig5tb Год назад

      why I should use Axum instead Actix-Web?

    • @altairbueno5637
      @altairbueno5637 Год назад

      @@LolLol-ig5tb Compiles faster. No macro magic, just approachable (and clever) Rust code. Tokio ecosystem. 100% safe Rust. Great docs. Nice maintainers

    • @David-iq1kd
      @David-iq1kd Год назад

      Is it actor based like Actix?

    • @CalifornianViking
      @CalifornianViking Год назад +1

      What are the advantages over Rocket?

  • @michaeljamescollins6800
    @michaeljamescollins6800 Год назад +2

    thank you for your effort. love watching your vids and glad they will be recorded online for years to come

  • @AreQ212
    @AreQ212 Год назад +4

    I've had opportunity to work with axum as well as with poem, and from those two, I prefer second option. Axum forced me to use trait objects, which is not ideal, as not every struct can be used in that way. Also poem supports open api, so creating documentation is as easy as rust docs ;)

    • @chrisbiscardi
      @chrisbiscardi  Год назад

      it *is* nice that poem also chose to support Tower's Service trait

  • @SkegAudio
    @SkegAudio Год назад +1

    Chris, ngl, if you had a thick golden Cuban on you, the thumbnail would have you looking like a real G haha

  • @adamglass2599
    @adamglass2599 Год назад +1

    i think i preferred the previous style of presentation. These last two seem to be in a hurry to get to the conclusion with lots of fast edits at the start. re: title. Is this about choosing a rust web framework or your choice of web framework for this project? More the latter.

  • @morgomi
    @morgomi Год назад +3

    what a coincidence. Yesterday, I was going to start a project with my friend, and we were looking for a framework. We discussed a lot about Rocket, Actix, Gotham now we're going to discuss Axum then. 🤣

    • @altairbueno5637
      @altairbueno5637 Год назад +2

      Imho axum is the best. Fast compile times, plain simple architecture and tokio integration (tracing, bytes, metalio, tower, hyper,…)

    • @morgomi
      @morgomi Год назад +1

      ​@@altairbueno5637 I've just started from scratch using Axum. I hope their documentation is good.😄

    • @altairbueno5637
      @altairbueno5637 Год назад +1

      @@morgomi top tier docs.rs. Also, lots of examples. Error handling examples were co-authored by me, so check them out!

    • @dealloc
      @dealloc Год назад

      We went with warp (before Axum was born) and have been happy with it. However, what I like about axum is that it has much simpler types to work with. Both are very composable, unlike a lot of frameworks using proc macros.

    • @clivalycardoso8606
      @clivalycardoso8606 9 месяцев назад

      Sorryz but, Poem > Tide > all

  • @chris.dillon
    @chris.dillon Год назад +2

    I disagree with the YES on arewewebyet for the reason you stated in your opening. It doesn't have to be Rails but I think it essentially has to be Rails-like, which probably takes 10 years. If they ever crack this nut, this would be the first time in history a language would "work" from kernel to high-level domain. This would be exciting but I also wonder if it's possible. Go Buffalo is a good example. I like the creator, I appreciate the work but something just didn't pan out for me. I also have a similar take about microframeworks. But specifically about the language either technically enabling productivity or some kind of culture/sapir-whorf thing in the language community ... I'd really, really like to be eventually wrong on my take here like aged milk in the future. Low level language scaling where the machine is happy to high level complex projects where the human is happy. Two optimizations at once, pretty tough. 🤔

    • @chrisbiscardi
      @chrisbiscardi  Год назад +1

      I think overall the Yes on arewewebyet is that there are multiple frameworks that exist and work for production use cases, not that Rust "has a Rails". That said, it *is* only a matter of someone building it I think. I tend to prefer a more piecemeal approach, so looking at the features Buffalo touts I think the only one I don't have a Rust answer for off the top of my head is background jobs.
      I definitely agree that seeing a Rails-level framework for a language used in developing the Kernel would be a huge accomplishment... and a lot of work

  • @Kragal0n
    @Kragal0n Год назад +1

    Railway is my fav host, super simple to setup.

  • @irlshrek
    @irlshrek Год назад +2

    id love a video on tower!

  • @coindotlol
    @coindotlol Год назад +1

    Love the videos and the channel chris! Are you planning to create a discord server in the near future?

    • @chrisbiscardi
      @chrisbiscardi  Год назад

      yup! I have a discord server for Rust Adventure that I'm currently reworking for this purpose. I'll post about it when its open to the public.

    • @chrisbiscardi
      @chrisbiscardi  Год назад

      Discord server invite link is in the description for tomorrow's video

  • @akillersquirrel5880
    @akillersquirrel5880 Год назад +1

    There's always Rust on Nails, if you want rails-like

  • @darknetworld
    @darknetworld Год назад +1

    Really I was looking using bevy and web interface. One reason is wanted to try it out as well remind of me of the old game using like ragnarok online and unreal tournament from rpg invasion mod game. It was fun days.

  • @parsaaminpour5956
    @parsaaminpour5956 Месяц назад

    which one is the better option for a gaming platform's backend, Actix or Axum?

    • @chrisbiscardi
      @chrisbiscardi  Месяц назад

      both can work. my personal choice is Axum still, and Axum tends to be what I see new projects choose.

  • @johnw.8782
    @johnw.8782 Год назад

    Good video. I prefer Axum as well (compared to Rocket and Actix). It just makes more sense to me.

  • @NetherFX
    @NetherFX Год назад +10

    Dependency Injection in Rust would be a dream. Imagine a project like Symfony, but completely in Rust :^)

    • @RogerValor
      @RogerValor Год назад +3

      Dependency Injection is already possible in rust, as it is a general programming design pattern, just use e.g. boxed dyn trait as a passable argument in a constructor. I think what all you mean here is some sort of automatic dependency injection management.

  • @jeanchindeko5477
    @jeanchindeko5477 Год назад +2

    4:56 @chris Biscardi what is the CLI tool you’re using here?

  • @artemivasyuk1699
    @artemivasyuk1699 Год назад +1

    Hey Chris! What were you using to generated unique ids? Doesn't look like uuid.

    • @chrisbiscardi
      @chrisbiscardi  Год назад

      In this project it was ksuid, so I continued using that. ulid would be another similar choice.

  • @TwKgg
    @TwKgg 3 месяца назад +1

    How about Actix Web?

    • @chrisbiscardi
      @chrisbiscardi  3 месяца назад

      its fine if it fits your wants/needs. I generally prefer and see more companies choosing Axum at the moment.

  • @jzmmm
    @jzmmm Год назад

    nightowl.. nice. best theme

  • @Codeaholic1
    @Codeaholic1 Год назад +2

    I generally enjoy your videos, but the single word on screen captions were very distracting.

  • @verified_tinker1818
    @verified_tinker1818 Год назад +1

    What's the sense in using Tower's load-balancing, rate-limiting, etc. when it's included in reverse proxies and load balancers? Does it reduce complexity? Genuine question.

    • @johnw.8782
      @johnw.8782 Год назад

      Tower allows you to build networks applications. What so you think Reverse proxies and Load Balancers are? They're network applications. So you could use a framework like Tower to build those types of applications.

    • @khuiification
      @khuiification Год назад +2

      @@johnw.8782 im pretty sure he meant in the context of a web framework, valid question

    • @johnw.8782
      @johnw.8782 Год назад

      @@khuiification I didn't say it wasn't a valid question? I gave the usage of Tower.
      In the context of a web framework, the answer is still the same. Not all services sit behind http load balancers or proxies. Not all services are infinitely scalable in the cloud. Some are snowflakes. Those services can still fail. So you would want to be able to write backoff and load balancing functionality using Tower.
      Proxies and Load Balancers are no different than any other service that can be written with a web framework. they just handle traffic in specific ways.

    • @khuiification
      @khuiification Год назад +2

      @@johnw.8782 well, your answer isnt relevant to the context. Also, maybe its just me but asking ”what do you think xxx and yyy are?”, insinuating that OP is in some way in the wrong for asking, is a bad way to put.
      It is also not the same at all in the context of axum. Existing libraries, middleware etc. is a major part of why this is bonus and why i believe it is mentioned. Really nothing in particular to do with load balancers and proxies.

    • @johnw.8782
      @johnw.8782 Год назад

      @@khuiification Well then I'm sorry that your feelings were hurt when I was answering someone else's question, but it seems you have a very narrow understanding of web programming.
      If a service receives an http request and has either 1) and internal error or 2) a downstream error, the service can either decide to continue to serve requests or not. That is what rate limiting is. That is application that be built with axum using tower middleware.
      If a service receives an http request and has to rout that request amongst a defined set of downstreams, the service can decide which downstream to route to. That is load balancing. That is application that be built with axum using tower middleware.
      Both of these can be done in a reverse proxy fashion.
      I'm not sure why you don't think that this matters in the context when the OP asked what is the use of Tower's middlewares in comparison to external load balancers and proxies?

  • @johnwilliams7999
    @johnwilliams7999 Год назад +1

    I enjoy warp for apis

  • @charlesbcraig
    @charlesbcraig Год назад +1

    I’d be curious to know about rust hosting options.
    Also, do you still put nginx in front of it and pass the request on to rust like you do with PHP?

    • @chrisbiscardi
      @chrisbiscardi  Год назад +2

      I typically don't use something like nginx because I tend to prefer either serverless deployments or the newer generation of heroku-style container-based platforms (fly, render, etc).

    • @charlesbcraig
      @charlesbcraig Год назад +2

      @@chrisbiscardi maybe this is in the works already since this video series is about web apps, but a video from basic web app with db to deployment would be cool.

    • @chrisbiscardi
      @chrisbiscardi  Год назад +1

      @@charlesbcraig totally. When you say "basic web app" what kind of features does that have? The architecture for this series is roughly: one API + one UI server (axum/planetscale + axum/leptos), although we haven't made it to the UI yet

    • @charlesbcraig
      @charlesbcraig Год назад +1

      @@chrisbiscardi oh I’m thinking something simple (maybe fancier than a todo list, but nothing wrong with them either) so your architecture for the series sounds perfect!

  • @andres-hurtado-lopez
    @andres-hurtado-lopez Год назад

    Have you considered warp ? Instead of evaluating extractors at runtime it es evaluated at compile time.

  • @0xccd
    @0xccd Год назад

    How do you get that "from json | get data" in the cli?

    • @chrisbiscardi
      @chrisbiscardi  Год назад +2

      I use nushell: www.nushell.sh/

    • @0xccd
      @0xccd Год назад

      @@chrisbiscardi That was fast (I was still reading the comments), thanks bro!

    • @chrisbiscardi
      @chrisbiscardi  Год назад +2

      @@0xccd haha I just happened to be looking at the dashboard when you commented. It was like "37 seconds ago..."

  • @Kragal0n
    @Kragal0n Год назад

    What about Dioxus?

    • @chrisbiscardi
      @chrisbiscardi  Год назад

      Dioxus is a GUI layer so wouldn't work for the intended purpose here (which is a JSON API). A dioxus app could consume this API though

  • @daniel13021
    @daniel13021 Год назад

    Actix will ever be in my mind as unstable repo :(