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

Rust looks like a marriage between Java and C. Very interesting.

There's some error on this page. https://rustbyexample.github.io/examples/lifetime/README.htm... The syntax highlight doesn't work. EDIT: And https://rustbyexample.github.io/examples/constants/README.ht... too




> Rust looks like a marriage between Java and C. Very interesting.

Where do you get Java from? It's more of a marriage between C and ML, but it has drawn inspiration from numerous other sources.


Generics mostly, the syntax is the same. Structs with associated methods are a rudimentary form of classes.

I have to say I'm not a programmer nor I've studied Computer Science, more a Script Kiddie, and functional languages are something esoteric that I understand on a very shallow way.


> Generics mostly, the syntax is the same.

That's the syntax for "generics in C-like languages" since C++, FWIW. So at its core, the inspiration there is probably C++ more than it is Java.


Well, you're not wrong--Java's generics and Rust's generics were very influenced by ML's. So really you're seeing the ML influence :)

(Though Rust's generics really borrow more from those of Haskell, since it has more fully-featured typeclasses as opposed to just eqtypes like SML.)





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

Search: