Hacker News new | past | comments | ask | show | jobs | submit login

I sincerely wished that Rust had the simplicity of Go, but its syntax just makes me dyslexic.

The nice system programming point would be (imho) clear syntax and safety check mechanics, like the borrow checker.




I think the same exact thing (and considered commenting on it as well, but I feel like I bring rust into everything lately). It's one of my biggest regrets, but at present it just doesn't seem possible to have the benefits rust has without the additional syntactic complexity. Hard to compete with a language that doesn't even have generics (and convinced everyone that was OK, whether it is or not) on the simplicity front. Go 2 is considering generics though so we'll see how that goes.

Things get even worse when you consider that there's already some lifetime elision happening in the general case, so if you were to write some form of "completely specified" rust things would be even worse.

Rust's borrow checker is a game changer, and it's benefit outweighs the lack of clear syntax (it's not worse than C++, or Perl at the very least). Then again, rust doesn't really compete with Go -- it can but I think that's more to do with how awesome rust is. There's currently some efforts to create an opt-in garbage collector called Shifgrethor[0] -- I wonder if programs made to run in that could be run in a syntactically stripped down version of rust that would make it amenable to scripting and golang-like usage. Given rust's macro system (which would be a crazy way to implement this imaginary functionality instead of a compiler plugin), this seems possible...

I'm already just a tad bit over Go for personal use (though it's still in my top 5), and often reach for rust because:

- I've paid the cost to somewhat understand the borrow checker (and I could see it as valuable)

- rust ecosystem is getting pretty big these days (lots of libs)

- community is great (for now, I actually think it is inevitable for it to degrade over time)

- generics when I need them, traits are fantastic (basically they're almost just like haskell typeclasses)

- rust can go from embedded systems (xMhz) to browser (via wasm), if I'm good at it I can almost literally do anything. It's got the macro support to make different domains easier (so embedded vs browser contexts can feel different if basic rust wasn't good enough)

I'm sold on Rust, but I don't think it has a chance to replace Java -- it's probably going to replace C/C++ though, but that will take longer because that world moves slower anyway.

[0] https://boats.gitlab.io/blog/post/shifgrethor-iv/


I've been using rust for a few weeks and I'm finding it fairly pleasant overall, but I agree on the syntax issues. I've hit some snags (in particular, graphs, but this is a common snag on constrained languages, Haskell has trouble with them too) but overall nothing serious and I'm not afraid to go down to unsafe.

I think they made a mistake using C++ style generic notation. D lang has a much, much nicer syntax for generics, and the language's readability would much improved with that syntax imo. As is, I find parsing the error messages that come back from type mismatches quite challenging. Reading documentation on traits on docs.rs, I find the actual trait name very hard to pick out in the noise. Maybe I'll get better with that over time.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: