LWN.net Logo

Rust-lang

Rust-lang

Posted Apr 5, 2013 12:39 UTC (Fri) by renox (subscriber, #23785)
In reply to: Rust-lang by dgm
Parent article: Mozilla and Samsung building a new browser engine

Yes, in Rust you have to be very cautious about the usage of ';'!
Thankfully as the return type of functions is not inferred but given explicitly in many cases the compiler will be able to complain, not in the example you've given though.

Apparently they don't like 'return', I'm not sure why.. Maybe it's because it's 'big' (they seem to like short keyword)?
In this case, they could have done like SmallTalk use '^' instead of return.

Another weird part is the for: 'for v.each |e| { bar(*e);}', uh?
The languages I know use either for (for e in set { .. }' or each (set.each |e| { .. }) but having both for AND each at the same time??

Also code with named lifetime seems really hard, but I don't think that's a syntax issue, it's just a difficult concept to master.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds