[HN Gopher] Yes, I am still learning Rust ___________________________________________________________________ Yes, I am still learning Rust Author : lukastyrychtr Score : 84 points Date : 2020-03-12 20:29 UTC (2 hours ago) (HTM) web link (llogiq.github.io) (TXT) w3m dump (llogiq.github.io) | klodolph wrote: | I'm still learning Rust, but I'm developing a deeper appreciation | for Go. I've already _learned_ Go. As far as I can tell, I'm a Go | expert. | | Rust has a pretty large surface area. There's a ton of places | where you can get overwhelmed by choices. For example, when | you're working with slices, you might find yourself thinking | about the pros and cons of different approaches using indexes, | convenience functions, pattern matching, or iterators. | | It's a big toolbox, and sometimes I wish I had a smaller toolbox, | even if it means giving up the choice of which tools to keep. | | So, I'll still be learning Rust for a while, too. | chewxy wrote: | There has to be a learning strategy for kitchen sink languages | though. | Polylactic_acid wrote: | You could just pick the first option that looks good enough and | be done with it so you avoid having to understand them all. | 01100011 wrote: | They're not really the same thing, IMO. Sure, Go is pitched as | a systems language, but when Google themselves are rewriting OS | components written in Go with Rust, you know something is up. | Go seems like Python++... a more reliable and performant high | level language. The GC nature makes it inappropriate, IMO, for | low-level systems work. Sure, write apps in it. Fine. But I | can't see writing drivers in Go. | clktmr wrote: | Pretty much what I am thinking. When I use Rust, at the end of | the day I will have spent more time with the language instead | of my actual task, and I don't see this changing given the rate | Rust is still changing. It feels like you have to be a | "programming language afficionado" to use Rust properly. | | Whereas in Go, there is always only one reasonable way to do a | specific task. You almost forget about the language and just | get stuff done. | metalliqaz wrote: | That's why I was drawn to Python, and I still haven't found a | good reason to switch to Go in my use cases. | cft wrote: | Here is a very practical example. | | We chose Rust for the current project because our Python | program took more than 1TB of RAM. Rust program carefully | manually laying out memory takes 75G. Other choices in this | case are C/C++, but after you get a hang of Rust, it's | actually easier because you don't spend days inspecting core | dumps in gdb. | billconan wrote: | I am researching a backend programming language for a future | project. I am debating if I should choose rust fearing for the | difficulty of hiring. | adamnemecek wrote: | I think that you'll actually attract all the right people. | billconan wrote: | But we need to control the burning rate. (We are a startup) | the right people are expensive. | jaza wrote: | Rust is still new and shiny, and is still evolving at a rapid | pace. Everyone's still learning Rust, I'd imagine that even Rust | core contributors are still learning Rust! (The same can be said | for most other languages too, although not all to the same | extent). Anyone who is looking for Rust talent right now, and who | discards the CVs of people "still learning", clearly knows | nothing about Rust, nor about hiring good devs. | melling wrote: | 1.0 was released 5 years ago. | | Swift is younger and I think it's a great language. | | If the tooling is ready and I don't have to fight it, I'd be | fine using Rust. I just need a reason. Anyone using it for iOS | development? | steveklabnik wrote: | My employer, Cloudflare, is using Rust as part of the 1.1.1.1 | app on iOS. | saagarjha wrote: | Is this code shared across platforms? | Klonoar wrote: | I've actually got a working set of bindings to AppKit/UIKit | that I'm trying to get to a release-able point. They run fine | on both macOS and iOS; for the former I've also got decent | support for sandboxed environments. | | My goal is to write all my stuff in Rust, because I am sick | and tired of writing products for the Apple ecosystem and | then having to rewrite them if I want them outside of it. | | I don't enjoy writing browser-wrapped applications (though | they have their place, let me be clear...). I don't want to | write in C just to be able to compile anywhere. IMO, Rust is | the future. | | /end fanboy-ism I suppose | weiming wrote: | If you can share, how usable is your approach | boilerplate/types wise? Would love to go all into Rust but | the AppKit/etc. bindings get clunky very easily. | ElderKorihor wrote: | I love Rust, but it doesn't have a strong UI development | story yet. | gameswithgo wrote: | very few languages do, and those that do it is usually for | just one platform. | Polylactic_acid wrote: | Because native UI is on the decline unfortunately. Its | too complicated and there are too many different systems. | If you want a gui in rust you would be better off having | your program start a web server on localhost. | weiming wrote: | It's very easy to cross-compile and use Rust as a library, | leaving the Swift portion for display/views only. We are | looking at doing this for our next app (OS X, but would work | just as fine for iOS). | markmm wrote: | Rust is a terrible language. It has an identity crisis. Thinks | it's a high level but also system level language. You cant be | both. The unix philosophy always wins. Do one thing well. C is | the perfect system lang and Java/C#/Lisp/Python etc are the cream | of high level langs. | Bekwnn wrote: | I find this to be one of the reasons I didn't find rust that | appealing as an C++ alternative. Its safety is something I admire | and is highly valuable to many domains, but the two main things I | want to abandon with C++ are its complexity and its compile | times. Rust doesn't seem to get away from either of those. | | As someone who doesn't really use Rust, does anyone who does find | the complexity detracts from it a bit as a language? Is there | effort to reduce complexity with the language or does it mostly | embrace it? | | At this point I find myself mostly looking at modern C | alternatives--ones which manage to stay relatively simple the way | C does, but with a few additional features and better designs | (Zig, Odin, maybe Jai, etc). | | All that said, I work with C++ and so I could see myself | potentially working with Rust in the future, so I'm curious how | people feel about its complexity, especially given that its | complexity will presumably only increase with time. | brundolf wrote: | > Is there effort to reduce complexity with the language or | does it mostly embrace it? | | You're right that it isn't a "simple" language (in the Rich | Hickey sense of the word). And I don't think there's any effort | to actively _simplify_ it. | | However, I do expect the rate of complexity _growth_ to taper | off fairly soon. Every feature that gets added to Rust is added | carefully and with a clear vision in mind. Up until now they | 've still been building out the foundations of what most people | will need when using Rust in different contexts. Recently a lot | of this has been ergonomics (like async/await). But I think the | rate of features being added is an S-curve, and I think we're | nearing the top. Given that, I have hope that it won't follow | the same path as C++ in terms of sprawl; it's certainly not as | complicated as C++ yet, and if it doesn't keep growing at this | rate, I don't think it will become that way. | | Part of why C++ is so complicated is that it's had to tack-on | decades of language advancements, after the fact, as they were | invented/became prevalent. Heck, C++ itself is already a tack- | on of C. There wasn't a clear initial vision for the past | couple decades of "stuff". | | Rust, on the other hand, a) has those decades of ideas to | incorporate from the outset in a cohesive way, and b) was | started from scratch, not an extension of an existing language. | This has so far meant a much clearer sense of vision and big- | picture design. These features were made to work together; the | roadmap was fairly clear from the beginning. | nunja wrote: | This. Exactly. Also, there is definitely an ongoing effort to | make the language simpler, not in the type system which | arguably is getting more complex, but in the way the borrow | checker is getting smarter. Might be imperceptible at first | but really brings a lot in term of ergonomics and | productivity. | brundolf wrote: | Simplifying the borrow checker is a slightly different | question than simplifying "the language" (meaning the | syntax and/or behavior of the syntax), because the latter | can break backwards-compatibility (which is why it likely | won't happen). | | But the borrow checker is an interesting case because | simplifying its rules in such a way that they're more | tolerant (without sacrificing safety) might reduce | cognitive overhead while still being fully backwards- | compatible. | nunja wrote: | Yeah ! That's was the point I was trying to make. It was | a breath of fresh air when I switched from Rust 2015 to | Rust 2018, without obvious change in the language from my | point of view. | ragona wrote: | I find that I rarely touch the most complicated parts. Sure, it | has a rich type system with all kinds of magic you can do with | generics and such, but if you're just making an application you | often don't have to futz with it. You can also often get away | without even providing a type. If you're working on deep data | structures and libraries it gets more complicated, as it | should. It's a language that allows you to specify the behavior | of your program quite precisely, and in many cases you don't | have to worry much. Little things like allowing a clone here or | there when it isn't a tight loop go a long way towards | simplicity. | steveklabnik wrote: | The problem is that there's no standard definition of | "complexity," and so not only is it really hard to answer your | question, it's also really hard to compare one language's | complexity to another. | | I personally subscribe to the "waterbed theory of complexity", | that is, I believe that the world is complex, and often, | attempts to remove complexity cause it to pop up somewhere | else. Rust's goals have an inherent level of complexity to | them, and so require a certain degree of complexity to | accomplish. There is an argument that if we had dropped one or | two of those goals, we could have made a language that is | _much_ simpler, but I 'm also not sure Rust would be as popular | if we did. | | One thing we strive for with Rust is that features are | reasonably _orthogonal_ and work well together, without weird | corner cases. We also try to only add more features when the | cost is actually justified. We have said "no" to a lot of | things. We have also tried and rejected a lot of things. | | You also may enjoy this blog post of mine: | https://words.steveklabnik.com/the-language-strangeness-budg... | | (I should also note that I'm not actually on the lang team, so | this is more of a statement about what I observe and my own | opinion rather than policy, strictly speaking.) | 01100011 wrote: | > attempts to remove complexity cause it to pop up somewhere | else | | Yes, but sometimes the average brain is better at dealing | with certain types of complexity. C++, IMO, puts the | complexity in the wrong places. Programming is inherently | complex, but it shouldn't be any more so than it needs to be | and the complexity should be of the type humans can manage, | as much as possible anyway. | steveklabnik wrote: | I don't disagree! Well, I might disagree that they put it | in the "wrong" place exactly; I think that the committee is | doing the best that they can given their goals and | constraints. I do not have the same goals and constraints, | and therefore prefer to use other languages. | fogleman wrote: | A little weird that you didn't mention Go, which seems to fall | exactly in the category of "a simple, modern, well-designed C" | nicoburns wrote: | From my perspective, Rust is a lot less complex than C++. It | does still have a lot of features, but there are a couple of | mitigating factors: | | 1. The features tend to be intuitive to use, and work in the | way you expect them to. 2. If you do make a mistake, this tends | to be a compile time error with a helpful error message that | explains what you've done wrong. 3. The most complicated | features are rarely used. Most of my Rust reads like | TypeScript. | | Part of the problem with C++'s complexity is not only is it | difficult to work out the correct incantation, but it's | difficult to know whether you have or not. Rust almost | completely takes away that uncertainty. | | The compile times are definitely an issue unfortunately. | wyldfire wrote: | > So, yes, I am still learning Rust. | | I have always been very cautious about how much I tout my skill | with C++. Sure, I know a bunch. Probably a good bit more than the | average bear. But the scope of C++ is enormous (even if you stop | at C++03 there is a lot to know). And with new language standards | it keeps growing. | | Despite ~two decades of experience, I list my skill level with | C++ as "intermediate" because "expert" paints a bullseye on your | forehead. I could imagine tons of C++ questions that I could not | answer off the top of my head. Those probably disqualify me as an | expert and would involve a lot of embarrassing backpedaling in an | interview. | | I wonder how many times my resume was discarded because they | needed someone with more than "intermediate" level experience | with C++? | [deleted] | chris_st wrote: | At my last job, we were trying to hire an expert C++ | programmer, and every interview our C++ wizard would ask, "How | do you rate your C++ knowledge on a scale of 1..10?" and pretty | much invariably get a "8 or 9!" kind of answer. | | Then came the C++11 and C++14 questions, and yeah, they didn't | have a clue. | | The guy they hired admitted that he _wasn 't_ a wizard, but | said that he really wanted to become one. | giovannibonetti wrote: | This self-assessment ignorance phenomenon is well documented | under the name Dunning-Kruger effect [1] | | [1] https://en.m.wikipedia.org/wiki/Dunning%E2%80%93Kruger_ef | fec... | jerf wrote: | "I wonder how many times my resume was discarded because they | needed someone with more than "intermediate" level experience | with C++?" | | Don't be afraid to write "expert" with an * with an | explanation. You pass the initial screen and anyone hiring an | "expert C++ programmer" who won't understand that caveat you | gave just there is probably someone you don't want to work for | anyhow.... | [deleted] | bob1029 wrote: | I wouldn't hesitate to place "Expert" on your resume if you | feel you are exceedingly competent in many, but not all, areas. | | No one should be expected to have rote memorization of all | language, compiler and platform features. That is just a | ridiculous standard (and I know many organizations interview | against it regardless). But, if you are a true master of your | craft, it should only take you a day or 2 to ramp up on one of | the more esoteric areas of your skillset. A master can quickly | swap hats, assuming they are all more-or-less the same brand. | This is a point I would try to drive home during an interview | if you feel the perception is slipping. "I haven't dabbled in | [XYZ framework feature] lately, but I could probably pick it | back up in a few days." If I were running the interview, that's | all I'd need to hear to put my mind at ease. | quadrifoliate wrote: | I wonder how much this over-modest attitude of us continual | learners is turning hiring into a market for lemons. That is, | you are an "intermediate", but the overconfident person who's | been doing C++ for two years and is touting themselves as an | expert gets hired instead and you get to fix their disasters | five years later. | | And I bet this affects women and other minorities in tech | disproportionately. | aidenn0 wrote: | I don't remember which talk it was, but it was comparing an | okay dev to a good dev; There was a slide where the "okay" dev | rated their C++ knowledge as a 8 or 9, the "good" dev rating it | as a 5 or a 6 and Bjarne Stroustrup rating it as a 7. | | [edit] | | Some googling later: | https://www.slideshare.net/olvemaudal/deep-c/255 | phaemon wrote: | "The object does not know about it's functions" | | That should be "its". Still, that's one way to force a fact | into my brain... | stephen82 wrote: | The best thing that could have happened to you is to get | interviewed in C (!!!) when then position is supposedly for | C++, and eventually you learned from people that worked for | that company, that they just wanted a WordPress webmaster LOL! | | I'm not kidding, this is what happened to me 4 years ago. | | Don't worry about your intermediate level. | | For sure I can honestly say that I am more than honored to have | a 'PhD' in C++'s "hello world" :D | | It's a language that I would love to work on exclusively for | the rest of my life, if I could get hired much like those | stories we read about back in the early '90s. | | They were hiring pretty much anyone who had an interest in | computing, even if they were working on something completely | unrelated to technology, and they were willing to train them. | | The fun times... | LeifCarrotson wrote: | That sounds like a disaster employment situation for someone | who actually wants to develop a career in C++. In what way is | that a win? | samatman wrote: | It sometimes happens that any steady paycheck is a win. | | Hope it never happens to you! But yes, it can happen. | BubRoss wrote: | I don't think how you rate yourself should be based on the | percentage of features and caveats that you know, it should be | more based on how effective you are using it. | viraptor wrote: | My story for discovering that skill is not a single metric was | trying describe my c# some time ago, which I learned from a | completely different side than most people: | | - I've done heavily multithreaded network server running on | mono/Linux | | - I've implemented faster virtual method dispatch for a custom | CIL compiler | | - I've never touched popular .NET frameworks or GUI apps | | Do I know lots about c#? yes. Would I pass a c# test for an | average job? there's a good chance I wouldn't because I don't | know "that thing everyone else uses". | | I started listing languages in the "what did I achieve in that | job" section rather than separate list. | dominotw wrote: | I learnt clojure _the language_ in a couple of hours. | | Ofcourse, I am still learning the library and how to do things | better in a functional way. But I was good to go with the | language in a couple of hours. | ithrow wrote: | Me too, but I had already done SICP(scheme), without that I | guess it would have take me much longer. Your background | matters. | sdegutis wrote: | And by writing Clojure, you lose a lot of type safety and | compile-time efficiency. Not that that's a bad thing, just | pointing out that there's a trade-off that it makes in favor | of a simpler language to learn and implement. There's also | the matter of it being more verbose to represent certain | concepts in Clojure due to lack of syntax, but that's harder | to argue. | dominotw wrote: | > just pointing out that there's a trade-off that it makes | in favor of a simpler language to learn and implement. | | I am not sure thats a tradeoff, ruby and python didn't gain | anything in terms 'lack of syntax' by trading off 'type | safety and compile-time efficiency.' | ohazi wrote: | There's the now famous anecdote that even Stroustrup rates | himself a 7/10 at C++ proficiency. | | I've also worked on a handful of largeish (10k - 100k line) C++ | projects both pre and post C++11, and also consider my C++ | proficiency intermediate, even though I'm comfortable with the | language and know how to fill in the gaps when I need to figure | out something new, which now happens every 3 years. | | The language is enormous and complicated, and most people will | forget how some of the rarer intricacies work if they don't use | them frequently. And since most features are very useful in a | few situations, but are not widely useful enough to change | daily programming habits, this is basically guaranteed. | | The language is so big that intermediate is probably just the | top of the scale now. | | Rust isn't _that_ big yet (although it is getting more | complex), but many more of the concepts in Rust are somewhat | unique to the language, so you 're not just learning new | syntax. I think the "always intermediate / always still | learning" feeling happens earlier with Rust than with C++ | because of this. | tus88 wrote: | It's like C++ - no-one can ever know it all. | brundolf wrote: | I used to put every technology I had any experience with on my | resume. | | Then I started only listing the ones I knew the best. | | Now what I do is treat the list as aspirational. "Here are the | technologies that I'd like to work with (and which I'm familiar | enough with that I could figure the rest out on a job)." I try to | paint a story with those technologies: this combination of | technologies draws an outline around the type of work I want to | be doing. | | I did this recently with Rust on the list even though I've only | done a couple of personal projects with it, and the presence of | it specifically made me stand out to a company that I'll soon be | starting a position at! They use Rust and are sort of a dream job | in a couple other ways too. They said the presence of that | language spoke to the personality of the developer, and the kind | of things he was likely interested in. | | Takeaways: don't undersell yourself, and tell a coherent story. | sjtindell wrote: | That's tough because often I've had coworkers who give their | thumbs up or thumbs down based on "he had it on his resume and | I asked him basic question X and he had no idea, terrible". | brundolf wrote: | You should be able to answer the basic questions, but you | shouldn't need years of professional experience with | something to feel like you can list it without a "learning " | prefix | pselbert wrote: | During the coding exercise portion of an interview I let them | choose any language they like. The exercise is exceptionally | simple and doesn't push the boundaries of their language | knowledge at all. | | If somebody can't do the exercise in their language of choice | I have doubts about their competency in general. That seems | different than asking arbitrary questions about specific | language constructs. | goostavos wrote: | "He used a for loop instead of a list comprehension. he | clearly isn't actually a Python programmer" -- actual debrief | comments :| | saagarjha wrote: | Everyone knew PEP 20 was feel-good baloney anyways. It just | took the Python programmers a bit longer to come around. | koyote wrote: | I flunked an interview in a similar manner several years | ago. | | Hadn't done Java in around half a decade but the company | recruiter said that it's not an issue (they contacted me). | | Then I got a 30-minute online coding test that I had to do | in Java. Took me a while to remember the syntax but | finished the required problem in time and without | issues/bugs. | | In the end I got dinged for not using the Java Arrays | library for copying an array (used a manual for loop)... | brundolf wrote: | Personally I wouldn't want to work at a company like that | ryuukk_ wrote: | excuses ___________________________________________________________________ (page generated 2020-03-12 23:00 UTC)