Live data from Hacker News

My Struggles with Rust

compileandrun.com

231–240 of 329 posts

Re: My Struggles with Rust

#231
post #219

Earlier quoted context omitted.

Nim. It lets you get stuff done without having to drink the provably correct kool-aid.

GC, though, an a much, much smaller community.

For most applications a GC is fine. In addition, Nim's GC can handle soft real-time programs like games pretty well.

Re: My Struggles with Rust

#233

Isn't nim built for pythonists to do just this sort of thing?

I think Nim may be the most underdocumented project I've ever used. I spent a week or so with it, but quickly grew extremely frustrated as I was constantly scouring old forum posts to learn how to use the basic features of the language. That is not a tolerable situation for me.

If you don't mind me asking, what in particular were you searching for? I agree that Nim's documentation needs a lot of love but would like suggestions on what specifically you had trouble with so that I can at least improve that (for now) :)

Re: My Struggles with Rust

#234
post #225

Earlier quoted context omitted.

You base your 90% claim based on what? I have entirely different experience and I am using C++14 and C. K&R "C programming language" is from 1978 and it's still one of the best books about C still used in 2017. I see many stackoverflow answers updated from C++98 to C++11/14 and some even to C++17.

As someone whose first introduction to C was through K&R, and still has that torn and tattered copy on his bookshelf, the idea that we're still recommending K&R as "one of the best books about C" only validates arcticbull's (sadly-downvoted) point.

I don't share your opinion and most people I know that do C do not share it also. It's good base to get familiar with language, no one say you can't expand your knowledge further after reading this book.

I've read some other "modern" books about C like "21st century C" but they are not for people that do not know C and they are not so good for people that know it.

Can you provide any arguments to support what you wrote? What alternative you would propose for learning C?

https://www.amazon.com/Programming-Language-Brian-W-Kernigha...

Read what majority of opinions say. It's really easy to criticize without giving better alternative.

Re: My Struggles with Rust

#235

Earlier quoted context omitted.

The nice thing about C++ is that it is so widely used that for just about any task you can find examples of how to do it (usually many different ways to do something), especially for tasks like this article. You will also find plenty of C example, which you could also use in C++.

Unfortunately 90% of them will be outdated/wrong/unsafe. Being backward compatible with 30 years of code means you're unlikely to find the right answer for the present. And worse, you won't know it.

I think you are spouting a bit of hyperbole. Some might be unsafe but there are more good examples out there than you are willing to admit. And many use modern C++ and demonstrate smart techniques.

If you are not being hyperbolic then please backup your 90% claim.

Re: My Struggles with Rust

#236
post #225

Earlier quoted context omitted.

You base your 90% claim based on what? I have entirely different experience and I am using C++14 and C. K&R "C programming language" is from 1978 and it's still one of the best books about C still used in 2017. I see many stackoverflow answers updated from C++98 to C++11/14 and some even to C++17.

As someone whose first introduction to C was through K&R, and still has that torn and tattered copy on his bookshelf, the idea that we're still recommending K&R as "one of the best books about C" only validates arcticbull's (sadly-downvoted) point.

Keep in mind that I and the parent were mostly discussing C++, a very different language from C.

Re: My Struggles with Rust

#237
post #188

Earlier quoted context omitted.

I would love a `#[derive(From)]` for newtype structs and enum variants. Would bring Rust error handling back below Java in boilerplate levels. :)

Check out https://crates.io/crates/newtype_derive

Very nice. Now we just need enum variants to be first-class types, and some syntax for deriving on them.

Re: My Struggles with Rust

#238
The author might consider Nim - https://nim-lang.org/. It is a statically-typed compiled language that about equals Rust in performance, but has a much cleaner higher-level Python-flavored syntax, and a very Pythonic parsecfg module in stdlib.

PS. To my earlier downvoters can I have my hard won karma back, please??? This is the response I have been advised to proffer after consulting on the Nim forum, after my earlier terse comment.

Re: My Struggles with Rust

#239

Earlier quoted context omitted.

I'd like to see error-chain standardized into the standard library as well. It seems by far the most sensible approach to building Error types.

Conversely, I really hope it doesn't . error-chain doesn't implement `PartialEq` which means that I can no longer write tests for my failure types. I'm a big believer in quick-error instead.

There are some good `assert_match` macros that allow you to pattern-match error cases instead.

Might also be possible for error-chain to implement PartialEq if you didn't want some of its generalized error-boxing bits. If that's something you need, you might file an issue.

Re: My Struggles with Rust

#240
post #225

Earlier quoted context omitted.

You base your 90% claim based on what? I have entirely different experience and I am using C++14 and C. K&R "C programming language" is from 1978 and it's still one of the best books about C still used in 2017. I see many stackoverflow answers updated from C++98 to C++11/14 and some even to C++17.

As someone whose first introduction to C was through K&R, and still has that torn and tattered copy on his bookshelf, the idea that we're still recommending K&R as "one of the best books about C" only validates arcticbull's (sadly-downvoted) point.

K&R is so clearly written that I was able to understand it as a sixth grader. (At least, I felt like I did; subsequent events later proved that I did not understand pointers, but I don't think it was K&R's fault that a sixth grader didn't understand.) That's why it's still being recommended and the much thicker tomes also purporting to teach the C language have been forgotten. It's probably the same reason that your copy is torn and tattered.
Post reply on HN