Comments (5)
I'm not seeing the benefits here. All the suggested alternatives for generating the agdai files put either more work on the developers or on the package maintainers. Your main complaint with Setup.hs seems to be lack of documentation, which I think is best addressed by adding documentation. If someone wants to cross-compile Agda, they can use the workaround suggested in the issue until it's been fixed.
from agda.
The (only) job of Setup.hs
is to build the .agdai
files for the primitive library.
Why should cabal install
build them? Because Agda might be installed into the root
area (e.g. in a system-wide installation), and if the installation does not include building the .agdai
files there, Agda will not function with just user privileges.
We could skip this step and provide a script instead that does the job, and instruct packagers and admins to use the script.
(Note that the script then needs to be portable to all OSs or we need several scripts to cover the relevant OSs).
Still, this is a bit less "batteries included".
from agda.
Some alternatives for generating the .agdai
files:
Generate .agdai
at release-time
- Add to
data-files:
field of.cabal
- Check
.agdai
in to repo - Manually re-generate
.agdai
each release
Generate .agdai
immediately after cabal build
- Tell packagers/users to run
agda --dump-builtin-agdai-files DIR
- Precedent: Haskell installer for
agda-mode.el
Generate .agdai
at run-time
When agda
encounters import Agda.Builtin.Nat
:
- Dump
Nat.agda
toDIR/Agda/Builtin/Nat.agda
- Type-check contents of
DIR/
as Agda source code
How to calculate DIR
- Agda option
--generated-modules-dir
- or equivalent
.agda-lib
config - or equivalent env var
- or equivalent
_build/generated-modules/
(if.agda-lib
is present)- Wherever
.agdai
files normally go (e.g. in current working dir)
How to support the --safe
flag
- Type check the contents of
DIR/
without the--safe
flag- Allows
Agda.Builtin.Nat
to containpostulate
- Allows
Agda.Builtin.Nat
to contain{-# COMPILE ... #-}
- Allows
- Suppress
CoInfectiveImport
errors for imports crossing theDIR/
boundary- Allows the user's code to
--safe
lyimport Agda.Builtin.Nat
- Allows the user's code to
from agda.
Suppress
CoInfectiveImport
errors for imports crossing theDIR/
boundary
This kind of ad-hoc overriding of safety checks seems dangerous.
I would rather the (already complex) safety checking logic did not have such special cases.
from agda.
- Check
.agdai
in to repo
That's definitely a no. The repo is already too fat (my .git
is 1.1GB).
Anyway, I not see why they should be checked in. They could be created on the fly when assembling the sdist tarball.
from agda.
Related Issues (20)
- Citation.cff HOT 1
- Prune the `Makefile` HOT 7
- Delete the GitHub Wiki HOT 3
- Migrate the Chalmers Wiki HOT 4
- Reorganize `HACKING.md`
- Merge `.authorspellings` and `.mailmap` HOT 1
- Mimer internal error when querying `recRecursive` HOT 1
- Interactive highlighting remnants with lambda-where
- Pattern synonyms with named arguments can be defined but not used HOT 3
- Automatically create names for syntax
- Mangled trX/Con clause for indexed type with green slime
- Why do we `reduce` and `instantiateFull` constraints? HOT 2
- Use of Non-terminating Function in Data Declaration Makes Typechecker Loop HOT 4
- Misprinted domain-free parameters with cohesion attribute HOT 1
- Regression in 2.6.4.2 concerning `with` HOT 6
- Regression in 2.6.4 in `rewrite` with instances
- Feature request: Allow for overloading function application (the 'whitespace' operator) HOT 3
- Future: cabal build-type `Setup` will be phased out in favor of `Hooks`
- Non-sensical error since 2.5.4 when applying a non-function HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agda.