Live data from Hacker News

A Fresh Look at Rust

lucumr.pocoo.org

61–70 of 157 posts

Re: A Fresh Look at Rust

#61

Annnd if you'd like to be able to write code as fast as Rust but get it done faster than Python or Ruby, take a look at Haskell. - ex-Python and Clojure user, teach Haskell now. https://github.com/bitemyapp/learnhaskell

Rust is meant to be practical, Haskell is more for academia (horrible ML syntax etc.).

Re: A Fresh Look at Rust

#62

Earlier quoted context omitted.

All things a proper understanding of regex and a minimal understanding of streaming file IO can cover. The whole "if you think regex is the solution to your problem, now you have two problems" thing has gotten out of hand. Regex is not that hard.

I think people who are downvoting me don't understand how ludicrously retarded most people who output CSV are. CSV is not RFC4180. It's whatever bullshit text file your client has handed you and convinced your project manager is your problem to parse, not their problem to generate even remotely correctly. There is no CSV library capable of handling "CSV". Every time someone asks you for it, you better kick and scream…

I think people are being a fit unfair downvoting you right now (I bumped you up) - but I also disagree with you.

When I'm working with a file that purports to be CSV/TSV, with python, I reach out to the CSV module, specify the dialect that created it - and instantly get all the power of being able to identify refer to all the fields, rows without having to otherwise worry about parsing them.

Is it 100% bulletproof - definitely not - but, then again, I'm not writing a life safety system. And I've also never had the Python CSV parser break on any reasonable file I've sent it.

I'm truly thankful for robust CSV/TSV parsers. Throwaway code like this just works - in particular handles parsing the column headers to automatically build the dict for me.

   sitesFN=['gateway.tsv','relay.tsv']
   dsites={}
   for fn in sitesFN:
       f=open(fn,'r')
       reader=csv.DictReader(f,dialect='excel-tab')
       for row in reader:
           dsites[row['NIC_Serial_No']]=row['Device_Name']
Perhaps what you are trying to say that people are failing to hear, is that you can't rely on a CSV parser to, a priori, handle all possible files that purport to be "TSV/CSV" - in that I agree with you, and that you will always need to examine the file and determine if the built in parser will handle it.

But - What if it turns out the standard library CSV parser handles the "CSV" file just fine - in that case it seems to make a lot of sense to use it, rather than taking the time in writing your own (along with the bugs that come from re-writing anything).

And, speaking just for myself - again, I've never seen a CSV/TSV file that the python didn't handle just fine - not to say they aren't out there - you just have to go out of your way to create them.

Re: A Fresh Look at Rust

#63
post #5
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…

This is great feedback, thanks. And if there's anything that you don't like about Rust, please let us know now while we still have a chance to possibly fix it! Only a few short months left until all of our mistakes are forever entombed in Rust 1.0. :)

I've been using Rust for toy projects for a while, and I gotta say Rust is one of the nicest languages out there. Kudos to the Rust team.

As a relative newbie to Rust, one of the biggest hurdles I faced was that of poor documentation. A lot of "rust xxx" searches would link to outdated articles or to stale links in the Rust official docs. I understand that Rust is a young language, and documentation is probably the last thing on the core devs' to-do list (and rightly so), but I think it would greatly help drive adoption rates if we could proper docs in place.

Re: A Fresh Look at Rust

#64
post #21

Earlier quoted context omitted.

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

Yes. Rust borrows quite a few things from the ML family of languages (and things unique to Haskell like "deriving"). OCaml has the advantage of offering very good performance while not having to deal with the borrow checker, but it doesn't have the momentum behind Rust (the community is quite small, and the number of libraries isn't that large). That said, it is a very nice language to work with, and offers a number…

> but it doesn't have the momentum behind Rust (the community is quite small, and the number of libraries isn't that large)

How come, given the amount of use it gets in the industry and academia versus Rust that still hasn't reached 1.0?

Re: A Fresh Look at Rust

#65

Earlier quoted context omitted.

Yes. Rust borrows quite a few things from the ML family of languages (and things unique to Haskell like "deriving"). OCaml has the advantage of offering very good performance while not having to deal with the borrow checker, but it doesn't have the momentum behind Rust (the community is quite small, and the number of libraries isn't that large). That said, it is a very nice language to work with, and offers a number…

> OCaml has the advantage of offering very good performance > while not having to deal with the borrow checker My understanding was that OCaml had no support for parallelism -- so a single core is all you get. Is that not the case?

That's true, though through Lwt (and Core.Async) it has good support for concurrency. However, the work on the parallel runtime seems to progressing at a steady pace, so parallelism is coming.

Re: A Fresh Look at Rust

#66

Earlier quoted context omitted.

Yes. Rust borrows quite a few things from the ML family of languages (and things unique to Haskell like "deriving"). OCaml has the advantage of offering very good performance while not having to deal with the borrow checker, but it doesn't have the momentum behind Rust (the community is quite small, and the number of libraries isn't that large). That said, it is a very nice language to work with, and offers a number…

> OCaml has the advantage of offering very good performance > while not having to deal with the borrow checker My understanding was that OCaml had no support for parallelism -- so a single core is all you get. Is that not the case?

No. It does support parallelism and concurrency.

The biggest issue is that the runtime still has a global lock, but it is in the process of being removed.

Re: A Fresh Look at Rust

#67

Earlier quoted context omitted.

Yes. Rust borrows quite a few things from the ML family of languages (and things unique to Haskell like "deriving"). OCaml has the advantage of offering very good performance while not having to deal with the borrow checker, but it doesn't have the momentum behind Rust (the community is quite small, and the number of libraries isn't that large). That said, it is a very nice language to work with, and offers a number…

> OCaml has the advantage of offering very good performance > while not having to deal with the borrow checker My understanding was that OCaml had no support for parallelism -- so a single core is all you get. Is that not the case?

OCaml does have concurrency and parallelism support, but it has a GIL so their effectiveness is somewhat limited unless you go multiprocess.

I believe there are serious efforts towards removing the GIL these days.

Re: A Fresh Look at Rust

#68

Earlier quoted context omitted.

> OCaml has the advantage of offering very good performance > while not having to deal with the borrow checker My understanding was that OCaml had no support for parallelism -- so a single core is all you get. Is that not the case?

That's true, though through Lwt (and Core.Async) it has good support for concurrency. However, the work on the parallel runtime seems to progressing at a steady pace, so parallelism is coming.

Ah. Thanks for the info!

Re: A Fresh Look at Rust

#70

Earlier quoted context omitted.

All things a proper understanding of regex and a minimal understanding of streaming file IO can cover. The whole "if you think regex is the solution to your problem, now you have two problems" thing has gotten out of hand. Regex is not that hard.

I think people who are downvoting me don't understand how ludicrously retarded most people who output CSV are. CSV is not RFC4180. It's whatever bullshit text file your client has handed you and convinced your project manager is your problem to parse, not their problem to generate even remotely correctly. There is no CSV library capable of handling "CSV". Every time someone asks you for it, you better kick and scream…

This post sums up why.

http://programmers.stackexchange.com/a/215171

CSV is not just simple fields separated by commas with some quotes thrown in.

Post reply on HN