What we learned building a Rust runtime for TypeScript

(encore.dev)

52 pontos | por vinhnx 3 dias atrás

6 comentários

  • owenpalmer
    8 horas atrás
    I can't seem to tell exactly what they built. They call it a runtime, but they're using NodeJS?

    Did they implement a transpiler in Rust?

    They also seem to be calling Rust from JS, but not through wasm...

    They seem to be doing something with Rust and http, but they're also just using "Pingora"...

    Additionally, their homepage is about 20 fps while scrolling on my phone (pixel 4a, brave)

    I would honestly love for someone to explain to me wtf is going on.

    • wmf
      8 horas atrás
      Looks like a Node.js wrapper.
  • caditinpiscinam
    8 horas atrás
    UI note in case the creators of this site are reading: having a right-click on the site logo open a special logo-download menu is probably the wrong choice. If I right click on your site logo it's because I want to open your homepage in a new tab while keeping the original blog post open. The current behavior is unexpected and makes it hard to navigate the site.
    • airstrike
      8 horas atrás
      Ctrl+Click or Cmd+Click to open in a new tab?

      I for one loved the context menu on logos

  • waterTanuki
    4 horas atrás
    > First, we knew we wanted to extend Encore to more languages over time, and we'd seen projects like Prisma and Pydantic successfully use a Rust core with bindings into Node.js and Python respectively.

    On an unrelated note Prisma decided to rewrite their Rust core in Typescript. https://www.prisma.io/blog/from-rust-to-typescript-a-new-cha...

  • xbar
    8 horas atrás
    I like the seeing the avoidance of generics hell. Traitsmaxxing.
  • jauntywundrkind
    10 horas atrás
    Very side note, but really liking seeing Elysia so close to the top on the benchmark list.

    I've been using it, and pointing my LLM's to it as example code, because it's type system is so so much better than Hono's. https://elysiajs.com/

    I didn't know that it was also flipping fast as frell. (Encore's benchmark is showing them as faster still, of course!)

    • speak_on
      9 horas atrás
      Type system via a single schema looks similar to Hono+OpenApi+RPC, or is there a different advantage?
      • pier25
        7 horas atrás
        Maybe I'm wrong but it seems more like Hono+Zod
        • speak_on
          5 horas atrás
          The parts where responses have schema-consistent types (OpenApi) and the same types can be used on the client without extra work (RPC) are outside of Zod.
    • pier25
      9 horas atrás
      > because it's type system is so so much better than Hono's

      Can you elaborate?