4 ms·
Both I'd say. Rust imposes more constraints on the structure of code than most languages. The borrow checker really likes ownership trees whereas most languages
by IshKebab 10mo ago
Both I'd say. Rust imposes more constraints on the structure of code than most languages. The borrow checker really likes ownership trees whereas most languages allow any ownership graph no matter how spaghetti it is.
As far as I know that's why Microsoft rewrote Typescript in Go instead of Rust.
- wiz21c 10mo agoI've been using rust for several years now and I like the way you explain the essence of the issue: tree instead of spaghetti :-) However: https://www.reddit.com/r/typescript/comments/wbkfsh/which_programming_language_is_typescript_developed/ https://www.reddit.com/r/typescript/comments/wbkfsh/which_pr... so looks like it's not written in go :-)
- IshKebab 10mo ago> so looks like it's not written in go :-) That post is three years old, before the rewrite.
- wiz21c 10mo agoI missed that. For the curious: https://www.reddit.com/r/golang/comments/1j8shzb/microsoft_rewriting_typescript_in_go/ https://www.reddit.com/r/golang/comments/1j8shzb/microsoft_r... When asked why go and not rust, they said: "The existing (javascript) code base makes certain assumptions -- specifically, it assumes that there is automatic garbage collection -- and that pretty much limited our choices. That heavily ruled out Rust. I mean, in Rust you have memory management, but it's not automatic; you can get reference counting or whatever you could, but then, in addition to that, there's the borrow checker and the rather stringent constraints it puts on you around ownership of data structures. In particular, it effectively outlaws cyclic data structures, and all of our data structures are heavily cyclic. " sharp!