News for hackers. Stuff that matters.

UtherII

Re:Resistance to Rust abstractions for DMA mapping on Wednesday February 05, 2025 @02:18AM (#42945030)
That's exactly the point. The patch in question is not to be used in any part of the kernel. It is a wrapper around the C API. It has no impact on current code and it will only be used by Rust drivers using DMA, the people of Rust for Linux were clear about it.

Duplicating this wrapper in every driver would just make painful the usage of DMA for Rust drivers for not benefit.

Re:Fast memory vulnerabilities, written in 100% safe Rust on Wednesday February 21, 2024 @01:07PM (#39457260)
The concept of safety is pretty different in a kernel and in a programming language. The kernel can be attacked directly with malicious calls, while it's the program created by the rust compiler that can be attacked (unless you envision Rust as a sandboxing technology, what it is absolutely not).

The safety in a programming language is mostly protecting the programmer against itself. The probability for a programmer to write this kind of code by mistake is close to zero, as opposed to UB in C or C++ that are pretty common. To make a vulnerable program with this kind of issue, the programmer would have to make them on purpose, what is unlikely unless for this kind of joke repository.

Re:Why is my Rust build so slow? on Friday December 31, 2021 @04:47PM (#29752867)
Have you really used Rust on big codebases? One of the big advantage of Rust is especially that it fails far earlier than C++. Borrow checker error are local error that prevent bad behavior to propagate and cause problem on unexpected part.
Re:Why is my Rust build so slow? on Friday December 31, 2021 @07:17AM (#29747345)
The java slow build time is usually a dependency problem too. On similar complexity, Java is usually as fast or even faster than Rust.
Re:Lapce – Fast and Powerful Code Editor written in Rust on Wednesday December 15, 2021 @01:51AM (#29562872)
It can used as an intermediate language, and since it was the only way to run code on the browser without plugins before WASM, it happened a lot.

But nowadays WASM is much more suitable for the job. JavaScript was designed as a scripting language, not a low level intermediary language.

Re:The Plan for the Rust 2021 Edition on Tuesday May 11, 2021 @06:53PM (#27124638)
You can even go back earlier : MessageFormat is available in Java since 1997.
Re:Linus Torvalds on Rust support in kernel on Friday April 16, 2021 @12:43PM (#26836136)
I not sure he mean never panic at runtime. I think there are good reason to panic at runtime if you care about safety a buffer overflow is a good reason for instance.

But a memory allocation failure is clearly not a good reason.

Re:Linus Torvalds on where Rust will fit into Linux on Wednesday March 24, 2021 @03:46AM (#26564535)
You have to blame both the carpenter and the tools. Since there is no such a thing as a perfect carpenter, mistake will happen, that why a tool that can prevent a whole category of mistakes is a good thing. It's no mistake good carpenter don't use crappy tools. To be the most efficient, you need the good carpenter with the good tools.

Of course you have to care about the problem domain first, but it's absolutely wrong that nobody commit their budget to fix C++ safety problems. There is a massive amount of static and dynamic tooling to mitigate its problems and a substantial part of the C++ evolution these last years was to improve safety. Rust was able to go further than C++ in this area since it is not yet constrained by decades of history.

Re:Rust 1.49.0 on Friday January 01, 2021 @01:01AM (#25601248)
The IDE support use to be very poor but nowadays there are two really nice contenders :

- Jetbrains IDE with the Rust plugin (maintained by Jetbrains itself). The free IntelliJ IDE Community works really well. CLion or IntelliJ Ultimate are necessary for debugging support

- The Rust-analyser tool. A language server that can be used, in theory, on any IDE supporting the LSP protocol. Code is the most used IDE with this tool since it is the reference IDE of the project.

Re:Why Discord is switching from Go to Rust on Wednesday February 05, 2020 @04:34AM (#22245336)
The problem would be to get a definition of idiomatic code.

Would it be fair to accept an optimization on a language and refuse it on another because it is not idiomatic ?

Re:Servo nightly builds on Windows now available on Thursday April 13, 2017 @11:59PM (#14112630)
I'm not so sure. I remember a presentation of Webrender with nice demos : https://www.youtube.com/watch?v=erfnCaeLxSI&spfreload=10

Everything was perfecty smooth, but according to pcwalton the bottleneck was CSS handling.

Re:Servo nightly builds on Windows now available on Thursday April 13, 2017 @12:49PM (#14108674)
A new programming language is not required, it's just a bonus to help developers handling safety and concurrency.
Re:Ask HN: What is the state of C++ vs. Rust? on Friday October 21, 2016 @04:24AM (#12758966)
The most obvious case is bound checking. If you have a code with direct array indexing you have to use unsafe code or loose a little bit of performance.
Re:Ask HN: What is the state of C++ vs. Rust? on Thursday October 20, 2016 @09:31AM (#12751992)
That's why on Linux, by default, Rust link everything statically except the libc. But you sill can make a fully static executable by using the "musl" target.
Re:Why I’m dropping Rust on Monday September 12, 2016 @02:59AM (#12477732)
Yes, the crash can come from every line of code, but the origin of the bug is in the unsafe code. That's why unsafe code has to be cleanly inspected to be sure it has a safe interface, and by reducing the dangerous area to only few lines, it is far easier to do.
Re:Announcing Rust 1.11 on Friday August 19, 2016 @10:31AM (#12320245)
C++ has no advantage over Rust in this regard : C++ and Rust does not have stable ABI. But both can use the C ABI when a stable ABI is needed.