Rust on the web is starting to look quite good.
TRANSCRIPCIÓN COMPLETA
As someone who loves to develop
software, building web applications has
always been a bit of a mixed bag. On the
one hand, the web itself is probably the
best platform when it comes to
distribution. There's no easier way to
ship your applications in 2026. However,
when it comes to actually building for
the web, well, for myself, this isn't as
enjoyable as an experience, mostly
because of the main programming language
that's actually used, JavaScript, and
its derivatives such as TypeScript. Now,
to be fair, these languages aren't
exactly terrible. In fact, I'd argue
that they've helped to usher in an era
of fantastic developer experience.
Whether it's through frameworks such as
React, Vue, or SolidJS, or through
fantastic tooling such as VIT. However,
as somebody who learned code in C++ and
who very much likes working with more
systems level languages, then building
for the web and subsequently writing
JavaScript/TypeScript has always been
something I just haven't really enjoyed.
Fortunately, I'm not the only one, and
there's been a number of attempts to
abstract the need to build web
applications using either of these
languages. These include frameworks or
libraries such as HTMX, Alpine.js, Data
Star, and even Hyperscript. All of which
bring a unique perspective into building
web applications without the need to
write JavaScript or TypeScript. Whilst
each of these have their own strengths
and weaknesses and are definitely worth
learning in my opinion when it came to
my own experience of using these to
build more than a non-trivial project, I
still ended up needing to write
JavaScript, but in a less maintainable
way than had I done so using something
like React. Now, this could very much
have been a skill issue on my own
behalf. But ultimately, I decided that
these solutions just weren't for me.
Fortunately, there is another solution
out there that can allow one to build
modern web applications without the need
to write either JavaScript or TypeScript
or any of its other derivatives. That
solution is web assembly or WOM, which
allows you to write code in other
programming languages that can then be
compiled for use in the web. One such
language is Rust, which also happens to
be the language that I'm exclusively
using in 2026 for things such as my
agentic AI video editor, but also when
it comes to writing code for the web, of
which, in my opinion, Rust is actually
quite good. So, what makes this the
case? Well, beyond the fantastic
ergonomics of the language itself,
there's a good few reasons as to what
makes Rust on the web not only viable,
but also an enjoyable experience for
building web applications. For starters,
there's actually rather decent tooling,
allowing you to develop, iterate, and
deploy your applications in a way that
feels similar to using something like
Vit. Although, I will say it's nowhere
near as mature, but it's definitely
starting to get there. In addition to
tooling, the actual ecosystem behind
Rust on the web is looking pretty good
as well. Whether it's through native
crates, those that allow you to
interrupt with JavaScript, or even
desktop frameworks that allow you to
publish straight to web assembly. For
example, here I have a game of snake
that I wrote entirely using Rust using
the iced desktop framework that has been
published to the web. However, perhaps
the biggest reason as to why Rust on the
web is starting to look so good is
because there are now multiple viable
frameworks for building either front
end, backend, or even full stack web
applications. All of which provide a
developer experience that's reminiscent
of some of the more popular JavaScript
front-end frameworks. Therefore, to give
a highle look at what Rust on the web
looks like, let's begin by taking a look
at some of the popular web frameworks
for the language. Beginning with one
that I've been playing around with
recently called U, spelled YW. U is a
front-end framework for building
interactive single page web applications
that are client side rendered by
default. The framework itself is heavily
inspired by React, both when it comes to
developer experience, but also the
underlying architecture. This is because
under the hood, U uses a virtual DOM
when it comes to rendering and also
employs a component-based model both for
defining view logic and also when it
comes to managing state. To show what I
mean, here I have an example web
application that I've built with you
which defines a single label
representing a counter and a couple of
buttons to modify the value either by
incrementing or decrementing which as
you can see works. If we take a look at
the actual code, you can see it's very
similar to how one would create the same
application in React uh but just written
using Rust. To start here, we're
defining a function called app, which
we're specifying as a component by using
the following macro. Inside of this
component is both where our counter
state and view logic lives. We're
creating this state using the use state
hook, passing in a closure that returns
the value of zero. Then when it comes to
both our increment and decrement
actions, we're defining a closure for
each that modifies the counter state
internally. As for the components HTML
view, here we're using the HTML macro,
which allows us to define both our HTML
tags as well as any interpolation of the
counters value. Additionally, we're also
passing in the callbacks that we defined
for the onclick handlers. Very cool. As
for how to actually run this code, well,
this is where some really nice Rust
tooling comes into play. The first thing
we need to do is add the WAM 32 unknown
unknown target to Rust up which is
achieved using the following command.
Once the target is added, we're then
able to compile our Rust code to web
assembly. However, rather than doing
this using cargo build, let's instead
make use of another approach, one that
will allow us to serve our code locally.
This is through a tool called trunk
which is a bundler/build tool for womant
based applications of which u is
basically you can think of trunk as
playing a similar role to what vit does
when it comes to javascript and
typescript frameworks. To install trunk
you can do so using the following cargo
install command which just to be warned
does take quite a bit of time. In my
case on the new M5 Max MacBook Pro this
took about 2 and 1/2 minutes.
Fortunately, Trunk does provide binaries
that you can instead install using
either the cargo bin install command or
by using something like Nyx, which is
the approach I personally like to take
through the use of Nyx Darwin. Once
installed, in order to run this code,
you can then use the trunk serve
command, which will compile the
application into WOM and then serve an
index.html with the web assembly
injected in at localhost at80. If I head
on over to this address, you can see our
code is now running. Very cool. As well
as supporting application development
and serving our code, Trunk is also able
to build and bundle our application for
deployment, which is something we'll
take a look at shortly when we look at
how to deploy a Rust web application to
a server. Speaking of servers, as I
mentioned before, U by default is client
side rendered, which is defined by the
CSR feature inside of my cargo.l.
However, in addition to being client
side rendered, you also provide support
for serverside rendering, aka SSR, which
can be enabled using the following
feature. By doing so, it allows you to
create an application that supports SEO,
but still operates as if it was a single
page web application. This is again very
DESBLOQUEAR MÁS
Regístrate gratis para acceder a funciones premium
VISOR INTERACTIVO
Mira el video con subtítulos sincronizados, superposición ajustable y control total de la reproducción.
RESUMEN DE IA
Obtén un resumen instantáneo generado por IA del contenido del video, los puntos clave y las conclusiones.
TRADUCIR
Traduce la transcripción a más de 100 idiomas con un solo clic. Descarga en cualquier formato.
MAPA MENTAL
Visualiza la transcripción como un mapa mental interactivo. Comprende la estructura de un vistazo.
CHATEA CON LA TRANSCRIPCIÓN
Haz preguntas sobre el contenido del video. Obtén respuestas impulsadas por IA directamente desde la transcripción.
SACA MÁS PARTIDO A TUS TRANSCRIPCIONES
Regístrate gratis y desbloquea el visor interactivo, los resúmenes de IA, las traducciones, los mapas mentales y mucho más. No se requiere tarjeta de crédito.