Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.





I'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_pr...

so looks like it's not written in go :-)


> so looks like it's not written in go :-)

That post is three years old, before the rewrite.


I missed that. For the curious:

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!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: