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

I like how this is structured. When I read that inline types get copied-on-borrow I was pretty put off. Then since fields of inline types can't be assigned new values it seems a bit better, as long as you roughly know what's happening. Hopefully the diagnostics are good enough there. I like the detailed alternatives that weren't chosen.

I appreciate being able to choose which side of the tradeoff (always-copy or heap allocated) you want to be on, but either way be assured it's safe. Not sure how I feel about it in practice without trying it, though :)



On the diagnostics side of things, the compiler produces these in two places:

1. If you try to define a `mut` field (= one you can normally assign a new value), it will produce an error at the definition site

2. If you try to do something like `some_inline_value.field = value` it also produces an error at the call/assignment site

The actual messages could use some improvements, but that's not a super high priority for the time being as I'm more focusing on the language overall.




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

Search: