Live data from Hacker News

Rust – What made it “click” for me (Ownership and memory internals)

deavid.wordpress.com

51–60 of 76 posts

Re: Rust – What made it “click” for me (Ownership and memory internals)

#52
post #41

Ownership is a time-wasting idea; an object should be freely able to go anywhere in the program you need it to go without any concerns.

Problem is, it can't go where you need it to go without any concerns. There are problems doing that whether you ignore them or not. I should be able to plug whatever I want into an electrical socket and not have to worry about whether it'll start a fire, but I can't.

This is a solved problem. There are situations when the solutions don't work, but they are subject to the 90/10 rule. Or 99/1 or whatever is applicable.

There are almost no application domains in which you need to conform to some insane borrowing protocol for the entire software.

Your analogy is stupid beyond belief; and terms of the safety of the circuit itself that is behind the outlet, yes I can plug in anything without worrying there will be a fire in the wall. I live in the first world, where we have electrical codes and circuit breakers.

Re: Rust – What made it “click” for me (Ownership and memory internals)

#53

Personally, I'd recommend learning C to learn about the basics of memory management in higher level languages in general. It is simpler than Rust and is very transparent, making it easier to grok the concepts before moving on to something like the borrow checker, further more, it will actually make the motivations for the borrow checker and what it does to help clear. Same goes for other memory management solutions,…

This is the path I took, and recommend. The borrow checker and Rust's restrictions are easier to understand once you have experienced doing it manually. And the basics of C89 don't take that long to learn!

Re: Rust – What made it “click” for me (Ownership and memory internals)

#54

Ownership is a time-wasting idea; an object should be freely able to go anywhere in the program you need it to go without any concerns.

Why do you think Rust has been such a success?

Rust has an obvious audience: programmers who have somehow been lulled into accepting an insane language and language features: namely C++ people.

You basically just have to readjust their blinders.

Re: Rust – What made it “click” for me (Ownership and memory internals)

#55
post #44

Earlier quoted context omitted.

I started learning some Rust, just begging of this yeae, and I am starting to think learning C might be the shortest path to fully understand the motivation of ownership model. But at the same time, I don't want to invest so much time into learning a language which I probably am not going to use. I am probably being disrespectful. I understand a lot of people use C, including Linux kernel devs, but I cannot imagine d…

Not wanting to invest time makes sense, but I think you'll definitely get return on investment by learning C. It's doesn't end with rust. Learning C's approach to memory will give you a much better understanding of pretty much all object oriented and imperative languages and give you a better understanding about how memory might be used under the hood in higher level languages in general. It won't take you too long e…

Yeah, haste makes waste. I will give it a shot! Thanks for the tips!

Re: Rust – What made it “click” for me (Ownership and memory internals)

#57
post #20
post #9

Earlier quoted context omitted.

> not everybody comes with a CS background. Something doesn't sit quite right with me to describe the "basics of hardware" as being something that comes with a "CS background". I come from a formal CS background, and we spent more time dealing with finite state automatons, programming language theory, and other aspects of abstract computation. Getting down and dirty with data sizes, system components, and bit fiddlin…

I have a funny relationship with this. I also come from a formal CS background too. The old joke is that there are two lies in Computer Science: firstly its not science, and secondly it isn't really about computers. But the reality is, I still can't tell you what Computer Science actually is. Is it: - About understanding how to control computers (which are fast electronic machines) - About inventing programming, from…

Computer Science is not about learning to make software, although it is usually a byproduct, as strong understanding of fundamental allows you to design software correctly from the first principle. Programming; however, is usually done through training at work.

Computer Science is about understanding what computation can and cannot achieve, and more importantly, how to achieve it (that is where it differs from Mathematics, where mathematicians are usually not interested in the how part). Under this definition, we can put typical college subjects into consideration:

* Data Structures and Algorithms: about studying how to manipulate data to solve a task efficiently.

* Complexity Theory: about formal classification of hardness of problems. What makes a computational problem "hard" or "easy"?

* Computer System: about how to construct a software system to achieve certain purposes. What are the constraints in a system (performance, security, privacy, correctness, fault tolerance, etc), and how to design a system to address such constraints? What tradeoffs to be made when you cannot meet all the desired requirements?

* Distributed System: how to design system with a few to massive number of computers that are connected in a network? How do you reason about fault tolerance, consistency, sharding, and so on?

* Operating System: about how to create abstraction to the hardware, that allows for other softwares to interact with it without having to explicitly deal with the hardware?

The list could go on, but I just give a couple of examples.

Re: Rust – What made it “click” for me (Ownership and memory internals)

#59
post #44

Personally, I'd recommend learning C to learn about the basics of memory management in higher level languages in general. It is simpler than Rust and is very transparent, making it easier to grok the concepts before moving on to something like the borrow checker, further more, it will actually make the motivations for the borrow checker and what it does to help clear. Same goes for other memory management solutions,…

I started learning some Rust, just begging of this yeae, and I am starting to think learning C might be the shortest path to fully understand the motivation of ownership model. But at the same time, I don't want to invest so much time into learning a language which I probably am not going to use. I am probably being disrespectful. I understand a lot of people use C, including Linux kernel devs, but I cannot imagine d…

Are you not interested in contributing to existing projects like Postgres, CPython... or being able to use the many libraries with C APIs?

Re: Rust – What made it “click” for me (Ownership and memory internals)

#60
post #21

Earlier quoted context omitted.

Big tech companies do use many languages. Sometimes smaller one as well. I deal directly with at least 5 at the moment. C++ is in this set but no Rust so far as I do not have business case for it. But do some reading to be aware.

What other recent language is used by all large tech companies.

>"What other recent language is used by all large tech companies."

What on earth constitutes "recent" language and where did you se me mentioning "resent"? Anyways, does C++17 qualify? What about PHP8, ECMAScript of latter editions, newer versions of C#, Java etc. etc. ?

If I understand your thinking correct let me help you with your question: what native high performance language with no GC, memory / lifetime management and with the stable release after 2015 is used by all large tech companies. Nice try.

Also what FAANGs do with their choice of tech is their own worries. They have needs that will never be encountered by majority of the rest of the world's programming.

Post reply on HN