Skip to content

Commit

Permalink
Improve performance by selectively importing parts of the stdlib (#3)
Browse files Browse the repository at this point in the history
* Improve performance by selectively importing parts of the stdlib

* Use explicit stdlib dependency

* Update make clean to clean juvix build dir

* Use stdlib release reference
  • Loading branch information
paulcadman authored Dec 1, 2023
1 parent 3ed8a39 commit 61c5404
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ clean-build:

.PHONY: clean-deps
clean-deps:
@rm -rf deps/
@juvix clean
@(cd tests && exec juvix clean)

.PHONY: clean
clean: clean-deps clean-build
6 changes: 3 additions & 3 deletions Package.juvix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Package;

import PackageDescription.V1 open;
import PackageDescription.V2 open;

package : Package :=
defaultPackage
{name := "test";
version := mkVersion 0 7 0;
dependencies := [github "anoma" "juvix-stdlib" "v0.0.1"]};
version := mkVersion 0 8 0;
dependencies := [github "anoma" "juvix-stdlib" "v0.1.0"]};
3 changes: 1 addition & 2 deletions Test/JuvixUnit.juvix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Test.JuvixUnit;

import Stdlib.Prelude open hiding {fail};

import Test.Prelude open;
import Stdlib.Debug.Fail as Fail;

type Assertion :=
Expand Down
10 changes: 10 additions & 0 deletions Test/Prelude.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Test.Prelude;

import Juvix.Builtin.V1 open public;
import Stdlib.Data.List.Base open using {any; foldr} public;
import Stdlib.Data.Bool.Base open using {if; not} public;
import Stdlib.Data.Maybe.Base open using {maybe} public;
import Stdlib.Function open public;
import Stdlib.System.IO.Base open public;
import Stdlib.System.IO.String open public;
import Stdlib.Trait.Eq open public;
4 changes: 3 additions & 1 deletion juvix.lock.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# This file was autogenerated by Juvix version 0.5.4.
# Do not edit this file manually.

version: 2
checksum: bb2c92390bf49873ae476fb3e816d2f9e2e86dbec0e584a0ccfe552ec0f2bda1
dependencies:
- git:
name: anoma_juvix-stdlib
ref: f68b0614ad695eaa13ead42f3466e0a78219f826
ref: 183d4e9329a648b339ebecf2122b3e9621c99ee8
url: https://github.com/anoma/juvix-stdlib
dependencies: []
6 changes: 4 additions & 2 deletions tests/Package.juvix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module Package;

import PackageDescription.V1 open;
import PackageDescription.V2 open;

package : Package :=
defaultPackage
{name := "tests";
dependencies := [defaultStdlib; path "../"]};
dependencies := [ path "../"
; github "anoma" "juvix-stdlib" "v0.1.0"
]};
11 changes: 8 additions & 3 deletions tests/juvix.lock.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# This file was autogenerated by Juvix version 0.5.4.
# Do not edit this file manually.

version: 2
checksum: bc44ac3a4265ab42f42880ebe71560cce855411ca98574181715b96d34543bb8
dependencies:
- path: .juvix-build/stdlib/
dependencies: []
- path: ../
dependencies:
- git:
name: anoma_juvix-stdlib
ref: f68b0614ad695eaa13ead42f3466e0a78219f826
ref: 183d4e9329a648b339ebecf2122b3e9621c99ee8
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-stdlib
ref: 183d4e9329a648b339ebecf2122b3e9621c99ee8
url: https://github.com/anoma/juvix-stdlib
dependencies: []

0 comments on commit 61c5404

Please sign in to comment.