Live data from Hacker News

Rust 1.24

blog.rust-lang.org

111–120 of 215 posts

Re: Rust 1.24

#111
post #73

Earlier quoted context omitted.

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

Is there a guide just for using the actix framework that explains what are actors, how they are different from other abstractions and the pros and cons?

Re: Rust 1.24

#112
post #105

Earlier quoted context omitted.

Oberon certainly compiles quickly, and I believe Delphi (Pascal-ish) was fast too, but I was thinking of Microsoft's Java compiler before they got spanked.

Java without generics used to compile pretty fast. When you add generics, lifetimes, and type inference, the amount of work the compiler does grows significantly. It allows to check much more interesting invariants, leading to the "if it compiles, it runs correctly" effect.

Below, steveklabnik claims these things are miniscule. Are you really sure you know what is actually slow?

Re: Rust 1.24

#113
post #101

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…

Yeah, I suspect it wouldn't actually be a win, though of course it will depend on the implementation. Just pointing out that "there's no memchr for consecutive sequence of characters" isn't exactly true.

I mean, you can count a simple string search loop as "memchr for consecutive sequences" as well, what I meant was a technique that uses the same bitmasking trick as memchr, applied to multiple bytes (perhaps via SIMD). It's doable.

Re: Rust 1.24

#114

Earlier quoted context omitted.

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.

[deleted]

Re: Rust 1.24

#115

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.

That would be an enormous problem for us. We need rustfmt to be configurable because it let's us use it to make MISRA-like style guidelines automatically enforceable for our codebase, which would be likely summarily rejected without them, so then we'd be forced to either do it manually or reinvent most of rustfmt ourselves.

Re: Rust 1.24

#116

Earlier quoted context omitted.

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

Is there a guide just for using the actix framework that explains what are actors, how they are different from other abstractions and the pros and cons?

There is no guide for actix but I am planing to add one

Re: Rust 1.24

#117

Earlier quoted context omitted.

Is there a guide just for using the actix framework that explains what are actors, how they are different from other abstractions and the pros and cons?

There is no guide for actix but I am planing to add one

Ah, I didn't check your username. So, its your project, awesome work and thanks for doing it. :D

Re: Rust 1.24

#118
post #105

Earlier quoted context omitted.

Java without generics used to compile pretty fast. When you add generics, lifetimes, and type inference, the amount of work the compiler does grows significantly. It allows to check much more interesting invariants, leading to the "if it compiles, it runs correctly" effect.

Below, steveklabnik claims these things are miniscule. Are you really sure you know what is actually slow?

In my experience (with Rust programs that take 20mins+) it is all about the monomorphisation of generics. The great majority of the time is spent in LLVM, because Rust hands over many GB of LLVM IR for optimization, having done not very much (edit: in the way of code transformation) other than direct instantiation of the generic parameters.

Rust does have the opportunity to do more, and I suspect they are hoping to do more with MIR, but at the moment they rely on LLVM to optimize out all of the zero-cost abstractions that they introduce.

Re: Rust 1.24

#119
post #34
post #15

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

When I use Python I miss Rust's enums, the pattern matching of those enums, and the static types that help refactoring (the compiler spots where one change has knock-on effects in the rest of the project..). Especially how Rust enums and structs make it easy to define new types to guide your programs are a highlight for me. I don't think Rust is better than Python for every task. Python is a lot simpler if you can ge…

Go is good middle ground between simplicity and being fast/dynamic.

Re: Rust 1.24

#120
post #80

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 don't agree. There is a default configuration, and that configuration is very good (I've been following the process of nailing it down, and IMO it's been done very tastefully), and is the formatting used by official Rust codebases, lending it the weight of authority. I have no reason to configure it to do anything differently. But I also have no reason to forbid anyone else from formatting code as they please. What…

"And guess what?" Richard angrily replies, "That's never going to happen now. Because there's no way I'm going to be with someone who uses spaces over tabs."

Man, there's something cathartic in seeing your industry and self-identified group's ridiculousness aired for all the world to see.

Post reply on HN