Topcoat: The full full-stack framework for Rust

(github.com)

33 points | by wertyk 4 hours ago

11 comments

  • carllerche 2 hours ago
    I didn't expect to see this here yet. We opened up the repo because we ran out of private CI usage. A blog post is coming next week :). Happy to answer questions here though.

    One thing to keep in mind, the main reason for Topcoat to exist is that many organizations are already using Rust for infrastructure-level or performance sensitive reasons and often just want to build a web app using the programming language they already use.

  • jjice 1 hour ago
    Oh man I'd love a nice full stack framework in Rust! Django, Laravel, and Rails are very neat. I used to be a micro framework kind of guy, but having everything integrated is more and more appealing over the last few years.

    This would take a long time to get feature complete with the core of those big full stack frameworks, but I'm rooting for it! Getting to use the Rust type system with a full stack web framework sounds incredible.

  • hobofan 1 hour ago
    Hmm... I'm a big fan of a lot of the things that the tokio project has built and a happy user of axum.

    I'm not sure that projects like Topcoat and something like their ORM is a great direction for the project, and worry that they will possibly gain outsized adoption in the community based on name recognition rather than merit.

    • carllerche 1 hour ago
      I think it is highly likely topcoat / toasty will get split out. It is just work, especially since tokio-rs has more CI usage available than the default GitHub org.
  • BobbyTables2 1 hour ago
    Does “full-stack” really mean “webserver + webpage” nowadays?
  • frio 1 hour ago
    Exciting, but I’d give a lot for an equivalent to Django. There are very few problems I need to solve that are fixed by htmx style “full stack” apps, but many that are solved by the generated admin, authentication framework, caching, eventing etc.

    Unfortunately, you end up bound to Python’s poor performance and poor typing stories, which Rust solves in spades.

  • seanclayton 1 hour ago
    Back in my day 'batteries-included' at least included schemas/models and a database abstraction. Claude can whip one up quick!
    • carllerche 42 minutes ago
      It's built: github.com/tokio-rs/toasty/, just not tightly integrated yet. That is on the roadmap.
  • jdw64 28 minutes ago
    I'm looking at it with anticipation, but I want to hold back because I don't want to offend you... I think this works as a wrong pattern in Rust.

    When I see syntax like $(...), it looks like a transpiler that embeds Rust AST inside JS. I think it would make Rust's already terrible developer experience even worse. I think the actual value of the string length on the server side will differ, specifically `len()`.

    And I'm not sure if bundling binaries and assets this way is the right approach. This feels less like Rust and more like a DSL that intersects Rust and JS. it feels like something different.

    I like Tokio and think it's really well made, but this framework seems a bit wrong to me.

    • carllerche 17 minutes ago
      I don't take offense from differences in design opinion. The goal of topcoat is to be opinionated and not make everyone happy. And JS libs are a heavy inspiration. They do a lot right and have years of experience in the browser-app space. If you don't like it, Axum aims to be the lower-level HTTP router that anyone can build their own abstractions on top of.

      That said, if you are up to it, I would ask that you try using it and provide your thoughts after using it as an issue. Feedback is appreciated.

      • jdw64 10 minutes ago
        Thank you. I hope I didn't offend you. First, I think the len() part is problematic. Could you check that for me? I think it's calling Rust's str::len() and using JS's String.length, which I think should be aligned with UTF-8.

        I'll try it out next time and give feedback later. And you're right, it's just a difference of opinion.

        Also, for the API side, Unicode strings are usually 4 kinds right? I think using Rust-style snake_case, we might need separate functions like len(), utf16_len(), and so on. But I'm not sure how to handle the abstraction between libraries and browsers.

        Sorry for being critical. I'm not that good of a programmer, so it might be a mistaken observation. Please check it.

  • canadiantim 1 hour ago
    Looks incredible, also loving toasty. Great work all around
  • 27183 1 hour ago
    Is the name a POR-15 product reference? Incredible if so :D

      \m/_(>.<)_\m/
  • newaccountman2 3 hours ago
    I don't feel like this is solving the painpoints I feel in the Rust web framework ecosystem. And how is it full-stack if they don't have anything for the DB layer in here?
    • carllerche 2 hours ago
      This will (very soon) integrate tighter with the Toasty ORM http://github.com/tokio-rs/toasty/. E.g. tight form -> record flow. We are shipping now though to get usage.

      What pain points do you have in the Rust web framework ecosystem? Happy to hear.

    • the__alchemist 1 hour ago
      Likewise. I'm commenting based on my position:

        - Rust Fanboy; use it in several domains (embedded, PC applications, bio/chem)
        - Web dev is the main thing I still use Python for, as there's nothing on Django's level.
      
      Of interest: I am not a fan of Async in rust. I get that for web stuff it is a suitable model, but I still don't like it for no original reasons. As you stated, I don't feel like this is solving the missing aspects, e.g. auto migrations, admin, email, auth, etc.
  • goldturd 1 hour ago
    Reminds me of if ruby had a baby with diarrhea.

    Rust in general