Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a basic Package type that does not depend on the standard library #2508

Closed
paulcadman opened this issue Nov 9, 2023 · 0 comments · Fixed by #2509
Closed

Add a basic Package type that does not depend on the standard library #2508

paulcadman opened this issue Nov 9, 2023 · 0 comments · Fixed by #2509

Comments

@paulcadman
Copy link
Collaborator

paulcadman commented Nov 9, 2023

The problem

As noted by @lukaszcz : "... typechecking tries to evaluate Package.juvix, so I can't debug the changes piecemeal on small examples, because the standard library is always needed"

We need a way to define a Juvix package without depending on large amounts of existing Juvix code, so we can run examples while changing the Juvix compiler behaviour (syntax, typechecker, ...).

Proposal

Add a new Package type that has a single constructor:

module PackageDescription.Basic;

type Package := basicPackage;

One could then write the following Package.juvix:

module Package;

import PackageDescription.Basic open;

package : Package := basicPackage;

This would behave as if you'd defined a project using an empty juvix.yaml file, i.e a Package with all fields set to default.

  • We could add a flag to juvix init to generate this Package.juvix instead of the one using PackageDescription.V1.
  • We could use this Package type in the test suite packages to speed up the test suite.
paulcadman added a commit that referenced this issue Nov 13, 2023
This PR adds the `PackageDescription.Basic` module, available to
Package.juvix files.

```
module Package;

import PackageDescription.Basic open;

package : Package := basicPackage;
```

The `PackageDescription.Basic` module provides a Package type that is
translated to a Juvix Package with all default arguments. It is not
possible to customize a basic package.

A basic package does not depend on the standard library, so loads much
more quickly.

Additionally this PR:
* Adds `juvix init --basic/-b` option to generate a basic Package.juvix.
* Migrates Package.juvix files that only use default arguments, or only
customise the name field, to basic Package files.

* Closes #2508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant