Live data from Hacker News

Learning Rust via Advent of Code

forrestthewoods.com

81–85 of 85 posts

Re: Learning Rust via Advent of Code

#82
post #55

Earlier quoted context omitted.

I haven't used Nim for anything else since then. If I had to give a simplified critique, the language in itself is still springing to life and the user base and documentation are small. I currently don't have the time to sink into something that could end up being a gimmick only, while there is some hardcore optimization needed in one of our services that could be approached through a better parallelization using Rus…

Hey! Nim core dev here. I was going to offer my support when I saw your original comment but based on your critique so far there isn't that much that I can do, other than keep doing what I'm doing already (evangelizing Nim as much as I can). This kind of thing does really worry me though, it's almost like a self-fulfilling prophecy, you aren't going to use Nim because you think there isn't enough people using it :( D…

Hey mate, awesome you messaged! I am sincerely not skilled enough to comment on the minutia of the language. I can say I really love the idea behind it and as far as I can tell the implementation is solid.

From a end user point of view, I thought the official website and documentation felt a bit lackluster, not because it was bad or anything (the Nim tutorials part I & II are a godsend), but I instinctively compared it to languages like Python. Again, this is not a fair comparison, more like a impression. I'd love to see more blog posts like this one [0] or maybe the occasional roadmap.

Ah I understand where the 'self-fulfilling prophecy' is coming, but if anything I talked about Nim to dozens of people already, even if I can't currently find utility for it on my day job (I do ML, Embedded and Image processing, so it is actually really hard to use anything other than c++)

Again, commenting from the outside, it seems it is a hard position because today upcoming languages such as rust and go have some solid enterprise backing.

If anything, I don't think you need to change my mind! The Nim development is something I keep a close eye on and I hope I will progressively incorporate it on my daily tasks. The mentioned regret on the first post has really more to do on how little spare time I have.

[0]: https://nim-lang.org/blog/2018/06/07/create-a-simple-macro.h...

Re: Learning Rust via Advent of Code

#83
post #63

I also thought regex seemed overkill and didn't feel like adding an extra crate to my Cargo.toml. Luckily for the days I attempted I was able to get by on just the split method for str's[0] which was nice and concise. So for your regex example you could also do: // #1 @ 916,616: 21x29 let parts: Vec = l.split(['@', ',', ':', 'x'].as_ref()).collect(); let x = parts[1].trim().parse:: ().expect("x as i32"); let y = part…

> and didn't feel like adding an extra crate to my Cargo.toml Why not? cargo makes it extremely easy to add new crates. The hardest part is figuring out what dependency you want, but once you know what it is, adding it is really easy.

Totally agree, cargo makes it easy. Honestly it’s just that the level of laziness is so high when I’m programming on something personal after work that even having to switch to chrome to check a version number on crates.io will be avoided.

Re: Learning Rust via Advent of Code

#84

Earlier quoted context omitted.

Part of what we do to balance this out is to have the team make some of those third party packages; the regex crate is a good example of that. It’s still maintained by the team even if it’s not in the standard library itself.

So then why isn't the regex lib part of the standard library?

Your concern may be founded in the difficulty other languages' package managers present. With regard to C/++, there really isn't package management at all, making package inclusion a big decision. With regard to Ruby (for example), the package management is actually pretty unreliable and terrible given how many gems require system libraries and incompatibilities of gems across Ruby versions.

With Rust, the package manager is very good. So it's not a problem in practice.

Re: Learning Rust via Advent of Code

#85
post #63

Earlier quoted context omitted.

> and didn't feel like adding an extra crate to my Cargo.toml Why not? cargo makes it extremely easy to add new crates. The hardest part is figuring out what dependency you want, but once you know what it is, adding it is really easy.

Totally agree, cargo makes it easy. Honestly it’s just that the level of laziness is so high when I’m programming on something personal after work that even having to switch to chrome to check a version number on crates.io will be avoided.

You might be interested to know that cargo can do that for you

  $ cargo search regex
  regex = "1.1.0"             # An implementation of regular expressions for Rust. This implementation uses finite automata and gua…
  regex-automata = "0.1.5"    # Automata construction and matching using regular expressions.
  …
Post reply on HN