Giter Site home page Giter Site logo

Comments (4)

nad avatar nad commented on September 24, 2024 1

I put this in the icebox for now, but contributions are welcome.

from agda.

nad avatar nad commented on September 24, 2024

Maybe I misunderstood something, but isn't the problem in your own Haskell code? There is no guarantee that every symbol exported from every Haskell file generated by Agda will have a globally unique name.

from agda.

omelkonian avatar omelkonian commented on September 24, 2024

In M2, I have private Value = ... which I would expect would be respected by MAlonzo. Instead, an artifact of the internals d_Value leaks to the exported identifiers and also happens to conflict with an existing name.

So, I believe there are two related issues with MAlonzo here:

  1. When compiling an Agda module Ag to a Haskell module Hs, the following invariant is not respected:
    Ag.exports == Hs.exports.
  2. If (1) is impossible, MAlonzo could at least make sure the internal ids that leak to the public namespace not to reuse names from imported modules.

from agda.

nad avatar nad commented on September 24, 2024
  1. When compiling an Agda module Ag to a Haskell module Hs, the following invariant is not respected:
    Ag.exports == Hs.exports.

Private names can appear implicitly in importing Agda modules (due to reduction and unification), and can thus also appear in importing Haskell modules.

  1. If (1) is impossible, MAlonzo could at least make sure the internal ids that leak to the public namespace not to reuse names from imported modules.

A different approach might be to have two sets of generated Haskell modules:

  • The current one. It currently has the prefix MAlonzo, that could be changed to something like Agda_GHC_backend.Internal (perhaps with different prefixes for the non-strict and strict backends).
  • A set of modules that reexports exactly those definitions that are exported from the Agda modules. These modules could have a prefix like Agda_GHC_backend.Exported.

from agda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.