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

Extract builtin definitions for loading a Package into bundled package-base package #2535

Merged
merged 14 commits into from
Nov 30, 2023

Conversation

paulcadman
Copy link
Collaborator

@paulcadman paulcadman commented Nov 23, 2023

This PR creates a new package that's bundled with the compiler in a similar way to the stdlib and the package description package.

The package-base Package

This package is called package-base and contains the minimal set of definitions required to load a Package file.

The Juvix.Builtin module contains:

module Juvix.Builtin.V1;

import Juvix.Builtin.V1.Nat open public;
import Juvix.Builtin.V1.Trait.Natural open public;
import Juvix.Builtin.V1.String open public;
import Juvix.Builtin.V1.Bool open public;
import Juvix.Builtin.V1.Maybe open public;
import Juvix.Builtin.V1.List open public;
import Juvix.Builtin.V1.Fixity open public;

Juvix.Builtin.V1.Bool is required to support backend primitive integers Juvix.Builtin.V1.Trait.Natural is required to support numeric literals.

The PackageDescription.V2 module

This PR also adds a new PackageDescription.V2 type that uses the package-base. This is to avoid breaking existing Package files. The Packages files in the repo (except those that test PackageDescription.V1) have also been updated.

Updating the stdlib

The standard library will be updated to use Juvix.Builtin.* modules in a subsequent PR.

@paulcadman paulcadman added this to the 0.5.5 milestone Nov 23, 2023
@paulcadman paulcadman self-assigned this Nov 23, 2023
@paulcadman paulcadman marked this pull request as ready for review November 30, 2023 09:00
@paulcadman paulcadman added package-manager enhancement New feature or request labels Nov 30, 2023
@janmasrovira janmasrovira self-requested a review November 30, 2023 09:09
Copy link
Collaborator

@janmasrovira janmasrovira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@paulcadman paulcadman merged commit 20a95ec into main Nov 30, 2023
4 checks passed
@paulcadman paulcadman deleted the package-base-split branch November 30, 2023 16:22
janmasrovira pushed a commit to anoma/juvix-stdlib that referenced this pull request Dec 1, 2023
The package-base module was added in
anoma/juvix#2535 - this PR updates the standard
library to reused the contents of this package to avoid duplication.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants