News for hackers. Stuff that matters.
Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by andrewstuart on Wednesday July 12, 2023 @04:40PM (#36701347)
Pointing at C++ as bad doesn’t address my point.

Kernel code should be easily readable and understandable, shouldn’t it?

Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by TypesWillSaveUs on Wednesday July 12, 2023 @04:46PM (#36701427)
You're conflating hard/easy and complex/simple.

Rust is hard/simple. The rules aren't complex. The constructs aren't complex. But it's hard to write because the rules are very restrictive.

Rust is also much easier to read than write (for a reader who understands the rules).

It's optimising for exactly the things you want in systems programming:

Easier to read than the write. Simple rules that are easy to understand but hard to follow, and that produce simple programs.

Compare that to C which is easy/complex. It's much easier to write than to read. It's easy to learn and write but produces code that's very complex. The rules are all by convention instead of part of the type system.

Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by andrewstuart on Wednesday July 12, 2023 @04:50PM (#36701477)
>> for a reader who understands the rules

So you’re saying it’s not a problem to understand if you understand it.

Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by bbatchelder on Wednesday July 12, 2023 @05:07PM (#36701695)
Think of chess.

Its pretty easy to learn the rules. Once you've done that you can watch a game and know roughly what is happening. But its still a hard game to master.

Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by saghm on Wednesday July 12, 2023 @09:33PM (#36704022)
That's pretty out of context. Before that, they say this:

> The rules aren't complex. The constructs aren't complex.

So yes, once you understand it, you understand it, but they also specifically said it's not hard to get to the point of understanding it. If we're going to assume that any out-of-context quote is equivalent to the entirety of the content, I'll just cite you on this one:

> it’s not a problem

Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by onei on Wednesday July 12, 2023 @04:53PM (#36701516)
Hard to learn does not necessarily equate to hard to read. You don't need to learn to work with Rust's borrow checker to understand a bit of code, but figuring out how to change it might take longer.
Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by dist-epoch on Wednesday July 12, 2023 @05:09PM (#36701725)
C has too little abstractions, which means you need more code to express the same things as Rust.

And the number of bugs per line of code is constant, so you will have more bugs in C code than in Rust code simply because you'll have more code.

Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by nsonha on Wednesday July 12, 2023 @07:04PM (#36702854)
> the relatively simple nature of C is what makes it suitable for large scale kernel development

the relatively simple nature of any language whould make it suitable for ANY large scale development

I dont know why you attribute this to kernel development specifically. When you think about kernel development, the uniqe requirement is never "being simple". I would think it has something to do with being closer to bare metal and can do low level instructions performantly.

Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by duped on Wednesday July 12, 2023 @07:51PM (#36703283)
C is not simple. It is small.

> Maybe the answer for more secure kernel code is C with better security analysis tools?

Perhaps like a way of expressing the constraints of a program and automatically checking if portions of a program satisfy those constraints. Aka a type checker.

Re:Windows 11 Insider Preview Build 25905 brings a bit of Ru... by constantcrying on Thursday July 13, 2023 @03:03AM (#36705902)
Type checkers are not enough and there are many constraints they can not check.

>C is not simple. It is small.

C is complex because of undefined/unspecified/implementation defined behaviour. Any language which is used on as wide of a range of platforms will have those issues.