Re: The Case for Rust (in the base system)
- Reply: lain.: "Re: Re: The Case for Rust (in the base system)"
- In reply to: Alan Somers : "Re: The Case for Rust (in the base system)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 21 Jan 2024 17:29:12 UTC
On 1/21/24 08:04, Alan Somers wrote: > * Why Rust instead of Perl, Java, C#, or Go? I have more interesting questions: - What are we going to do when Mojo comes out? It is a compiled superset of python that will have a better borrow checker and is going to be suitable for low-level systems development? Chris Lattner - they guy who wrote LLVM is building it, and he says Rust's approach is not the best. There will be a new hype wave. Productivity gains from mojo *will* outshine Rust. [1] - Are we going to add python/mojo to the codebase? - Are we going to remove Rust? - It is not about Rust per-se. How many more languages can we add to the src before it becomes an unmaintainable mess? - What is our vision and policy about languages in src? [1] https://docs.modular.com/mojo/ > * Why not just use C++ then? > > Speaking from experience, I'm far more productive in Rust than C++ Same. But I'm afraid personal productivity comes at a cost of decreasing our collective productivity. Shifting mental gears from C to Rust is hard. It is much easier to shift from C to C++ (a reasonable subset thereof). Also - have we tried using C++ as if it is C? Read what PHK writes. We don't have to use all C++ features. We don't have to learn all of C++. I have a working prototype of C++23 codebase where I write C++ as C but with - methods on structs - namespaces - modules (C++20) No STL, no templates, none of the C++ insanity. This just makes a better C. Yes, I know that defining and maintaining a "sane" C++ subset is not trivial, but it seems to be like a much better way to evolve src. > * Rust will go out of fashion by the 2040s Yes, it is only the first systems language that has borrow checker and no GC. Mojo is coming. There will be more.. ... BTW, Someone mentioned Zig and I want to develop this idea further. Zig in base is actually not a crazy idea at all! I am currently playing with Zig and ZIg is great. - It mixes with C much better than Rust. - It can be bootstrapped from vanilla LLVM. - It has conservative mindset - much closer to C and Go rather than C++ and Rust. - Productivity gains are as great as in Rust, or bigger. - Zig foundation has not been (yet) overrun by corporate overlords. > [1] Yes I know about Modula-3, D, etc. But for various reasons those > never gained traction. > [2] Dumb pointers exist too, but they're almost never used except when > binding to a C library. > [3] https://github.com/lpabon/cmockery2/blob/master/doc/usage.md > [4] https://docs.rs/mockall/latest/mockall/ > -- Ihor Antonov