Earlier quoted context omitted.
> Enumerations - those are integers not enumerations. In Golang they have a type Bool which is either true or false. Can I define my own type using the same convention in GoLang? No. I can't. Ideally I want the ability to do this: type Bool = Enum { True False } or type Tri = Enum { True False QuantumTrueFalseDuality } But in Golang I'm locked in with what the creators provided as primitive types. I can't go deeper.…
Those above are not integers but type that you have to explicitly cast integers to if you really want. Please don't make uninformed comments.
My favorite Rust function
181–190 of 197 posts
Re: My favorite Rust function
#182Earlier quoted context omitted.
In my anecdotal experience, the type of programmers that evangelize and talk shit about programming languages tend to be on the less informed side of the knowledge spectrum.
I occasionally program Go because it has an amazing amount of libraries - I basically use it for random microservice type things that glue systems together. (Most recently, an HTTP login endpoint that sends and receives XMPP messages to authenticate the user.) I don't like it. I program Rust the rest of the time. I'm considering learning Perl5 so that at least my type system lets me do vaguely expressive things - I'm…
Re: My favorite Rust function
#183Earlier quoted context omitted.
> > or making the language unacceptably crippled like Go > ... if the only takeaway from Go for you is that it is “unacceptably crippled” then I feel you have missed a lot of insight. Perhaps the author used a poor choice of words and instead could have phrased their intent along the lines of: Go lacks the semantic density needed to express solutions in both a concise and consistent manner. Were this the case, it wou…
> Go lacks the semantic density needed to express solutions in both a concise and consistent manner. That is a difficult statement for a Go user to parse. It is referring to a lack of language features that result in verbosity or boilerplate?
Re: My favorite Rust function
#184Earlier quoted context omitted.
> > or making the language unacceptably crippled like Go > ... if the only takeaway from Go for you is that it is “unacceptably crippled” then I feel you have missed a lot of insight. Perhaps the author used a poor choice of words and instead could have phrased their intent along the lines of: Go lacks the semantic density needed to express solutions in both a concise and consistent manner. Were this the case, it wou…
I think it's a syntax problem. ASCII doesn't have enough bracket characters to simply & clearly represent necessary language features. So it's harder for an intelligent human to sort and categorize these aspects. Pre-generics Java is about the appropriate amount of language complexity for our current lingua franca
Re: My favorite Rust function
#185Earlier quoted context omitted.
It is perfect fine to take by value something that is not Copy to transfer its ownership. It is a compiler error to use the value after it was moved. And the compiler error is quite explicit about how to solve it For example you can explicitly clone let y = add(x.clone()); let z = add(x);
What would be cases where the add() function need ownership of the x? What the chance in real life that a function like that cannot simply use a reference? In my learning Rust, my life became significantly better and easier when I started to references to borrow as much as possible.
Re: My favorite Rust function
#186Earlier quoted context omitted.
NLL does not change those semantics; drop still runs at the end of the scope. It counts as a "use" for the purposes of NLL and thus keeps values with destructors alive.
For some history, it was talked about changing this, but we couldn’t, due to back compatibility and it wasn’t clear it was actually a good idea. This was called “wary drop”.
Re: My favorite Rust function
#187Earlier quoted context omitted.
What would be cases where the add() function need ownership of the x? What the chance in real life that a function like that cannot simply use a reference? In my learning Rust, my life became significantly better and easier when I started to references to borrow as much as possible.
That was just an example. But maybe 'x' is a BigInt type that use a memory allocation to store its contents. The ownership would be transferred to the return value
Not rethorical, I'm genuinely curious as I used to struggle with the copy vs move decisions, and a bunch of issues with ownership which went all away when I started using pointer/borrowing everywhere.
Re: My favorite Rust function
#188Earlier quoted context omitted.
I think it's a syntax problem. ASCII doesn't have enough bracket characters to simply & clearly represent necessary language features. So it's harder for an intelligent human to sort and categorize these aspects. Pre-generics Java is about the appropriate amount of language complexity for our current lingua franca
I will gladly trade a little bit more language complexity if it means the complexity of the code that I write using that language is simpler.
Re: My favorite Rust function
#189Earlier quoted context omitted.
I occasionally program Go because it has an amazing amount of libraries - I basically use it for random microservice type things that glue systems together. (Most recently, an HTTP login endpoint that sends and receives XMPP messages to authenticate the user.) I don't like it. I program Rust the rest of the time. I'm considering learning Perl5 so that at least my type system lets me do vaguely expressive things - I'm…
"unacceptably crippled" is a pejorative meant to insult, not a descriptive criticism.
Re: My favorite Rust function
#190> or making the language unacceptably crippled like Go Gotta say, I lost a lot of respect for the author at this point. It’s not like I don’t love Rust - quite the contrary - but if the only takeaway from Go for you is that it is “unacceptably crippled” then I feel you have missed a lot of insight. Go has been one of my languages of choice for over half a decade now, and for good reason.
It may be an unnecessary dig, but the author may indeed be familiar with Go and still think it's unacceptably crippled for all their use cases. The whole post is just their opinion.
Hey @dang -- why do you and Hacker News think it's ok to make comments at the expense of the differently-abled, and when I call you on it, the post gets flagged? That's NOT OK.