Live data from Hacker News

Is Rust Web Yet?

arewewebyet.org

171–180 of 183 posts

Re: Is Rust Web Yet?

#171
post #155

Earlier quoted context omitted.

I think that's obviously a matter of opinion. I don't think Rust is hard to read at all, nor do I think of it as being particularly sigil heavy, but that's me. I think the syntax is probably unfamiliar for some, and familiarity is almost always what people mean when they say "readability". Coming from c++, Rust was pretty familiar. PHP isn't that hard to read either.

No, what I mean is https://github.com/rust-lang/rust-wiki-backup/blob/master/Si... and that's just pointers, you have #[] #![] and then three ways to invoke a macro !() !{} ![] and of course a lot more. Maybe all this is necessary for a system level programming language, fine, but don't tell me this is easy to read.

> but don't tell me this is easy to read.

Most Rust programmers just never, ever have to deal with pointers like this. And most code in the wild looks nothing like this. Yes, it's there if you need it, but in practice you will never read anything like it.

Readability is the most suspect of all the anti-Rust arguments to me, because, as others have noted, it's almost always about familiarity. The most senior parent comment is someone explaining how their 100KLOC PHP command line program(!) was more concise and readable than Rust! PHP as the exemplar of readability. Think about that.

Look -- if I really loved PHP and was forced to write Rust, I might really hate it. But I think the world of people who really love PHP is pretty small compared to the world of people who have lived with PHP because that was what was familiar. Folks let's climb off the bus to crazy town.

Re: Is Rust Web Yet?

#172
post #150

Earlier quoted context omitted.

The time it takes to run `cargo check` is nothing compared to dealing with bugs, terrible tooling, weak errors, etc. All of those areas have been radically better with Rust. As an example, type errors in Rust are radically better than mypy, it's no competition. In general rust's type system is just way better, we have to use Any all over the place because mypy can't even handle a Json type (no recursive types at all)…

Check out pip install -c constraints.txt for the equivalent of lock files.

We use constraints.txt, which helps a lot. It's not quite a lockfile but it's something.

Re: Is Rust Web Yet?

#174
post #155

Earlier quoted context omitted.

No, what I mean is https://github.com/rust-lang/rust-wiki-backup/blob/master/Si... and that's just pointers, you have #[] #![] and then three ways to invoke a macro !() !{} ![] and of course a lot more. Maybe all this is necessary for a system level programming language, fine, but don't tell me this is easy to read.

I have no problem telling you that Rust is extremely easy to read.

Oh, and the @ ones don't even exist anymore, haven't for like a decade afaik

Re: Is Rust Web Yet?

#175
post #65

Earlier quoted context omitted.

> the borrow checker rejects valid programs Yup, this is the tradeoff you have to make to catch the wide variety of bugs. For personal use, probably not worthwhile, but it definitely pays off for the safety it provides in production contexts. The way I view Rust's philosophy is "it's better to catch bugs at the compile stage than at the execution stage".

That's been every language's philosophy for generations. (Obviously, some languages do a better job of it than others).

Not really? Python's dynamic typing and lack of variable declarations clearly shows it was designed for developer velocity, not catching bugs.

Seems like your argument is Python catches some bugs when converting to bytecode, so it cares about catching bugs early. That's not true -- for the most part, Python catches only the most trivial of typos before execution.

Re: Is Rust Web Yet?

#176
post #111

Earlier quoted context omitted.

> I spent about the past month learning rust This is a red flag for your complains: Is VERY likely you believe Rust is wrong, when the fact the problem is that your code is not good. I know this, my first 3 months starting Rust were thinking between "I'm a failure as developer" and "Rust is wrong" or "What? Why can't do this?". For first time after learning more than 12 languages I was truly in shock. And even, for s…

> This is a red flag for your complains: Is VERY likely you believe Rust is wrong, when the fact the problem is that your code is not good. I'm gonna be blunt: This is the worst thing to come out of the Rust community, bar none. Rust is a fine language and I love to write in it, but I loathe the way Rust developers have convinced themselves that Rust is an axiomatically 'better' language and that the things you can't…

Maybe you can rewrite his statement as "your code is not idiomatic to Rust"?

Re: Is Rust Web Yet?

#177
post #95

Earlier quoted context omitted.

If you look at the techempower submission source code you'll quickly see why: https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast... .

I so deeply wish for a set of benchmarks that accepted only idiomatic, standard code that a slightly above average developer would plausibly write. Pretty much every set of benchmarks out there is ruined by monstrous unrealistic code that squeezes out 5% more performance than actually well written code. As a side note, one flaw of TechEmpower benchmarks is that to my knowledge they use the original "wrk" tool, which…

Please explain how we are to practically identify "idiomatic, standard code that a slightly above average developer would plausibly write."

Or is it some Goldilocks not-unoptimised not-too-optimised I'll-know-it-when-I-see-it wishful-thinking thing?

Re: Is Rust Web Yet?

#178
post #97

Earlier quoted context omitted.

Those benchmarks are pretty heavily gamed. Think about things like hardcoding "Content-Length: 123" instead of computing the length at runtime.

I wish benchmark suites would reject those kinds of shenanigans, it's completely ridiculous and makes the results practically worthless.

Do you raise those issues as specific bug reports against specific programs?

Re: Is Rust Web Yet?

#179
post #131
post #118

Earlier quoted context omitted.

> The Rust version requires you to use your intuition to figure out that `unwrap()` will never panic here. You should not use `unwrap` in a production product. It's there for prototyping and I think it's a mistake they have it (though the language already requires a good upfront time investment as it is). Use `?` and have your error propagate accordingly to the top of the chain. Have your own error types and convert…

> don't "convert" PHP code into Rust. Re-design your program. Trust me, I am! For example, I'm rewriting all the (very-efficient) PHP regex code to a much more convoluted version because Regex::new is so costly. Less sarcastically, I am embracing the Rust Way where necessary. My complaint is that the Rust Way sometimes forces me to depart from the idealised pseudocode version of a given algorithm much more drasticall…

Wait... You're rewriting the PHP regex code instead of using the regex crate?! Just...wait...why?

Are you using lazy_static? See: https://docs.rs/regex/latest/regex/#example-avoid-compiling-...

Re: Is Rust Web Yet?

#180
post #111

Earlier quoted context omitted.

> I spent about the past month learning rust This is a red flag for your complains: Is VERY likely you believe Rust is wrong, when the fact the problem is that your code is not good. I know this, my first 3 months starting Rust were thinking between "I'm a failure as developer" and "Rust is wrong" or "What? Why can't do this?". For first time after learning more than 12 languages I was truly in shock. And even, for s…

shrugs Who knows, maybe rust clicking for me was just around the corner. I kept thinking "finally I'm understand this" and then something else would happen. I'll leave it to the incredibly patient programmers who can spend 3 months just learning it. I'll use all the time I save to write more tests, and probably end up with something much more correct.

> I'll leave it to the incredibly patient programmers who can spend 3 months just learning it.

I understand, I was close to drop it.

In retrospect, I create a lot of self-inflicting problems in my journey (like I learn Rust making a programming language and hit by coincidence some of the hard stuff with Rust!) and knowing what I know now, Is clear the time running in circles was in big part that.

But, of course, is hard to see you are running in circles when you are running in circles :(

Post reply on HN