Live data from Hacker News

A Fresh Look at Rust

lucumr.pocoo.org

21–30 of 157 posts

Re: A Fresh Look at Rust

#21
post #8

I rarely have to do anything as low-level as rust would demand. More often than not I find myself using Python, but I had the same feelings when I started looking into rust a few weeks ago. It was exciting seeing the full pattern-matching, especially. I have a desire to get some experience in the area, but the problem is what to make. Does anyone have any ideas for some smallish libraries that would benefit the commu…

you might also like ocaml as a higher-level language with a lot of the same features.

Re: A Fresh Look at Rust

#22
I've been very interested in Rust for a while, but put off by the early development status and the fact that it's undergone a few major redesigns. I don't hold them against the language team in any sense, and actually think more of them for it, since redesigns early are good if you realize something else might be better or one of your original ideas just didn't work out.

Rather, I'm just curious when I can expect Rust to settle down and not have frequent breaking changes, major redesigns of language features, etc. I've heard it's the aim of the 1.0 release to have this property (which is a reasonable goal in my mind).

Does anyone have a timeline on when it would be reasonable to start eyeing Rust if I want more stability (in terms of language features) than it's had during its development phase?

Re: A Fresh Look at Rust

#23

I've been very interested in Rust for a while, but put off by the early development status and the fact that it's undergone a few major redesigns. I don't hold them against the language team in any sense, and actually think more of them for it, since redesigns early are good if you realize something else might be better or one of your original ideas just didn't work out. Rather, I'm just curious when I can expect Rus…

You want to wait for 1.0. The plan is a release candidate around the end of the year.

Re: A Fresh Look at Rust

#24

I've been very interested in Rust for a while, but put off by the early development status and the fact that it's undergone a few major redesigns. I don't hold them against the language team in any sense, and actually think more of them for it, since redesigns early are good if you realize something else might be better or one of your original ideas just didn't work out. Rather, I'm just curious when I can expect Rus…

[deleted]

Re: A Fresh Look at Rust

#25
post #4

I've been using Rust to process a large text corpus, and as Armin suggests, it's a really interesting experience. Here are a few things I've noticed so far: 1. Writing Rust code definitely takes more time than Python or Ruby, but it's not bad in practice. I can't measure the productivity difference yet, partly because I'm still learning Rust. I do spend more time thinking about how to write zero-allocation and zero-c…

> Rust is one of those languages where I need to work to make the compiler happy, but once I manage that, the code generally works on the first try. I can confirm this. I have a CSV parser[1] that is maybe twice as fast as Python's CSV parser (which is written in C)+. There's nothing magical going on: with Rust, I can expose a safe iterator over fields in a record without allocating. [1] - https://github.com/BurntSus…

I don't understand. What more do you need out of CSV parsing that any standard regex library doesn't provide?

Re: A Fresh Look at Rust

#26

Earlier quoted context omitted.

> Rust is one of those languages where I need to work to make the compiler happy, but once I manage that, the code generally works on the first try. I can confirm this. I have a CSV parser[1] that is maybe twice as fast as Python's CSV parser (which is written in C)+. There's nothing magical going on: with Rust, I can expose a safe iterator over fields in a record without allocating. [1] - https://github.com/BurntSus…

I don't understand. What more do you need out of CSV parsing that any standard regex library doesn't provide?

I don't understand; why would you try and parse CSV with a regex?

Note: CSV is actually much more complicated in practice than just splitting on commas.

Re: A Fresh Look at Rust

#27

Earlier quoted context omitted.

> Rust is one of those languages where I need to work to make the compiler happy, but once I manage that, the code generally works on the first try. I can confirm this. I have a CSV parser[1] that is maybe twice as fast as Python's CSV parser (which is written in C)+. There's nothing magical going on: with Rust, I can expose a safe iterator over fields in a record without allocating. [1] - https://github.com/BurntSus…

I don't understand. What more do you need out of CSV parsing that any standard regex library doesn't provide?

There are plenty of values in a purpose built CSV parser. Several important features, depending on the CSVs you'll be working with are:

1. Sometimes you want to actually write files, in which case you'll want help escaping quoting.

2. Shortcuts for using header information to provide more convenient access into a particular column, rather than always doing it by index.

3. Conveniently slurp in only parts of a file, or only particular columns in a file, without loading everything into memory.

Re: A Fresh Look at Rust

#28
> The truth is that the borrow checker is not perfect. The borrow checker prevents you from doing dangerous things and it does that. However it often feels too restrictive. In my experience though the borrow checker actually is wrong much less often than you think it is and just requires you to think a bit differently.

I would love to see this explored in more detail. The borrow checker is, from what I can tell, one of the most important and novel parts of Rust. I'd love to see more detailed examples of where:

1. it kept you from doing something idiomatic that you knew was safe but you just couldn't convince the borrow checker of it.

2. it kept you from doing something that seemed safe, but then you realized that it was actually telling you something important.

Also:

> Even if it would turn out that the borrow checker is not sound

Wait, is this an actual risk? Is there some lingering doubt that the borrow checker is actually sound?

Re: A Fresh Look at Rust

#29
post #4

I've been using Rust to process a large text corpus, and as Armin suggests, it's a really interesting experience. Here are a few things I've noticed so far: 1. Writing Rust code definitely takes more time than Python or Ruby, but it's not bad in practice. I can't measure the productivity difference yet, partly because I'm still learning Rust. I do spend more time thinking about how to write zero-allocation and zero-c…

> Rust is one of those languages where I need to work to make the compiler happy, but once I manage that, the code generally works on the first try. I can confirm this. I have a CSV parser[1] that is maybe twice as fast as Python's CSV parser (which is written in C)+. There's nothing magical going on: with Rust, I can expose a safe iterator over fields in a record without allocating. [1] - https://github.com/BurntSus…

I should've taken a deeper look at your CSV handling code earlier. That's quite a nice demonstration of an API using Decoder/Decodable.
Post reply on HN