1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 10:03:22 +03:00
juvix/app
Paul Cadman 20a95ec42d
Extract builtin definitions for loading a Package into bundled package-base package (#2535)
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](ab4376cf9e/include/package-base)
and contains the minimal set of definitions required to load a Package
file.

The
[`Juvix.Builtin`](ab4376cf9e/include/package-base/Juvix/Builtin/V1.juvix)
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`](ab4376cf9e/include/package/PackageDescription/V2.juvix)
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.

* Part of https://github.com/anoma/juvix/issues/2511
2023-11-30 16:22:18 +00:00
..
Commands Extract builtin definitions for loading a Package into bundled package-base package (#2535) 2023-11-30 16:22:18 +00:00
TopCommand Add support for Literate Juvix Markdown (#2448) 2023-11-10 13:55:36 +01:00
App.hs Extract builtin definitions for loading a Package into bundled package-base package (#2535) 2023-11-30 16:22:18 +00:00
AsmInterpreter.hs Refactor Core datastructures (#1975) 2023-04-04 18:58:05 +02:00
CommonOptions.hs Add FileExt type (#2467) 2023-10-25 12:02:12 +02:00
Evaluator.hs Use a Juvix source file to define a package (#2434) 2023-10-27 12:35:20 +01:00
GlobalOptions.hs Interleave arity and typechecking (#2481) 2023-11-12 16:23:33 +01:00
Main.hs Run test suite in parallel (#2507) 2023-11-16 16:19:52 +01:00
TopCommand.hs Add support for Literate Juvix Markdown (#2448) 2023-11-10 13:55:36 +01:00