So, maybe add a few features to Zig and we'll have a Rust alternative for many use-cases?
For borrow checker, I still think a combo of static analysis and concurrent GC's could help. Pair a static analyzer, like Infer, with your code that doesn't borrow check. If it says it's safe, you're good to go. If part of it is safe, other parts get ref-counted or a concurrent GC by default until proven safe.
Users get benefits of all safe code in Rust. They can write their own code as fast as with a GC'd language with smaller-than-usual, performance costs. Anything proven safe by static analysis goes faster without the GC. What do you all think?
> So, maybe add a few features to Zig and we'll have a Rust alternative for many use-cases?
Always wondered why can’t there be a new compiler for C itself which addresses its shortcomings? Cyclone tried to do that and it was successful. Rust itself took the same ideas from it.
I'm interested in that. Even a Cyclone update with modern, type systems.
There was a paper that added meta-programming to C partly for program analysis-like purposes. Everyone ignored it when I shared it. Later, I found out one or more of them built Coverity. Another did a C/C++-compatible LISP that output C.
If nothing else, I'd like to see metaprogramming, strong typing with optional dynamic (or type inference), type/linker-safe modules, Rust-like safety, optional GC (concurrent) for productivity, something for concurrency, amenable to static analysis, and outputs normal C (or C++). Much of this might be done with a small set of features.
Note: Modula-3, Myrddin, and Zig are all worth looking at for smallish alternatives to C and C++.
3 comments
[ 3.6 ms ] story [ 18.1 ms ] threadFor borrow checker, I still think a combo of static analysis and concurrent GC's could help. Pair a static analyzer, like Infer, with your code that doesn't borrow check. If it says it's safe, you're good to go. If part of it is safe, other parts get ref-counted or a concurrent GC by default until proven safe.
Users get benefits of all safe code in Rust. They can write their own code as fast as with a GC'd language with smaller-than-usual, performance costs. Anything proven safe by static analysis goes faster without the GC. What do you all think?
Always wondered why can’t there be a new compiler for C itself which addresses its shortcomings? Cyclone tried to do that and it was successful. Rust itself took the same ideas from it.
There was a paper that added meta-programming to C partly for program analysis-like purposes. Everyone ignored it when I shared it. Later, I found out one or more of them built Coverity. Another did a C/C++-compatible LISP that output C.
If nothing else, I'd like to see metaprogramming, strong typing with optional dynamic (or type inference), type/linker-safe modules, Rust-like safety, optional GC (concurrent) for productivity, something for concurrency, amenable to static analysis, and outputs normal C (or C++). Much of this might be done with a small set of features.
Note: Modula-3, Myrddin, and Zig are all worth looking at for smallish alternatives to C and C++.