juvix
juvix copied to clipboard
Avoid breaking changes to `Package.juvix` caused by updates to standard library
Background
Users can choose to import the Juvix standard library in Package.juvix
files. Note that the standard library is not required if you're just declaring a simple package, but there may be uses for it in more complex cases.
Currently the Package.juvix
file is resolved in an environment which contains the standard library from the global package.
Issue
- It's intended that a user may customise their global package. They could, for example, update the version of the standard library or remove the standard library dependency from the global package completely. This could break package loading.
- The version of the standard library is not pinned, so a
Package.juvix
file that uses a fixed version of thePackageDescription
module that also importsStdlib.Prelude
today may not work with future versions of the compiler.
Options
- Don't allow standard library imports in a
Package.juvix
file and restore this feature when we have better use-cases - Add a pinned copy of the standard library under the
PackageDescription
namespace, i.e inPackageDescription.V3.Stdlib.Prelude
. Users would not be able to importStdlib.Prelude
directly. - Something else
I'd say go for option 1 since it is the simplest and is enough for what we need now (and probably what we'll need for a long while). When/if needed, let's do option 2.