News for hackers. Stuff that matters.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by mlyle on Wednesday November 23, 2022 @12:13PM (#33721827)
I'm starting to actually believe that Rust will eat C's lunch for systems programming.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by pjmlp on Wednesday November 23, 2022 @12:19PM (#33721920)
Lets see if it has better luck than C++ on domains that don't care about anything beyond C89, and compiler extensions.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by zppln on Wednesday November 23, 2022 @12:21PM (#33721950)
People have been believing that for close to a decade now.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by mlyle on Wednesday November 23, 2022 @12:22PM (#33721959)
Yup, and it keeps steadily winning a small stream of converts and additional projects from C.

So I didn't believe it before, but it's starting to seem more plausible.

Of course, it'll take a very long time. There's a lot of C code out there. :D

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by zppln on Wednesday November 23, 2022 @12:33PM (#33722104)
Well, I wouldn't mind. Personally I had to start a new C project just the other day. :/
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by dymk on Wednesday November 23, 2022 @12:23PM (#33721975)
And now there’s Rust in the Linux kernel
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by jimbob45 on Wednesday November 23, 2022 @01:11PM (#33722574)
The disparity between Rust jobs and C/C++/C#/Java/Golang jobs on Indeed is staggering. Even worse, most of the Rust jobs are blockchain-related and may not survive the coming blockchain downturn.

It may be the case that some people use Rust but without Rust jobs, there will be no pool of experienced developers to later draw on.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by stackbutterflow on Wednesday November 23, 2022 @02:03PM (#33723240)
Hasn't the downturn already happened?
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by mlyle on Wednesday November 23, 2022 @05:28PM (#33725330)
> The disparity between Rust jobs and C/C++/C#/Java/Golang jobs on Indeed is staggering.

Most of the world are things other than real systems programming. C++/C#/Java/Golang are likely better choices for this than either C or Rust.

But a C-like language is necessary. Rust may be (very slowly) displacing C for systems programming.

As you mention, it takes awhile for the pool of experienced developers to show up.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by umanwizard on Wednesday November 23, 2022 @09:45PM (#33727310)
AFAICT most Rust jobs don’t require previous experience in the language.

Anecdote: My company is a nearly 100% Rust shop and we have never made it a job requirement.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by cyber_kinetist on Wednesday November 23, 2022 @02:29PM (#33723498)
I think there is a space for other alternative low-level languages that aren't that strict about compile-time safety though (Zig, Jai, Odin), that Rust cannot capture.

Many proclaim that compile-time safety using type theory is the only way to create reliable low-level software, but I think it can alternatively be done with good data structure design and various compiler tooling that instead catch these errors at runtime (generational indices/references, Address Sanitizer, and recently Zig's safety mode). We need to explore multiple directions to really solve the memory safety problem, and I don't think Rust is the only way (although it is a viable way, proven by some recent successful applications).

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by throwawaymaths on Wednesday November 23, 2022 @10:34PM (#33727548)
You can even get safety using logic without the compiler. I think resource cleanup responsibility tracking as a static analysis tool is likely to happen with some of these languages. I think zig is a good candidate, once they lock down the intermediate representation.

It's already the case that people are using "logic add-ons" for additional rust static analysis, so one wonders exactly why is it generally speaking that borrow checking itself must occur at the compilation step.

Trivially, one could create an annotation layer on top of zig or c that exactly replicates the rust syntax and performance borrow checking in the same way. It wouldn't be exactly the same because there isn't RAII but you can make correct inferences about what is happening in the body of the functions.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by bsder on Wednesday November 23, 2022 @04:50PM (#33724986)
Rust will not accomplish this without significant language changes as well as changing cargo into something a lot more cooperative with external ecosystems.

Zig is getting an absolutely enormous boost from the fact that it is a self-contained C ecosystem that can cooperate with others. Zig has tripped into a very powerful niche--a lot of people LOATHE the build systems of the C/C++ world. If Zig gains very much more traction there, it's going to be extremely hard to dislodge.

I suspect that there are FAR more users of "Zig as C build system" than there are of "Zig as a language".

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by umanwizard on Wednesday November 23, 2022 @09:47PM (#33727320)
Cargo isn’t part of Rust (the language) and you can use Rust without using Cargo.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by bsder on Thursday November 24, 2022 @12:38AM (#33728088)
And yet cargo-raze still requires cargo and is still experimental after 5+ years of development effort by folks from Google.

It is my fondest hope that the Linux folks will finally beat the cargo out of Rust.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by umanwizard on Thursday November 24, 2022 @12:54AM (#33728162)
> beat the cargo out of Rust

But cargo already isn’t in Rust. There are AFAIK no cargo-specific concepts that have leaked into Rust, the language. It is very straightforward to build Rust code without using cargo, for example with a makefile.

The reason other tools are slow to add support for rust is because cargo is so ubiquitous in the rust ecosystem that there is little point (I’d estimate that >99% of Rust code is built using Cargo), and not because of any technical impossibility.

Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by johnisgood on Wednesday November 23, 2022 @08:18PM (#33726739)
I highly doubt so. Rust is extremely complex and restrictive. For actually critical software, there is Ada/SPARK.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by umanwizard on Wednesday November 23, 2022 @09:42PM (#33727299)
Rust is much easier and less complex than C++, which is very widely used.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by menaerus on Thursday November 24, 2022 @06:39AM (#33730204)
Very doubtful. My impression is that devs coming from non-C++ background are having a hard time to grasp the concepts of Rust.
Re:Porting 58000 lines of D and C++ to jai, Part 0: Why and How by johnisgood on Thursday November 24, 2022 @04:41PM (#33736552)
Maybe, but they are both very complex. Perhaps Rust will eat C++, but not C.