(Heh. It looks like discussing on a Wiki isn't something this team is
used to. Graydon discussed this on irc, you over e-mail. Oh well.)

> Only exported paths need to be here, right?

Right.

> You talk about local defs not
> being stable, but we recompile a crate at a time, so any local use of a
> local def becomes a "pointer".

By local def ids I meant the second number in a def_id pair -- the
things the parser assigns to defs. If they were stable, we could
directly refer to a def_id in another crate, but minor syntactic
changes can change them, so we must use full names.

> Also, these table contains only constant and functions, right? Types are in
> the table you describe afterwards.

No, types are also indexed by name here. The type table maps from ids
to types. This may seem needlessly indirect, but it maps precisely to
the resolve pass being separate from the typecheck/translate passes.

> In order to use the regular system linker, the exported functions and
> constants have to be listed as mangled symbol names. Since we are already
> paying the cost of having a mangled symbol, we can probably use that to find
> the metadata about that symbol. Having our table be indexed by a hash of the
> symbol name for example.

As I understood it, these hashes will also contain type info. The
resolver doesn't know anything beyond a path when it is resolving
something, so we need to have raw paths as keys (I think).
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to