-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change "use" to "extern mod" #2082
Comments
We're likely to take the word
|
I've upgraded this to RFC an edited the title. Hope that's ok with the original reporter. |
@graydon: Fine with me :-) |
All those suggestions sound reasonable to me. In particular I would prefer to be able to declare externs outside of native mods (or get rid of native mods completely) |
I do think I would prefer to just get rid of native mods. Perhaps the ABI and whatever options can be associated with the current scope, so a native mod would just be a mod tagged with the requested ABI and filled with externs. |
I like it, although it seems like an extern prototype and an extern declaration are basically overloaded uses of the same keyword. But I guess that's ok. And |
Re: getting rid of naive mods, I thought about this but thought maybe having the symbols scoped to a module is useful since it gives you an item to hang the library name off of. Maybe that doesn't matter as much as I think, though. (also saves you writing extern over and over) |
Could we just have |
@nikomatsakis I like @graydon's suggestion. It seemed like an overloaded use of the word "extern", but if you view the word "extern" as just "uses the C ABI", then I think it makes more sense. To call into rust from C, you need to declare the function as using the C ABI using extern. To call into C from rust, you need to do the same thing. |
@pcwalton I suppose we could do that, yes. In general we haven't any support for item-qualifier blocks yet (eg. Library names on arbitrary modules will probably come to pass as part of #2176, though I am not sure. Lots of interdependencies in this cluster of bugs, sadly. |
Thinking about this more, here's the organization I propose (also in light of @pcwalton's renaming-modules thing required for the rewrite of resolve in #1935, and @brson's suggestion that we squish
That is: we lose the keywords The first step in making this is just to make |
First step on this landed in 697f1e3. (I hope this doesn't wind up too ambiguous when hacking on the compiler. I think losing the extra keywords is the right thing. Hope!) |
+1 for |
I'm also loving the idea of |
Updated title (was "RFC: Change 'crust' to 'extern'") to reflect the work that remains on this bug. |
This works now. Snapshot needed to remove old syntax. |
I think we can call this done, though there's still some cleanup work left and we may yet change |
Hello,
I was recently reading about the 0.2 release of Rust, and it looks really interesting! One thing that bugged me that I wanted to bring up - I'm not a fan of the "crust" keyword. The word "crust" has an intrinsic meaning in English, and my brain insists on reading it incorrectly at first read. I'd like to suggest changing it to "externc", which mimics C's
extern "C"
, and also doesn't have any other intrinsic meaning.Thanks!
The text was updated successfully, but these errors were encountered: