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

These are the kinds of things that make me think, "Do you really need Javascript or C++ or Haskell anymore?" Can't we just use Rust from top to bottom for pretty much everything?!



I'm not convinced Rust would ever be the right "everything language".

Currently I find myself reaching for it for almost every domain, largely thanks to the ADT's and amazing tooling, but it's a bit low level and sometimes tedious for certain sets of applications where more approachable languages, like Python and JS currently are the standard bearers.

Personally I think we would get really far with Rust, and some yet-to-exist higher level language with a modern type system built on top of the Cargo ecosystem.

Then maybe C and/or something like Zig for niche applications where extreme memory efficiency is the main constraint.


You absolutely can. The biggest snag in "rust everything" is in web frontends. Yew is decent, but getting JavaScript developers is so much easier than getting Rust developers who like (web) frontend work.


It's also just a matter of the massive amount of prior art available on the JS side. There's so much you would have to create from scratch in Rust which is already an npm package.


We can! It’s a lot of work because you don’t have the whole JS ecosystem to fall back on, but to some that’s a feature not a bug.

My favorite example of this is https://makepad.dev


You can with basically any language. But it would likely be a bad idea. You will eventually have created such an abstraction that you’ve got a new language.

Django is written in C after all. ;)


GitHub says it's 97.1% python and doesn't list C.

https://github.com/django/django


My tongue in cheek joke is that CPython is C. And if you write long enough in Rust something that needs plenty of flexibility, you’ll end up inadvertently writing a language.


Oh, like Greenspun’s tenth rule:

> Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.


Hah I’ve never seen that one. Love it!


Have you tried writing a web backend in Rust?

See Primeagen, a Senior Eng at Netflix w/ Rust as his #1 lang, and his experience writing a quick web backend in Go, Rust, and TS:

https://youtu.be/Z0GX2mTUtfo?t=267


Until Rust shows me lightweight binary size story.


The language itself is lightweight enough to use on tiny microcontrollers. Most bloat on the host side comes down to your choice of dependencies (clap is one of the worst offenders in my experience, bloating a simple command line tool by as much as 10x in both size and compile time).


I wonder if there's an alternative to clap's derive stuff? I really love it (I think it came from structopt), it makes defining and handling the arguments nice and easy when things get a bit complex.


My go-to is argh[1], as it's more lightweight while still providing a nice derive-based API.

[1]: https://github.com/google/argh


I'll have to try it out. Thanks!


I mean, Unix/Linux was top to bottom C for a long time. It still kind of is. Higher level languages aren't needed per se, but they do make life easier.


If you think about it, the reason Rust, or any other programming language were created, was simply because other languages had something lacking...

There's no single language that's the greatest. Haskell has different aims than Rust. If you're using Haskell for frontend development, you probably need to reconsider your choices, I think


Rust and Haskell present a very different programming experience, and so does an untyped language like JavaScript. Just because you can program in Rust for web development doesn't mean developers will want that type of experience. The C++ comparison makes more sense since Rust presents that style of programming done better.


to be quite honest, this kind of evangelism is what drives me away from rust.




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

Search: