Earlier quoted context omitted.
Because the world is really ready for something to displace C and bring low-level programming to the 21-st century.
Go
Is Rust Web Yet?
81–90 of 183 posts
Re: Is Rust Web Yet?
#82Re: Is Rust Web Yet?
#83> "Yes! And it's freaking fast!" They're surely not talking about compilation times. Admittedly it's been a few years since I tried to build a web stack in Rust, but I felt like I was back in the 1990s dealing with the long compile times on modern hardware. Diesel was such a nightmare to use. It was poorly documented, and took a long time to compile even trivial example projects.
Correct.
Re: Is Rust Web Yet?
#84Earlier quoted context omitted.
One charitable way to view Rust's philosophy is that it's better to catch bugs at the compile stage than at the execution stage. In theory yes. In practice, getting to the execution stage was such a slog that it rarely happened. Would have liked it a lot better if the borrow checker had the option to be -Wall instead of -Werror.
Out of curiosity, what are your preferred language(s) to write in, and what sort of software were you trying to write? > Would have liked it a lot better if the borrow checker had the option to be -Wall instead of -Werror. Wouldn’t this defeat the purpose of the borrow checker and remove the guarantees the language gives you?
The software is a layer over an in-process key value store written in C (LMDB).
Re: Is Rust Web Yet?
#85I've spent the last few months porting the guts of a 100 KLOC PHP command-line utility I wrote to Rust. Thanks to the wonderful Rust documentation it's been a mostly painless endeavour. What I've gained as a result: - execution speed (about 3x faster, single-threaded) - better-documented data structures Things I've lost: - ease of iteration - concise, readable code - really smart type inference - a bunch of time thin…
My company has its code basically split in half between Python and Rust. Our Python code uses mypy pretty aggressively. The iteration speed difference is... drastic. Rust far outshines Python in terms of our ability to get something done, maintain it, and iterate on it over time.
Re: Is Rust Web Yet?
#86> Yes! And it's freaking fast! Going by these benchmarks (click around to find your own use case) Rust is definitely fast, but not (much) faster than many other languages, including Javascript. https://www.techempower.com/benchmarks/#section=data-r20&hw=... When it comes to JSON serializers, there is a Java framework that is faster than Rust, which is interesting to say the least. When you start comparing actual full…
Not that I think those metrics are all that relevant, but can someone explain to me how just-js ranks so highly? Very much defying my expectations in comparison with some of the top representatives of compiled languages.
Re: Is Rust Web Yet?
#87Earlier quoted context omitted.
Imagine your job is hammering nails. Eight hours a day for twenty years. You’ve hammered 403,286 nails. And then someone shows up and hands you a nail gun. Rust makes me happy because we speak the same language. Stuff gets done and I go home at 4:30 and play with my kids instead of my compiler.
Someone hands you a waffle head hammer seems like a more apt comparison. If you can get the hang of it, it’s a safer hammer. You’re still going to be manually managing your memory allocations though. The nailgun people have garbage collection (and yes for the gc folks, I’m aware you can still write allocation free code, or at least take manual control of allocations in a garbage collected language and therefore opt o…
I don't manually manage my memory anymore in Rust than I do in garbage collected languages (say Python or Go). (I do have to think about object lifetimes and whats pointing where in all three mentioned languages).
As an aside, I really like not having to manually free locks, close files, release connections back to pools, etc. It's one resource management paradigm that applies to everything - not just memory.
Re: Is Rust Web Yet?
#88Earlier quoted context omitted.
My company has its code basically split in half between Python and Rust. Our Python code uses mypy pretty aggressively. The iteration speed difference is... drastic. Rust far outshines Python in terms of our ability to get something done, maintain it, and iterate on it over time.
That's great for you and your team, but looking at https://github.com/grapl-security/grapl it seems like your needs are pretty different from most web developers.
Re: Is Rust Web Yet?
#89I've spent the last few months porting the guts of a 100 KLOC PHP command-line utility I wrote to Rust. Thanks to the wonderful Rust documentation it's been a mostly painless endeavour. What I've gained as a result: - execution speed (about 3x faster, single-threaded) - better-documented data structures Things I've lost: - ease of iteration - concise, readable code - really smart type inference - a bunch of time thin…
My company has its code basically split in half between Python and Rust. Our Python code uses mypy pretty aggressively. The iteration speed difference is... drastic. Rust far outshines Python in terms of our ability to get something done, maintain it, and iterate on it over time.
Re: Is Rust Web Yet?
#90Earlier quoted context omitted.
I'd argue that Rust is less demanding intellectually than C as you don't have to constantly worry about UB. C is definitely easier to "get into", if by "getting into" you mean writing unmergeable contributions full of unidiomatic code and security vulnerabilities. C's age is not an issue in itself. The programming languages it replaced were ahead of C in many ways. It was a setback from a language design point of vie…
I thought Rust didn't have a spec so everything in Rust was essentially undefined behaviour. Has this changed or is the "defined" part still the compiler source code? In that case taking the source code of any C compiler as the _blessed_ one should get rid of any undefined behaviour problems as well.
Indeed the notion of what behaviour is considered undefined changes with compiler versions, and it is not fixed yet. E.g. mem::unused() for example is now basically always undefined and you are supposed to use MaybeUninit. But you get a warning if you try to use the old API.
This is for unsafe Rust however. With safe Rust, even though there is no spec, the guarantee is that, unless you hit one of the soundness holes in the language, or a piece of user code that uses unsafe internally, you are safe.