Live data from Hacker News

Becoming Rustacean: Resources to Learn Rust Programming

nativebyx.dev

41–48 of 48 posts

Re: Becoming Rustacean: Resources to Learn Rust Programming

#41
post #38

Earlier quoted context omitted.

As a javascript/typescript developer I took a notion to learn Rust and it has been hard but rewarding on a personal level. Im concerned though that I'm learning somwthing that has very few if any real jobs right now. All I see is block chain nonsense. In your opinion is there much chance that this will change?

To be honest I would say Rust is worth learning even if you were to never use the language at all after learning it. The problems Rust attempts to tackle are fundamental problems you will encounter in many languages. Understanding how to program or how to think in order not to get those problems in the first place is the thing Rust can teach you. A lesson that any programmer can learn from. That being said Rust has g…

Interesting take. So far I agree with what you're saying. It has given me more insight into how memory management works than I'd had before. I think one of the things that bugs me about javascript is how difficult it is to track down memory leaks. A problem I've often faced when dealing with large codebases and other peoples code. The memory management in Rust via the borrow checker is a very elegant as a solution. It's also a pain but not as hard to deal with as people make out.

Re: Becoming Rustacean: Resources to Learn Rust Programming

#42
post #25

Earlier quoted context omitted.

Well I guess we can always play micro-benchmarks game if you want to go down that path, including selecting specific compiler toolchains and flags while making it a point that it is a property of language XYZ, to make it even better.

I don't see the std::vector example as a micro-benchmark, we're not talking about wasting a few microseconds in a contrived example, we're talking about destroying the amortized constant time growth performance of the data structure because of an API goof.

Which std::vector, from which C++ compiler, targeting what OS, with what set of compiler flags, and optimization passes?

Re: Becoming Rustacean: Resources to Learn Rust Programming

#43
post #24

Earlier quoted context omitted.

First of all Prolog is usually not AOT compiled rather JITed, secondly regarding Haskell, it is an issue with the skill set of the developer more than anything.

Given expert skills in both Haskell and Rust, Rust is by far the fastest performing language. And if you use idiomatic Haskell the difference is even bigger. E.g. if you use lots of Monad transformers and lazy evaluation.

The optimisation lies between keyboard and chair.

Plus if one lacks the ability to write high performance Haskell code, they definitely aren't experts.

Re: Becoming Rustacean: Resources to Learn Rust Programming

#44
post #42

Earlier quoted context omitted.

I don't see the std::vector example as a micro-benchmark, we're not talking about wasting a few microseconds in a contrived example, we're talking about destroying the amortized constant time growth performance of the data structure because of an API goof.

Which std::vector, from which C++ compiler, targeting what OS, with what set of compiler flags, and optimization passes?

You'd think right?

Except nope, it's an API design problem. If you write a std::vector or equivalent but where reserve has analogous behaviour to Vec::reserve you can't do Vec::reserve_exact at all and that can really hurt in other cases.

There really are two distinct features and C++ specifies a single API call.

Re: Becoming Rustacean: Resources to Learn Rust Programming

#45
post #42

Earlier quoted context omitted.

I don't see the std::vector example as a micro-benchmark, we're not talking about wasting a few microseconds in a contrived example, we're talking about destroying the amortized constant time growth performance of the data structure because of an API goof.

Which std::vector, from which C++ compiler, targeting what OS, with what set of compiler flags, and optimization passes?

You'd think right?

Except nope, it's an API design problem. If you write a std::vector or equivalent but where reserve has analogous behaviour to Vec::reserve you can't do Vec::reserve_exact at all and that can really hurt in other cases.

There really are two distinct features and C++ specifies a single API call.

Re: Becoming Rustacean: Resources to Learn Rust Programming

#48
post #42

Earlier quoted context omitted.

Which std::vector, from which C++ compiler, targeting what OS, with what set of compiler flags, and optimization passes?

You'd think right? Except nope, it's an API design problem. If you write a std::vector or equivalent but where reserve has analogous behaviour to Vec::reserve you can't do Vec::reserve_exact at all and that can really hurt in other cases. There really are two distinct features and C++ specifies a single API call.

Yes, it only matters that it fulfills the algorithm requirements described in ISO C++, how the implementation look like is another matter.

Still, this is going way down into the weeds and very far away that any mature AOT compiled language offers good enough speed, ignoring toy compilers done by students.

Post reply on HN