News for hackers. Stuff that matters.
Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by bronz on Monday September 26, 2016 @04:33PM (#12585313)
im trying to learn rust right now. its really hard
Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by bsder on Monday September 26, 2016 @09:02PM (#12586883)
Just so you know and hopefully are encouraged--learning C is really hard, too. Most people just never actually learn it.

Rust makes you come to grips immediately with the things that will bite you in C later.

Keep at it. It's a continuing process regardless of language.

Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by rdtsc on Monday September 26, 2016 @11:21PM (#12587230)
Knowing C, and liking Rust and struggling to learn it. I think Rust is more like C++ than C in the type of difficulty of learning.

C is more like chess: the rules are not that complicated and you can figure out how to write code. It will be a long time to learn to write good C code.

With Rust it is hard to figure out the rules, even to get start writing code. They are more like complicated board games with lots of rules to learn.

As an aside, after I wrote that it reminded me of this map: http://goldns.ru/cppmap-2012.png C++ devs will get all the inside jokes there, Alexandrescu's castle, curiously recurring template, exceptional swamps and others...

Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by sidlls on Tuesday September 27, 2016 @02:29AM (#12587815)
Rust seems very much like modern C++. Borrowing, references and the like have nearly direct analogs to C++ references, unique_ptr and other STL constructs. Except the compiler enforces them with (my opinion) relatively more clear error messages most of the time and in some cases the syntax is actually clearer (others not necessarily).

My biggest struggle so far is overcoming the differences in the implementation of generics. I have yet to "fight the borrow checker," but the generics implementation is something of a hurtle for me.

Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by wyldfire on Monday September 26, 2016 @04:36PM (#12585336)
Stick with it! If you don't already have experience with C/C++ I would imagine it being extremely challenging.

I've only scratched the surface of the language and I can agree that it's not simple.

I've gotten lots of help from #rust on IRC and places like /r/rust. https://users.rust-lang.org might be good too, but I've only lurked there.

Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by steveklabnik on Monday September 26, 2016 @05:08PM (#12585575)
I am in the process of re-writing the book, and the quality is much higher this time around. http://rust-lang.github.io/book/ getting there! Chapters 8 and 9 should be merged soon.

But yeah, beyond that, we love helping new people: my sibling commenter already gave you all the good links :)

Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by leeoniya on Monday September 26, 2016 @08:44PM (#12586811)
hey Steve, would it be possible to retain scroll position of the nav menu after navigation. I'm finding the auto-scroll of the clicked section to top a bit disorienting.
Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by steveklabnik on Monday September 26, 2016 @08:58PM (#12586866)
File a bug against mdbook, we'll see what the maintainer says :)

https://github.com/azerupi/mdBook

Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by rkangel on Tuesday September 27, 2016 @04:49AM (#12588197)
C is easier to learn, hard to use well. Rust is harder to learn, but easier to use well.

C is an easier language to learn that Rust because it's simpler. That is deceptive though - you may understand the language, but it takes years to understand how to use it properly and safely. Rust has a bit of a learning hurdle at the start, but once you understand the language it's much clearer how to use it effectively and safely.

(C++ is the worst of both worlds)

Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by knowThySelfx on Tuesday September 27, 2016 @03:41AM (#12588000)
Certainly not easy. And you could forget the concepts if you don't continue with it. But the documentation is great. They've explained everything clearly. If you follow it one by one, it actually gives you a "masochistic" pleasure of learning it ;)
Re:Show HN: Rust, ARM Cortex M, and a Generated HAL by bluejekyll on Monday September 26, 2016 @11:55PM (#12587338)
What languages do you know? There are some tutorials aimed at people coming from different languages.

That said, some concepts hit you in the face right away, making the language have an initially steep learning curve, but after that it becomes much easier.