I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc.
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime The syntax for traits: in my head, "I am writing a struct implementing this trait", not "this trait is also implemented by my struct".
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime redo cargo from scratch, it doesn't work for anyone except upstream developers and it is the reason for 95% of the hate that rust gets. -
@fasterthanlime I think I'd allow anonymous structs/enums. Often I find myself reaching to create an enum field inside a struct and it's annoying having to make a whole separate named declaration for it.
@cyberia @fasterthanlime IIRC this has been an accepted rfc for a long time and nobody has implemented it. Or maybe it was just about unions ?
-
@fasterthanlime redo cargo from scratch, it doesn't work for anyone except upstream developers and it is the reason for 95% of the hate that rust gets.@fasterthanlime another problem is architecture support, which is mostly related to LLVM and not having multiple implementations, so I would fix that there is no proper spec and no alternative compiler.
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime separate ownership semantics syntax from memory layout.
Box<> feels dirty because so much typing, but so much of the time you don't need stuff directly embedded
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime a higher priority on editor experience when considering language designs
(sorry that’s not exactly what you asked, haha - my point being that a programming language is not its spec, it’s also everything that surrounds it, and the spec should be guided by that. IMO, early on, rust focused too much on compiler-in-a-terminal experience and not enough on compiler-in-a-editor. getting better though!)
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime Redeclaring a variable of the same name should be an error.
-
@fasterthanlime a higher priority on editor experience when considering language designs
(sorry that’s not exactly what you asked, haha - my point being that a programming language is not its spec, it’s also everything that surrounds it, and the spec should be guided by that. IMO, early on, rust focused too much on compiler-in-a-terminal experience and not enough on compiler-in-a-editor. getting better though!)
@khyperia no that's valid
-
@fasterthanlime redo cargo from scratch, it doesn't work for anyone except upstream developers and it is the reason for 95% of the hate that rust gets.
@lizzy what properties would the remake have?
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
Relax the restrictions for making traits object-safe (or dyn compatible or whatever). I'm sure there are underlying technical limitations in play, but it'd be nice to have the (easy) option of saying, "Hey, I'm willing to accept some overhead in exchange for some convenience here."
-
@cyberia @fasterthanlime IIRC this has been an accepted rfc for a long time and nobody has implemented it. Or maybe it was just about unions ?
@poliorcetics @cyberia @fasterthanlime
Tuples are anonymous structs. To my knowledge anonymous enums have not been accepted; I agree they would be nice.
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
The things I would fix about Rust are the things I am working on hah.
If I could wave a wand tho I'd probably use it to fix the Iterator and Future traits. Not because they are impossible to fix now, but doing that now will be incredibly tedious work.
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime Proper generator syntax -
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime Marking fields as mutable on a struct, immutable by default -
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime I think I’d just make tokio part of the standard and avoid the async function colouring problem. Then spend time on the compiler to be smart about the actually necessary async inclusion vs compiling to sync
-
@arichtman @yosh This is going to be a very, very, very, very long thread.
-
@fasterthanlime Marking fields as mutable on a struct, immutable by default
@chosunone So you want mutability of fields to be controlled at declaration site and not binding site. What's the... Can you give me a for instance?
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime support a "slow but correct" mode. Rust's tradeoff is "fight the compiler hard, but resulting code is fast and correct". I'd like an option for "less compiler fighting, slower is OK, less correct is not OK". Something like "implicitly wrap all my shit with garbage collection". I'd like Go-level performance with rust-level correctness.
-
I am NOT making a Rust replacement, but — if you could fix one* thing about Rust syntax/semantics/etc. what would you fix?
(*one per reply, multiple replies per household are allowed)
@fasterthanlime lots of syntax sugar for pinned things -
@poliorcetics @cyberia @fasterthanlime
Tuples are anonymous structs. To my knowledge anonymous enums have not been accepted; I agree they would be nice.
@yosh @cyberia @fasterthanlime tuple are a sad replacement for what C allows for example.
Found the rust rfc, 2102