[rust-dev] sub-grammar for range pattern constants?

Gregory Maxwell gmaxwell at gmail.com
Tue Apr 30 10:23:04 PDT 2013


On Tue, Apr 30, 2013 at 10:08 AM, Max Cantor <i at cantor.mx> wrote:
> I know this will be an unpopular opinion, but pure functions would be a
> massive win for Rust, especially if the eventual goal is high performance,
> highly parallelizable (browser rendering engines..) development.

Being able to annotate a function as side-effect free (e.g. via
__attribute__ ((pure)) in GCC) can yield some useful optimizations,
but I expect that LTO largely makes it unnecessary.  The pure
attribute in GCC in C is not checked and can result in bugs, but I
think it's also not widely enough used in C that there is a lot of
practical experience with bugs resulting from the misuse. At times I
know I've wished the annotation were more widely used just because it
would make reasoning about third party code easier:  "does foobar()
have non-trivial side effects???"

I understand that D has checkable pure functions I'm not sure how
useful they've been there. I recall hearing that there were some
gnarly interactions with heap allocation.


More information about the Rust-dev mailing list