News for hackers. Stuff that matters.
Re:OCaml for the Masses (2011) by lolive on Tuesday November 27, 2018 @11:12AM (#18543541)
As far as i understand, Rust is strongly typed, has generics and no type erasure. I also suppose String is some kind of a primitive type. Could it be possible to make it parametrizable, so we can manipulate a String<FirstName> as a String, but the compiler will never confound it with (for example) String<LastName>.
Re:OCaml for the Masses (2011) by steveklabnik on Tuesday November 27, 2018 @11:55AM (#18543995)
String is a library type, not a primitive type.

You could write your own string parameterized in this way, but it would be incompatible with the standard library String and so you’d need the same conversion steps.

Re:OCaml for the Masses (2011) by lolive on Monday December 03, 2018 @06:34AM (#18587979)
What would happen if the Rust core team decided to parametrize String? Would it work with legacy code? (that creates something like String<?> and consume String<?>).
Re:OCaml for the Masses (2011) by steveklabnik on Monday December 03, 2018 @08:15AM (#18588495)
It cannot be done in a backwards compatible way with today’s language features.