Live data from Hacker News

Welcome to Comprehensive Rust

google.github.io

171–180 of 204 posts

Re: Welcome to Comprehensive Rust

#171
post #148

Earlier quoted context omitted.

Rust doesn’t though. But it does make it much harder to leak memory than C. You need to create a cycle between reference counted objects versus just forget to free something. Not that it matters as much as people think. Memory leaks aren’t a correctness problem. You typically want to restart a program or service regularly anyway to deal with memory fragmentation. You also frequently have a watchdog like systemd to re…

Interesting view that memory leaks aren't correctness problems. But I would require more convincing to agree. It's true that memory leaks can be small enough that they don't become problems in the end-to-end behaviour of the system in regular use. But a lot of bugs are like that. For example many memory safety bugs.

Sorry, I should have said they’re not safety problems. The commenters below got it right.

Memory safety bugs are very different, because whether or not they affect the functioning of your software, they’re a ticking time bombs that could compromise your system. A memory leak will at worst crash your software.

Re: Welcome to Comprehensive Rust

#172

Earlier quoted context omitted.

Hi, I wrote the course :-) Yes, this is a real thing — Android has had support for Rust in the Android Platform for a few years now. Most recently, we shipped support for DNS-over-HTTP/3: https://security.googleblog.com/2022/07/dns-over-http3-in-an... We put out the course to make it easy for even more people to onboard with Rust.

Rust does not guarantee that there are no memory leaks, you can have things reference eachother and therefore never count to 0. This is why weak pointers exist in rust.

[deleted]

Re: Welcome to Comprehensive Rust

#173
post #86

I still play with Rust (and Zig), but I have decided to put my work efforts into SPARK[1], the subset of Ada, for high-integrity software and formal verification. I know AdaCore and Ferrous Systems are collaborating in trying to bring a lot of Ada/Spark's capabilities to Rust, but this is still going to be some time. Ada has a longer legacy in this game. I am working on safety critical control systems and there is a…

People have picked stranger things than julia for safety critical control systems. I know people have generated it from simulink and have used labview, and it wouldn't surprise me if somewhere someone is using an excel macro to control the pressure system on a boiler... The world is a scary place. Reading theough the spark tutorials and examples seems fairly similar to the rustlings excercise. I find the ways spark p…

SPARK is expressive and it has a formal specification from the get go that makes it easier to stay within the requirements and provides automatic verification. GNAT tools are pretty cool. I don't think Rust has much of this other than its specification. It has momentum and a great community, so I think either way it will succeed in many endeavors. Like Erlang for distributed computing, I think SPARK has carved out and earned its niche, and Rust will not soon take over this domain.

For me, Rust seems too complicated at this point. I will continue to play and watch it. I use the Helix Editor, which I love, and it is written in Rust!

Re: Welcome to Comprehensive Rust

#174
post #89

Earlier quoted context omitted.

It is not rapidly and widely accepted. It is pushed by a small but very vocal minority for all the wrong reasons. When you have to prove your intelligence level (or rather "street cred") in a competitive market you have to show that you can learn the newest complicated things quickly. Rust is pure cryptonite in such a world.

> It is not rapidly and widely accepted. It has been adopted by most large tech companies and several high profile open source projects within ~5 years of it's stable release. It certainly has been rapidly and widely accepted. For important projects too: Google is using it in Android, Microsoft is using it in Windows, Amazon is using it for Lambda, Meta is using it for their source control tool, Dropbox is using for…

And linux itself is in the process of adding support in the kernel.

Re: Welcome to Comprehensive Rust

#175
post #39

It's kind of surprising to see that Rust is so rapidly accepted by wide range of developers. Unfortunately I'm from DataScience field, so I cannot see much motivation to learn Rust, but I am considering learning it, because language itself seems exciting! Is there anyone on HN who is from DataScience field like me and has learned Rust? It would be much appreciated if you could share the experience.

I did. It's a very fun language to learn. If you're comfortable with the simplicity of Python, Rust would be too verbose. I'm personally fine and actually like Rust more. With the current adoption pace it should be competing with Python in the Data Science field soon.

Re: Welcome to Comprehensive Rust

#176
post #108

Earlier quoted context omitted.

We developers love so much to learn computer stuff that we want to do it even when we don't need to. I worked on data science, computational science, some system engineering and embedded projects. I tried Rust on all of them but it was valuable only for the third. In data science the focus is more on speed of development and as much as Rust is more enjoyable to use than C++, it doesn't match scripting languages (name…

Rust still needs to do a lot of catching up in HPC, HFT, GUI, game engines, console SDKs, OS drivers on Apple and Microsoft OSes, Arduino, LLVM and GCC,... Rust threading is only safe between threads accessing data structures in process own memory. It does nothing for shared resources using OS IPC, or external resources shared among threads. It will certainly improve, as hopefully C++ will, even it never gets 100% as…

I feel like this was true a few years ago but things have changed a lot recently.

In my opinion Bevy may be one of the better ECS implementations I've seen, as ex-gamedev it's just very well thought through. It's never going to supplant Unity or Unreal but that's less of a language issue than just the scope of those codebases.

You're seeing a lot more of it showing up in OSes across Android, Linux and I've seen a fair bit of movement in the windows space as well.

As for IPC, C/C++ doesn't help you their either, that's more of a framework level concern. If anything the threading model helps when you're doing concurrent IPC dispatch(ex: MTA COM or equivalent high throughput IPC) and preventing data races.

Re: Welcome to Comprehensive Rust

#177
post #86

I still play with Rust (and Zig), but I have decided to put my work efforts into SPARK[1], the subset of Ada, for high-integrity software and formal verification. I know AdaCore and Ferrous Systems are collaborating in trying to bring a lot of Ada/Spark's capabilities to Rust, but this is still going to be some time. Ada has a longer legacy in this game. I am working on safety critical control systems and there is a…

> I found Julia's selection for a flight collision avoidance system perplexing

From [3]:

> Julia is [...] executable

Indeed, that's a useful feature for a programming language :)

Re: Welcome to Comprehensive Rust

#178

The first thing I implore everyone to do when evaluating Rust is to check out a non trivial project and start hacking on it. I have always found the compiler to be unacceptably slow in these cases, especially if you come from C rather than C++. If you work your way up from Hello World you may not ever notice this until you already invested a substantial amount of effort.

I class Bevy as a “non trivial” project. It's also an example of how to immediately set new Rust devs up with better system performance to reduce the problem you mention where compilation becomes a bottleneck as a project grows. https://bevyengine.org/learn/book/getting-started/setup/ The early setup docs offer ways to improve compile speeds. Some help all Rust projects (change your linker) and others are specific to…

Yeah Bevy does a fantastic job here(which given the focus on iteration time for gamedev makes sense).

With the dynamic link feature it takes about 1s to compile + link and Bevy is very much a nontrivial runtime/library that makes use of lots of Rust features.

Re: Welcome to Comprehensive Rust

#179
post #164
post #157

Earlier quoted context omitted.

> Rust threading is only safe between threads accessing data structures in process own memory. "Only". Intra-process shared memory is by far the most important kind of shared memory. 80% of the time you see someone advocating for message-passing multi-process over shared memory multi-thread concurrency or parallelism, it's because shared mutable memory is incredibly hard to get right in just about every mainstream la…

Not in the age of microservices. Language constructs only help if there are no other applications accessing the same resources.

> Not in the age of microservices.

There's a huge world outside of microservices.

> Language constructs only help if there are no other applications accessing the same resources.

You're mistaken. Rust's language constructs can often help you write safe wrappers around inter-process communication and synchronization mechanisms. Of course, all bets are off if the other processes don't adhere to the agreed-upon IPC protocol, but that's not the point. The point is that Rust makes it easier to not accidentally screw up the protocol yourself.

Post reply on HN