[HN Gopher] Beginner's Series to Rust
       ___________________________________________________________________
        
       Beginner's Series to Rust
        
       Author : philonoist
       Score  : 168 points
       Date   : 2022-06-21 14:13 UTC (8 hours ago)
        
 (HTM) web link (docs.microsoft.com)
 (TXT) w3m dump (docs.microsoft.com)
        
       | nyxtom wrote:
       | Selfish plug here, I started a YouTube channel dedicated to
       | working through Rust as I wanted to get better at it in general.
       | Feel free to check it out for those interested.
       | 
       | https://www.youtube.com/c/nyxtom/
        
         | abzug wrote:
         | Loved the little spectrogram at the bottom. Such a nice touch.
        
       | cmrdporcupine wrote:
       | Cynical part of me feels like Rust is about to go from the _" I
       | like this tech I've been following for years and really dig but
       | can't get a job in it yet"_ to the _" Everyone else has a job in
       | it and claims senior status in it, but I can't"_ phase.
       | 
       | I've been down that road before.
       | 
       | Meanwhile there's a lot of immature pieces still. I was looking
       | at SIMD support earlier today (thinking about porting an
       | audio/DSP project from C++) and it's still early days. And Async
       | is still half-baked as others have pointed out.
        
         | lumost wrote:
         | Do people claim seniority by language still? My anecdotal
         | experience has been that per language skill peaks after 6
         | months to 1 year of full time dev. This time frame shrinks the
         | closer the language is to a known toolchain.
         | 
         | I'd be surprised if companies filtered for rust specific
         | experience.
        
           | cmrdporcupine wrote:
           | It depends on the employer. What I'm finding right now is
           | places that are hiring for Rust are mostly willing to
           | entertain people with a deep C++ background. But I've
           | definitely seen some asking for more specific multiple year
           | Rust experience.
           | 
           | Right now the job market for Rust seems to be mostly biased
           | towards crypto companies, though, which is somewhere I won't
           | go.
           | 
           | But I'm currently interviewing at two places that do Rust,
           | and interviewed at another a month ago, so.
        
       | atulsnj wrote:
       | Was looking for something like this for a long time. I primarily
       | use python and was looking forward to learning rust because of
       | all the love it gets.
        
       | leke wrote:
       | Nice - Sampling a couple of the videos, the topics are explained
       | really well.
       | 
       | This makes it even harder for me to decide what to learn for my
       | next programming language. Go, Rust, or Julia.
        
         | konart wrote:
         | Maybe you should start with "why" you want to learn a new
         | language?
         | 
         | Job? I'd say Go
         | 
         | Command line tools with complex logic for fun and community
         | support? Rust
         | 
         | Julia? Julia.
        
           | Qworg wrote:
           | Minor quibble, but Rust engineers are in wildly high demand -
           | even beyond normal engineering levels.
           | 
           | Many of the majors are hiring a ton for rebuilding backend
           | stacks and crypto still wants as many as it can get as well.
        
           | nicoburns wrote:
           | > Job? I'd say Go
           | 
           | If you want to work _in_ the learned language, then sure. But
           | if you just want to increase your general employability then
           | Rust is probably a better bet. You 'll learn more, and it
           | will make you a better engineer in every language you use. My
           | JavaScript has been greatly improved by learning Rust.
        
         | pdpi wrote:
         | If you'll forgive me creeping around in your comment history,
         | it looks like you work with PHP? I don't know Julia, but
         | between the other two I suggest you should learn Rust.
         | 
         | Don't get me wrong: Go is a really good language, and eminently
         | practical (and I am ATM working on getting productive with it
         | myself) , but it doesn't have anything particularly novel to
         | teach you, and part of what makes it good is that it's _really_
         | easy to pick up, so it 's something that you can just learn on
         | the fly if you need to.
         | 
         | Inversely, Rust requires a fair bit more ramp up time if you
         | ever need to use it in anger, and there's a lot of fairly novel
         | stuff to learn there that is generally useful, so you'd benefit
         | more from learning Rust as a project.
        
           | bsaul wrote:
           | Go's main benefit is that it makes you a better coder, simply
           | because the language offers you only basic (but well thought)
           | tools. This constraint makes you think _deeply_ about what
           | exact problem you 're trying to solve, and reduce your
           | problem down to its core.
           | 
           | This is an underrated benefit of go, but to me it is by far
           | the most important aspect of the language.
        
           | slaymaker1907 wrote:
           | Julia is also a pretty good language, though Rust is
           | definitely the more unique of the two in terms of how it
           | changes the way you approach problems. Julia has some
           | uniqueness in that it allows for metaprogramming via macros
           | and has multiple dispatch as a first class concept. However,
           | Rust makes you think a lot more about how you lay out data
           | while also covering stuff like pattern matching (and the
           | combination of the two ends up being pretty interest as well
           | even if you already have experience with a language like
           | Haskell or ML).
           | 
           | However, Rust is a very difficult language and so Julia or
           | even Go might be a better second programming language
           | (definitely not a good first language). While Go is pretty
           | standard as languages go, it does have static typing which
           | PHP lacks (at least by default).
        
         | Bromeo wrote:
         | Many people are rightfully recommending Rust and Go, so I'll
         | weigh in under what circumstances you should learn Julia.
         | 
         | If you regularly find yourself solving problems with Matlab,
         | numpy/torch/pandas or R, you'll be delighted to learn Julia. R
         | and Matlab were great at the time, but really show their age.
         | Python was never meant to be fast, so all the algorithms are in
         | C/C++, making them very hard to inspect, modify or build upon.
         | Julia excels at bridging the gap between high-performance
         | numerical algorithms, great composability through it's type
         | system, and a great syntax for vectorized programming, which
         | makes it straightforward to inspect and change code for very
         | complicated algorithms. For instance, check out Octavian.jl for
         | a pure-julia (fast) alternative to BLAS - or try reading the
         | DataFrames.jl source code (and compare it to the source code of
         | pandas).
         | 
         | Note also that the mentioned applications go beyond data
         | science into general machine learning (+deep learning),
         | simulation science, optimal control, decision making under
         | uncertainty, and many other fields leveraging custom numerical
         | algorithms.
         | 
         | BUT, Julia is (imo) only worth learning if you need to write
         | sophisticated numerical algorithms. If you're more of a systems
         | level programmer, web dev, etc, you might not appreciate what
         | sets Julia apart. Julia and Rust target somewhat different
         | niches, with Rust being much more aimed at developing
         | applications with many interacting components that may not
         | fail. Go doesn't really target numerical programming at all and
         | is instead great for multiple-instruction-single-data (MISD)
         | applications (as opposed to SIMD applications like matrix
         | multiplication).
        
         | vgel wrote:
         | Depending on your current language, I might recommend Rust
         | because it integrates really well for writing high-performance
         | extension modules for other languages.
         | 
         | For example at $WORK we're slowly rewriting our entire data
         | processing pipeline in Rust, but for awhile we've had a hybrid
         | Rust / Python setup using PyO3, which makes it really easy to
         | build your Rust code into a shared library and call it from
         | Python, with the entire API specified declaratively using
         | derive macros and the GIL handled for you using typestate
         | tokens. Really cool stuff.
        
           | a4a4a4a4 wrote:
           | How do you handle deploying the rust code that's embedded in
           | your python code? Do you have multiple deployment targets for
           | the code (mac, linux, windows)? This is the sticking point
           | for me with embedding rust into my python projects.
        
             | vgel wrote:
             | We use Maturin to build. You can either build manylinux /
             | Windows / OSX wheels and upload them to PyPI / your
             | preferred distribution method, or easier, use `maturin
             | develop` to build and install a wheel into the currently-
             | active virtualenv.
        
             | kylebarron wrote:
             | Build Python wheels on CI with the statically-linked Rust
             | binary?
        
         | nobleach wrote:
         | I'm not a huge Go fan, but I do have to give it a lot of credit
         | at its very linear learning curve. You get a few basic
         | concepts, and you're pretty much good to write a great many
         | things. It can really frustrate you if you've done other
         | languages - and you're used to being able to solve problems in
         | many different ways. Rust on the other hand has a what I'd call
         | a factorial curve. You get Hello World, you get into learning
         | how most things return a Result monad... and then you're hit
         | with some really complex stuff. It can be deflating unless you
         | really stick with it. The language is pretty vast, so you won't
         | be re-inventing things like many often do with Go. Both are
         | worthwhile tools to have in your toolbox. I will say that if
         | you're into web-dev, Go will get you results with less "pain".
         | But even that's debatable.
        
         | bluejekyll wrote:
         | This is a Rust thread about learning Rust. I believe you will
         | mostly get advice to learn Rust, as would be my advice, but
         | that's because Rust fits into the work environments that I
         | enjoy.
         | 
         | Databases, distributed systems, backend web systems,
         | webassembly, low level systems programming. Rust is fantastic
         | at these things.
         | 
         | When aiming to learn something new, I find it best to ask
         | myself what I want to accomplish with it. Each of the languages
         | you've listed have made significant inroads in various areas,
         | learn the one that fits your use cases the most.
        
         | throwaway894345 wrote:
         | Go is low-hanging fruit. You can pick it up in a weekend pretty
         | easily. Rust is a much steeper learning curve, but it will also
         | deepen your understanding of type systems and memory
         | management. Julia seems like it hasn't broken out of the data
         | science niche in full yet, and even there it seems like it
         | hasn't made a ton of headway with respect to marketshare--it
         | doesn't seem like it appeals much to me.
         | 
         | If you want something halfway between Go and Rust, I'd look at
         | Gleam--it seems like a garbage collected Rust, so you get a
         | nice ML-inspired type system without the pedantry of the
         | borrow-checker (sometimes that pedantry is helpful, but rarely
         | so for the applications I write). This would be next on my list
         | of languages to learn.
         | 
         | Also, my favorite way to learn a new language is to write a
         | static site generator. It will take you through a tour of the
         | standard library as well as the third-party library ecosystem.
         | It's a simple project without being a toy.
        
       | ArrayBoundCheck wrote:
       | Isn't rust 10+yrs old now? With 1.0 being 7 years ago? Feels like
       | it's a language people like to talk about but not actually use
       | for anything serious
        
         | geodel wrote:
         | Well that's past. 2022 will be the year of Rust.
        
         | cmrdporcupine wrote:
         | At this point, it might be in that phase _" like high schoolers
         | and teenage sex: everyone talks about it, nobody really knows
         | how to do it, everyone thinks everyone else is doing it, so
         | everyone claims they are doing it."_
         | 
         | But seriously, I'm seeing more job postings for it.
         | Unfortunately too many are in crypto.
        
       | synergy20 wrote:
       | a short series in text will be nice too, reading text is 10x than
       | watching a video, plus it's safe at work
        
         | bluejekyll wrote:
         | While I agree with this take, and I vastly prefer text based
         | sources to video, is this true for everyone? This seems to
         | support that, though I bet the study is a little biased:
         | 
         | "More students preferred reading than preferred video (30% to
         | 20%, the other 50% preferred other forms of learning like in-
         | person lectures and hands-on learning). And students who'd
         | consumed the material via reading performed slightly better on
         | the post-learning assessment than students who watched video,
         | although the study's numbers were small enough that this
         | difference was not statistically significant."
         | 
         | -- https://www.dataquest.io/blog/video-text-learn-data-
         | science-...
        
         | nonfamous wrote:
         | There's a link to a text version in the description:
         | https://docs.microsoft.com/en-us/learn/paths/rust-first-step...
        
           | synergy20 wrote:
           | Thanks! reading now.
        
         | spotlesstofu wrote:
         | You may want to check out Rustlings https://github.com/rust-
         | lang/rustlings/
        
       | zelias wrote:
       | This looks great! Been looking to pivot from web / JS into
       | systems programming and Rust seems extra appealing.
        
         | Deukhoofd wrote:
         | I've been playing with Rust in my spare time for a bit, and I
         | have to say it's a very nice language. Nice tooling and
         | generally nice language design. It takes a while to get your
         | head completely around how the borrow checker exactly works,
         | and how to design software around it, but once you get an
         | understanding of it, it becomes a very powerful tool.
        
       | [deleted]
        
       | srvmshr wrote:
       | I found the whole series pretty useful. Rust is a good addition
       | 
       | https://docs.microsoft.com/en-us/shows/
        
       | JCWasmx86 wrote:
       | Looks great, bookmarked for the case I have to use rust again
        
       ___________________________________________________________________
       (page generated 2022-06-21 23:02 UTC)