Rustc-dev-guide: Explain what interning means

Created on 7 Aug 2019  路  9Comments  路  Source: rust-lang/rustc-dev-guide

At the bottom of https://rust-lang.github.io/rustc-guide/the-parser.html, the phrase "interns identifiers" is used. But to me, its meaning wasn't clear on first read-through. I checked in Zulip::/t-compiler/help and got back : "It means that you are not creating a heap allocation for an identifier every time, but instead have a global table where they are stored and deduplicated. You then just need to store the index into the global table whenever you have an identifier" from @oli (oliobk?). It would be helpful to have this explained early on (and maybe a link back to the definition in later uses?)

Easy help wanted

All 9 comments

I think it would be great to have this explained, perhaps starting with what @oli-obk has mentioned would be great.

@eddyb explained quite a bit of it here: https://github.com/feroldi/oxide/issues/1#issuecomment-523002973

@eddyb explanation is great. I think we have more than enough stuff to document now. @Nashenas88 would you like and are able to provide a PR for this?.

Do you think we should leave this for anyone new to rustc dev? I feel like it'd be a great introductory issue for someone to work on.

@Nashenas88 as you wish :)

I would actually prefer for us to just so this, add it is a common question

We also have some discussion in the upcoming #530 ... I think we should move all of these into a chapter about interning and arenas...

@mark-i-m agreed, let's wait for Niko review, merge #530 and then maybe start moving some things around.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikomatsakis picture nikomatsakis  路  8Comments

spastorino picture spastorino  路  5Comments

vext01 picture vext01  路  7Comments

mark-i-m picture mark-i-m  路  8Comments

spastorino picture spastorino  路  6Comments