News for hackers. Stuff that matters.
Re:Switching from C++ to Rust by tcmart14 on Tuesday March 14, 2023 @12:40AM (#35147523)
Swift on linux is supposed to be decent server side, but as far as I've heard, not much use outside of that and even limited testimonials on that. The bit I have dabbled in Swift, I really like it. I just wish it grew more out of the Apple ecosystem. It has lots of things I like, but considering I can't exactly take it with me to any system and just run with it is why I have not dived to much into it.
Re:Switching from C++ to Rust by klabb3 on Tuesday March 14, 2023 @01:15AM (#35147681)
Is swift outside of Apple as fully fledged and performant when it comes to concurrency? Last I checked, a lot of the heavy lifting came from GCD (ie the Apple runtime-scheduler)
Re:Switching from C++ to Rust by Volt on Thursday March 16, 2023 @09:35PM (#35191672)
GCD is open source and runs on FreeBSD and Linux.
Re:Switching from C++ to Rust by hiccuphippo on Tuesday March 14, 2023 @08:23AM (#35150327)
Take a look at Zig (but it's not stable yet, may take a couple of years), linux is a first class citizen for it. It has `error!type` unions and `?type` optionals and language constructs to deal with them:

    const number = try parseU64(str, 10); // returns the error
    const number = parseU64(str, 10) catch 13; // default
    // more complex stuff
    if (parseU64(str, 10)) |number| {
        doSomethingWithNumber(number);
    } else |err| switch (err) {
        error.Overflow => {
            // handle overflow...
        },
        // we promise that InvalidChar won't happen (or crash in debug mode if it does)
        error.InvalidChar => unreachable,
    }
Re:Switching from C++ to Rust by tcmart14 on Tuesday March 14, 2023 @03:18PM (#35156966)
I've been checking out Zig over the past week. It is a really nice language and I like so far. Just not spending as much time as I'd like in it since it is still pre-1.0, but I am excited for it's 1.0.