Hacker News new | past | comments | ask | show | jobs | submit login

So, we have rspack, turbopack and now Farm, all written in Rust.

There is also Vite, of course , which is already quite fast and very popular.

What's the differentiator between those?




Don't forget Bun (*) ... [1]. Bun's bundler is appealing since Bun packages a bunch of other tools you already need (test runner, runtime, fast npm replacement).

Bun + Biome covers everything you need for a TS project (Biome lints and formats).

--

* : I guess it is not written in Rust but still in the same category of tools.

1: https://bun.sh/docs/bundler


there is a small difference: you also need to make your own hmr reloading script when using bun. But it does so much more than just frontend bundleing.

If you need an hmr script you can use the one I wrote for my webframework: https://github.com/spirobel/mininext

(my goal with mininext is to provide index.php like productivity but with all of npm and typescript at your fingertips)


I may be wrong here but I think https://modern-web.dev/docs/dev-server/overview/ could do server-with-HMR for a Bun .js tree? (unsure how you'd handle .ts there, sorry, still caffeinating)


the goal was to not have any dependencies.

mininext has a clean package.json

It is just 3 files of modest size that are understandable in an afternoon.

You can also copy and paste and vendor the hmr part.

Someone even forked mininext to create micronext.

My goal is to compete with php. So I added some quality of life features. But if people want to go turbo minimalistic I can respect that.

I just wouldn't add a dependency for hmr when it is so easy to do with a small snippet.


Sure. This was wrt "when using bun" - i.e. somebody else might prefer to just whack web-dev-server into place as a lightweight option for them.

mininext is a neat idea and I plan to read through the code (do you have a preferred 'small snippet' for hrm? I'd be interested to read that too) but I was talking more generally in my last comment.


Sorry for the silly question, I found the standardDevReloader stuff, hadn't realised it was built in. Not what I was hoping for since I want per-library reloading, but for the goals of mininext that's probably overkill anyway.


haha no worries :-D

I like to keep it simple. Right now bun just rebuilds everything and it is so fast that I don't recognize it.

If it ever becomes a problem I will optimize it.

The standardDevReloader is a snippet to tell the browser to refresh the page after a rebuild happened.

If you setup a fresh project with the barebones quickstart template with: bun create spirobel/aldi yournewproject

you will see a dev.ts in the project folder. compared to the start.ts (which is used to run the prod version) it will setup this snippet, so it is included in every html page that is served.


And Deno! Which also has compilation tools and is written partly in Rust.


True, although it seems they deprecated their bundle command and even recommend using esbuild or rollup [1] (or an "unstable" module deno_emit).

--

1: https://docs.deno.com/runtime/manual/tools/bundler


Yep that was a bummer for me, I was trying to start a little project where I wanted a bundler lib and started using Deno's... but quickly ran into some limitations and found out they've deprecated it and it's not even maintained anymore :( . I started using esbuild instead via its Typescript lib, but then noticed I was spending a lot of time working around the problems with the JS ecosystem (terrible file system watcher in node.js, lots of underpar libraries and as someone not intimate with every domain, it's nearly impossible to know which library may be well written and maintained without spending lots of time investigating, weird APIs, silent errors, I just can't believe some people can cope with all of this instead of just moving to a saner language).... and as esbuild is written in Go, I rewrote my code in Go and now it's much, much nicer to work on, much faster, can be shipped as a single binary etc.

If there was a bundler written in Rust I might have chosen that, as despite not having anything against Go, the momentum seems to be strongly shifting to Rust (and even in the little Go I did, I already feel the pain of its error handling), and Rust definitely gives you better tools to write reliably applications.


I’m a big fan of Bun, and having it just work.

There are still issues (like aborting a fetch, and TS5 style decorators).

But it’s fast and I have all tests run on every save, which are near instant.


Bun would be cool if it worked. At least it's not written in Rust so there's that.


Neither sentence of your post has any value to anybody, other than (possibly, dubiously) yourself. Next time, consider writing such comments in your personal journal, or perhaps just shouting them out loud when you're alone.


I’ve been using Bun for a year. It works.


I feel like it's a bit weird they didn't mention Rsbuild. Rsbuild is a "nice" wrapper around Rspack and SWC.

It's probably more holistic/batteries included than Farm, from a cursory glance. Rsbuild also aims to be a Vite alternative, but leans more into the webpack philosophy (and ecosystem) than Rollup's




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: