Live data from Hacker News

Rust 1.24

blog.rust-lang.org

81–90 of 215 posts

Re: Rust 1.24

#81
post #79

tokio-minihttp is 1 in plaintext benchmark in TechEmpower Web frameworks benchmark https://www.techempower.com/benchmarks/#section=data-r15&hw=...

I wouldn't post Rust benchmarks in here it's behind Java in every scenarios.

It's not in every scenario, notably, the plaintext one.

One reason why things are behind in some of the other scenarios is because our database driver stuff is synchronous at the moment, and that really hurts on these benchmarks. We'll get there!

Re: Rust 1.24

#82
post #53

Earlier quoted context omitted.

That doesn't solve the problem of searching for multibyte character AB and finding multibyte character CB instead :) Or, searching for multibyte character ABB (like U+A041 YI SYLLABLE PA) and finding the first "B" instead of the second "B". Sadly there's no memchr for consecutive sequences of characters. memchr2/memchr3 let you search for multiple needles in the haystack, not a bigger needle.

There’s memmem...

memmem is substring search. You could use it for char search, but does memmem know about UTF-8? If, say, memmem uses memchr internally in a skip loop and it happens to look at the first byte in the UTF-8 encoded codepoint, then it is going to perform a lot worse in most cases involving the search of text that is in a language other than English (because it will wind up searching for a very common byte).

Or maybe memmem does something else clever for shorter needles. Dunno. Best to benchmark it. But it's not an obvious win a priori.

Re: Rust 1.24

#83
post #15

Can someone sell me on using rust over python? I am just gernerally curious as to the advantage beyond rust being compiled.

Performance is quite a bit higher for rust. And it's a much safer language by design (and forces the programmer to be as such). That said, development time in Python is much faster. Honestly, it depends on what you're building.

Rust is not safer than Python in Rust's own terminology. It takes more work than in C, but you can write memory bugs in Rust, by design. Python will catch those damn near every time, and if it doesn't you file a bug. Sure, there's less serious classes of bugs that Rust is likely to catch, but that's not really safety except in a definition loosened to near uselessness.

Re: Rust 1.24

#84
post #53

Earlier quoted context omitted.

There’s memmem...

memmem is substring search. You could use it for char search, but does memmem know about UTF-8? If, say, memmem uses memchr internally in a skip loop and it happens to look at the first byte in the UTF-8 encoded codepoint, then it is going to perform a lot worse in most cases involving the search of text that is in a language other than English (because it will wind up searching for a very common byte). Or maybe memm…

I do want to see if a 2/3/4-byte memchr can be written that uses the same bitmasking as regular memchr but extended to more bits (perhaps via SIMD).

That would be pretty neat.

Re: Rust 1.24

#85
post #73

Earlier quoted context omitted.

hyper is 6 and actix is 7 https://github.com/actix/actix-web Rust is represented well!

I tried Actix a while back and it was very intimidating compared to some other frameworks. I'd like to jump back into it at some point, but right now for my prototype I got lazy and went with Rocket.rs. Any suggestions of Opensource projects that use Actix?

you should check it again :) actix-web now has user guide https://actix.github.io/actix-web/guide/

here is irc bot (wip) https://github.com/DoumanAsh/roseline.rs

Re: Rust 1.24

#86
post #79

tokio-minihttp is 1 in plaintext benchmark in TechEmpower Web frameworks benchmark https://www.techempower.com/benchmarks/#section=data-r15&hw=...

I wouldn't post Rust benchmarks in here it's behind Java in every scenarios.

stable rust is only two years old. we just need some more time

Re: Rust 1.24

#87

Good to see rustfmt arrive. Sad that it is configurable, though. The biggest benefit of its predecessors such as gofmt is that they are not configurable, leading to a much more uniform formatting style and avoiding endless discussions about whitespace layout.

The only reason I don't use gofmt is because it is unconfigurable. And some of its defaults really stink. Kudos to Rust for getting this right.

Re: Rust 1.24

#88
post #15

Can someone sell me on using rust over python? I am just gernerally curious as to the advantage beyond rust being compiled.

you can always try rust in parallel with python code with libraries like pyo3

Re: Rust 1.24

#89

Earlier quoted context omitted.

memmem is substring search. You could use it for char search, but does memmem know about UTF-8? If, say, memmem uses memchr internally in a skip loop and it happens to look at the first byte in the UTF-8 encoded codepoint, then it is going to perform a lot worse in most cases involving the search of text that is in a language other than English (because it will wind up searching for a very common byte). Or maybe memm…

I do want to see if a 2/3/4-byte memchr can be written that uses the same bitmasking as regular memchr but extended to more bits (perhaps via SIMD). That would be pretty neat.

Yeah that's what I was thinking memmem might do. But yeah, I bet you that Hyperscan has a vectorized algorithm for this somewhere. It is just a matter of finding it.

Re: Rust 1.24

#90

Good to see rustfmt arrive. Sad that it is configurable, though. The biggest benefit of its predecessors such as gofmt is that they are not configurable, leading to a much more uniform formatting style and avoiding endless discussions about whitespace layout.

I often have to zoom into code a lot more than others. This means that I will often want to format my code differently. I change the settings and I can use defaults before committing the code.

Programming causes me a lot of eye strain as it is, a configurable syntax formatter really does help.

I never see anyone discuss syntax the way you're describing. Not at work, not online. Actually the only place I see it is when discussing what the default is, so I think having a default is far more likely to cause those discussions as people will have more reason to complain.

Post reply on HN