14 comments

  • muglug 1 hour ago
    > Rust is the best general-purpose language for the new world of AI-driven development.

    Funny, the Python guys say Python is the best general-purpose language for AI and the Go guys say Go is the best general-purpose language for AI etc etc

    • Tuna-Fish 52 minutes ago
      I've found that the guardrails of a strong, expressive type system are amazing for LLMs, especially if you don't use the top-of-the-line models but stick to the cheaper options. Agents need feedback to do their magic, and the type system is great for that.

      But on the other hand, the compile time of Rust is really counterproductive. On large, established projects, most prompts I write now spend more time compiling on my machine than they spend outputting tokens. In a way this is great because the tokens are the expensive part, but it does mean that when faster LLMs will come, they will not meaningfully improve iteration speed for me.

      I wonder how much of the compile time of Rust is inherent to the type system. There might be room for a language with slower runtime speed (GC?), but as good of a type system as Rust, so long as compile times are much faster. Switching languages has never been easier, anyone have any suggestions? IMO hard requirements are algebraic types and error handling based on them.

      • tmpz22 40 minutes ago
        Can your team read and audit Rust code as fluently as Go or Python?

        I realized all the Rust code produced meant squat if it couldnt be audited well afterwards.

        • Tuna-Fish 30 minutes ago
          Auditing Rust is much easier and faster than either Go or Python. They both contain a lot of footguns that are not always immediately apparent from visible code. Rust is much more explicit.
          • lucideer 20 minutes ago
            This is assuming equal familiarity with all languages but I presume this comment is more referring to talent pools & experience. A good engineer can traverse & review many languages but most are quite restricted in the scope of what they can easily read - they miss a footgun or two in python but they're not grokking any of the rust whatsoever.
    • binarin 31 minutes ago
      It's the Python guys whom I totally don't understand - it's all fun and dandy until you try to maintain and cleanup a legacy codebase of tens of millions lines of code in any dynamic language :)

      With or without AI - doesn't matter. Only at that point you gain understanding of the limitations both of LLMs and of dynamic languages.

      edit: Forgot about "Nightmare" difficulty - try enjoying dynamic languages and LLMs when your legacy codebase is earning tens of thousands $ per second.

    • lucideer 23 minutes ago
      I don't write Rust & have no horse in this race but my intuition on this is you have 3 scenarios:

      1. Humans writing code: here the usability, readability, accessibility of the language matters - strictness can be a hurdle depending on how a language is designed, so ultimately it's a trade-off.

      2. Humans reviewing AI-authored code: here the requirements of (1) still apply to the code reviewer

      3. Autonomous agents writing code: above requirements no longer apply so having a strictly-defined language with tight guardrails is the primary consideration.

      I think most people are operating workflows in category (2), but it seems uncontroversial to say Rust is more suited to category (3) than python or golang. Typescript, Haskell, Elm, Ocaml could be considerations but you'll find Rust hard to beat here. Certainly neither python nor golang are in the running at all.

    • throwawayqqq11 36 minutes ago
      None of the other languages are as strict as rust is. With eager clippy and cargo lints and software design as close to the type system as possible, LLMs have tight guard rails to land on point.
    • geodel 1 hour ago
      Well, Rust is great for Fearless AI-driven development.
      • polotics 37 minutes ago
        Do you have any substantial sound metrics and study? I can think of many ways for a Rust program to not remove all fears that it will not do what I intended, doubly so for a vibe-coded Rust program.
    • cbsmith 1 hour ago
      Yeah, but only the Rust guys are right. ;-)
    • carllerche 46 minutes ago
      Exactly my point. Everyone says agents are “best” at their language. Which probably translates to agents generate equally well for all programming languages. So, why would you not pick the programming language that gets you the best (fastest, least memory) end product?
    • tamimio 5 minutes ago
      Never met a person who said python is the best except the python-cult. Legacy language that should be gone, it’s a scripting language that got known by data scientists as a replacement of R because they are not developers, they wanted something hacky and dirty to do things quickly, it was never meant for serious programming, something you can see in the dependency hell, indentation, syntax, performance, etc, and then you see people are trying to use it in UI or even robotics, what are you doing?! Maybe before llm it was an easy hacky way, now it should die for good.
  • lackoftactics 1 hour ago
    I really like the direction Topcoat is going in as a Rails developer. Although it is just a bit itchy to my eyes, it is not acid-level, though.

    The things that look great are LiveView and getting rid of boilerplate for client-side reactivity

  • the_sleaze_ 11 minutes ago
    Is there a batteries included Rails for Rust that people go to other than this Topcoat? What is the standard when building a web-app in rust?
    • steveklabnik 8 minutes ago
      The standard is more like Sinatra than Rails.

      Topcoat is very cool though, and there’s a few others in this space too, like Loco. So maybe we’ll see folks move to something more batteries included.

  • jazzypants 2 hours ago
    Some absolutely great work, but I don't know why you would come up with a new term for a server component (shard). Why not just use the obvious client/server annotations so you don't have to define a novel term for new users?
  • Kuyawa 19 minutes ago
    In times of AI the language doesn't matter, not even if the dev can read it or not, what matters is the result, speed, optimization, interoperability, UI/UX adaptability to user expectations

    I've built apps recently in swift, rust, zig, node with HTML UI (not electron) for MacOS and I care less about the code as the AI agent does a perfect job in all of them, even if I don't see much difference in the results (except HTML which is pretty but weird)

    Asked the same question to AI and she told me Swift is the best choice for MacOS apps just because it doesn't need C bridges between their kits/libraries and that in itself is an optimization gain

    Of course Swift in Linux is not the best option, probably the last, in Microsoft probably .NET I don't know, haven't used MS products in twenty years

    The point is, language selection is best decided on platform optimization, not on personal preference. I guess AI killed language wars?

  • mbStavola 52 minutes ago
    Hopefully there is still space for Axum to exist too! I like this directionally, but I've really enjoyed my time with Axum.
    • carllerche 44 minutes ago
      Of course there is. I consider there to be very little overlap. Axum is the router. You can do anything with it. API, web, whatever. Topcoat is a heavy layer on top focused on views.
  • sc68cal 1 hour ago
    It's interesting to see that they let you mix markup with logic directly in rust, but I have worries about maintainability. I remember the bad old days of PHP where you'd mix markup with logic directly, even when doing OOP with classes and it really made things more difficult long term.
    • josephg 1 hour ago
      It’s not a rust thing. Custom markup is usually implemented in rust frameworks using macros. If mixing macros and logic becomes a problem, we can change how the macros are implemented.
      • sc68cal 1 hour ago
        Yes, I saw that's it's via macros, but my point is that it reminded me of some web development practices from a much earlier era, and why we moved towards doing templates and separating app logic from presentation
        • carllerche 1 hour ago
          The trend has been to move back to this style in general (see most modern JS frameworks). The main point is less about combining code and view, but breaking up the page into many small components and pushing data loading down into where it is needed vs up front.

          Doing that enables a bunch of performance tricks like starting to steam the page before data i loaded and concurrently render components.

          If you have to split your page into many small components, a separate view file for each becomes tedious.

  • aslkalska 51 minutes ago
    Honestly Rust is an ugly looking language, I mean it's probably okay if you're coming from C or C++ but if you're coming from say Java, it's horrendous. but then again that probably does not matter at all.
    • throwawayqqq11 27 minutes ago
      Just like any other language, you can get used to it. There are ways to hide the uglyness and i am not sure if this is a good thing. (i will always hate macros!)
  • Thaxll 37 minutes ago
    `<button @click=$(|_e| count.increment())>"increment"</button>`

    What the heck is this.

    • maplant 31 minutes ago
      This is pretty easy to understand if you have a cursory understanding of Rust and HTML.

      I won't get into the HTML part (I think it's obvious), but the

        $(|_e| count.increment())
      
      part is a rust closure. |_e| is the argument to the closure, which has a leading underscore because it's unused. I imagine it's some context about the event (thus the e). The rest is the body of the closure. It increments the count.

      pretty simply

    • xyst 33 minutes ago
      it’s like react.js in the early days but worse somehow
  • m00dy 19 minutes ago
    > Rust is the best general-purpose language for the new world of AI-driven development.

    Hell yeah, been saying this more than 2 years already

  • victorbjorklund 3 hours ago
    Sounds a lot like Liveview in Phoenix.
    • carllerche 1 hour ago
      Phoenix, HTMX, Data Star are all big sources of inspiration. Both HTMX and Data Star have built in support too.
  • jdw64 3 hours ago
    Has anyone here tried it?
    • bickfordb 2 hours ago
      I haven't tried to the web app part but I've tried Toasty. The API seemed to be a little simpler and nicer to use than SeaORM for me. Here are a few things I liked in Toasty:

      - In SQLite UUIDs are default stored as compact blobs instead of inefficient varchar/text (SeaORM)

      - Timestamps were easier via jiff instead of chrono (SeaORM)

      - Model structs use the actual name of the $table instead of being named like $tablemodule.(Model|ActiveModel) (SeaORM) they are just $Table. This makes writing libraries a little simpler that need to use entity struct's from two separate modules/crates otherwise you get a name collision on Model/ActiveModel and need to do alias imports.

      - There's an API to fetch related data to a query similar to Django ORM. IIRC this is missing from SeaORM

      - The query expression language doesn't cover as much of SQL as SeaORM but seems to be enough for most web apps.

      - I didn't like how the migration system works. I would skip that part of the library

      • carllerche 1 hour ago
        Do you have feedback on what you don’t like re: the migration system? It is inspired by drizzle. Is it something we missed or just not a fan of that style entirely?
    • haellsigh 3 hours ago
      I have tried it. It feels pretty good to use, but you have to keep in mind that it's very early software. They currently break the API every other week, and it's still missing a lot of fundamental features. I have made a few basic web apps with it, and on v0.8.1 it was still missing a lot of reactivity which meant you had to use Javascript to bridge the gap.
      • jdw64 2 hours ago
        I used it in the early days, and it seems it's still the same. Thank you.
    • moffers 2 hours ago
      We’re using it to build our web app (https://uncook.xyz) and while it’s a slight departure from my team’s NodeJS background it’s been pretty cool to work with
      • jdw64 2 hours ago
        cute app
  • cube00 3 hours ago
    > Look, I don’t know where we are going.

    As honest as it is I can't risk using this anywhere near production if this is the attitude.

    • eminence32 3 hours ago
      Luckily there's a lot of people who write prototype code, toy projects, and other "non-production" code that can experiment with a new project like this
    • carllerche 1 hour ago
      That is in reference to the entire software industry. I’m not confident that we’re we’ll be building apps at all in 10 years vs just AI integrations
    • csoups14 2 hours ago
      I'd rather honestly than false confidence, there's something admirable about being this clear for sure
    • cpursley 2 hours ago
      Go use Java then.
  • lolakutty 2 hours ago
    Why bother with rust when you can write it in C and ask an LLM to weed out the memory bugs?
    • cultofmetatron 2 hours ago
      > write it in C and ask an LLM to weed out the memory bugs?

      because a non-determinist chain of reasoning is not the same as a fully deterministic algorithm. Its the best tool when a deterministic system is not feasable.

      • lolakutty 1 hour ago
        >because a non-determinist chain of reasoning is not the same as a fully deterministic algorithm.

        It is not. But rust's borrow checker has its costs. It forces awkward implementations. Either suffer the horrible life time syntax, or pay the price of clone everywhere.

        If you use C and run LLMs over it once in a while, I think it will get you most of the way.

    • huijzer 2 hours ago
      If you go that way, why not write LLVM Intermediate Representation? And if you know your server CPU anyway, why not write machine code?

      I personally like Rust for web applications a lot because you can catch many bugs at compile time instead of during tests or runtime.

      • lolakutty 2 hours ago
        >If you go that way, why not write LLVM Intermediate Representation? And if you know your server arch anyway, why not write machine code?

        Nah, C is good enough for me.

        > catch many bugs at compile time...

        Rust borrow checker is too dumb that you catch many non-bugs as well...I don't like that.

        Mmm..LLMs also generates false positives. But at least you can reason with it...

      • officialchicken 2 hours ago
        Reuse is bad / NIHS is good and it's hard to reach token metrics using accepted engineering practices. That leads to the point of having the LLM invent a new specialized job security chip architecture for your IR just to run CRUD app.
      • hmokiguess 2 hours ago
        Soon we're gonna need a way to catch bugs at prompt time
    • benjiro29 2 hours ago
      Why bother with rust when you can write it in C and ask an LLM to weed out the memory bugs?

      Here is a idea, why not combine both? Have the advantage of Rust its build in checks and LLMs independent checks. Now you get both for a even more safe program.

      • lolakutty 1 hour ago
        That is the worst of both worlds. You are paying for rust borrow checked forcing awkward designs, and you are paying for tokens.
    • Georgelemental 2 hours ago
      Why bother with asking an LLM to weed out the memory bugs when you can write it in Rust?
      • lolakutty 2 hours ago
        > when you can write it in Rust..

        Because fuck borrow checker..(and the horrible syntax)

        • felipellrocha 2 hours ago
          I don't get the complaints about the horrible syntax. The syntax is fine... Which is weird cause I only get complains from c/c++ folk, and that set of languages have objectively AWFUL syntax
          • lolakutty 1 hour ago
            Rust's syntax is horrible not because of the braces. But due to the type system information the code has to carry. And the type system, unlike something like Haskell, is not always smart enough to infer the types from the context. Which cause even more noise in the form of type hints!

            Add to that the horror of life time annotations, you really have a mess at your hands. I have seen projects litter clone everywhere just to sidestep this mess.

          • simpsond 1 hour ago
            It’s subjective. Some folks think lisps are it, others basic. Folks need to accept that we do not need global alignment on what good syntax means.
        • BadBadJellyBean 2 hours ago
          As if C was any better than rust. So much clutter. So hard to grok with all the macros. I'd rather read rust than C.
        • _flux 2 hours ago
          So actually the answer to your question is that Rust provides excellent guardrails against memory safety issues, and in some cases, for code correctness as well, by allowing more behavior to be encoded in types. One of those guardrails is borrow checker.

          Thus, the agent needs to iterate less.

          • lolakutty 1 hour ago
            >Thus, the agent needs to iterate less.

            I mean, I didn't meant to run the LLM every compile cycle. May be just before a release or something..

    • Ar-Curunir 2 hours ago
      Why bother with C when you can get an LLM to write it in Rust and not waste tokens on finding memory bugs