Writing a simple Core evaluator, having trouble with name lookups
Csaba Hruska
csaba.hruska at gmail.com
Fri Nov 30 18:28:07 UTC 2018
I'm aware that unique names are unique in a GHC invocation.
But my statements sill holds.
On Fri, Nov 30, 2018 at 7:20 PM Ben Gamari <ben at well-typed.com> wrote:
> Csaba Hruska <csaba.hruska at gmail.com> writes:
>
> > Hi Ben,
> >
> > I thought that it is possible to rely on unique values *in case of non
> > exported Ids* because they are local to a specific module and can not
> > appear in expressions in other modules because they are not exported.
> > Do I miss something?
> >
> Uniques should be treated as being non-reproducible across compiler
> sessions.
>
> To make this more concrete: if GHC compiles the same module twice it
> will not necessarily assign the same uniques to the module's Names.
> Uniques are derived from local UniqSupplies conjured up at a variety of
> points in the compilation pipeline (search from mkSplitUniqSupply).
>
> These supplies are themselves derived from an impure global counter (see
> compiler/cbits/genSym.c). The state of this counter (and consequently
> the uniques derived from it) should be treated as being entirely
> unpredictable.
>
> Cheers,
>
> - Ben
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20181130/517d5be1/attachment.html>
More information about the ghc-devs
mailing list