Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .sampo/changesets/base-pipes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cargo/nash-driver: patch
---

Use pipe operators for one-argument call chains across the base library.
6 changes: 6 additions & 0 deletions .sampo/changesets/cardano-base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
cargo/nash-driver: minor
cargo/nash-can: minor
---

Ship Cardano V3 context, address, governance, value, and interval modules in Base. Use native value builtins, explicit Nash wire validation, and Haskell-generated encoding and interval comparisons.
12 changes: 12 additions & 0 deletions .sampo/changesets/data-conversion-traits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
cargo/nash-driver: minor
cargo/nash-can: minor
cargo/nash-plutus: patch
---

Consolidate Data conversion and checking in traits. Allow explicit little-type
ToData and FromData implementations alongside Big-only identity blankets. Add
independent optional Decode instances, including Cardano V3 types, and remove
the separate encoder and decoder combinator modules.

Encode Flat terms iteratively so large context decoders do not exhaust the host stack.
5 changes: 5 additions & 0 deletions .sampo/changesets/data-pipes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cargo/nash-driver: patch
---

Use pipe operators for list Data conversions and share their implementations through Function.
5 changes: 5 additions & 0 deletions .sampo/changesets/function-default-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cargo/nash-can: minor
---

Add Function to the application default imports for qualified access to applyForward and applyBackward.
5 changes: 5 additions & 0 deletions .sampo/changesets/int-power-table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cargo/nash-driver: patch
---

Use a compile-time constant array for small powers of two in Int.pow2 and the base-two Int.pow path. Budget snapshots compare runtime arrays, constant arrays and modular exponentiation; constant lookup uses less CPU and memory without runtime table construction.
9 changes: 9 additions & 0 deletions .sampo/changesets/math-crypto-base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
cargo/nash-driver: minor
cargo/nash-can: minor
---

Add integer gcd/lcm/square-root operations and result-checking predicates,
normalized little rational arithmetic, and Big/little Crypto wrappers over
Plutus hash and signature builtins. Move the Bytes hash helpers into Crypto. Embed Rational and Crypto with implicit
qualified imports, exact reference snapshots and predicate budget comparisons.
5 changes: 5 additions & 0 deletions .sampo/changesets/prop-generators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cargo/nash-driver: minor
---

Complete Prop generators with booleans, options, bounded and exact bytes, weighted alternatives, and arbitrary-precision integer generation. Normalize Big/little bounds and weights, preserve strict replay groups, and express tuple2 through generator do. Add source snapshots for range properties and reduced counterexamples.
5 changes: 5 additions & 0 deletions .sampo/changesets/prop-small-offsets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cargo/nash-driver: minor
---

Choose small-biased bit widths before generating Prop.intAtLeast offsets and wide Prop.int magnitudes. Preserve arbitrary precision while replacing the zero-or-huge distribution with useful small nonzero values. Use exact expModInteger powers within each eight-bit band, with CEK budget snapshots comparing CPU and memory. Expose Int.pow2 and use its exact modular fast path in Int.pow for base two.
5 changes: 5 additions & 0 deletions .sampo/changesets/remove-prop-filtering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
cargo/nash-driver: patch
---

Remove predicate-filtered generators and their bounded retry loop, fixtures, and documentation. Build valid values directly through generator composition.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Implementation plans (Plan 08 is deferred; Plans 09 and 10 are complete):
- [x] 09 Validators + `nash build` — [plans/09-validators-build.md](plans/09-validators-build.md)
- [x] 10 Testing: `tests` block, props, generators, shrinking, power-assert, `nash test` — [plans/10-testing.md](plans/10-testing.md)
- [ ] 11 Macros + comptime — [plans/11-macros-comptime.md](plans/11-macros-comptime.md)
- [ ] 12 Stdlib `nash/base` — [plans/12-stdlib.md](plans/12-stdlib.md)
- [ ] 12 Stdlib `nash/base` — [plans/12-stdlib.md](plans/12-stdlib.md) (chunks 1–9 and 11–13 complete; chunk 10 Ast/Derive deferred)
- [ ] 13 `nash fmt`, `nash docs` — [plans/13-fmt-docs.md](plans/13-fmt-docs.md)
- [x] Representation-classed impl heads: `Big`/`Little` blankets and concrete little impls coexist — [plans/repr-classed-impl-heads.md](plans/repr-classed-impl-heads.md)

Expand Down
11 changes: 8 additions & 3 deletions crates/nash-can/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ pub const MODULES: &[(&str, &[&str])] = &[
("Applicative", &["Applicative"]),
("Monad", &["Monad"]),
("Lift", &["Lift"]),
("Data", &["ToData", "FromData", "Validate"]),
("Data.Decode", &[]),
("Data.Encode", &[]),
("Data", &["ToData", "FromData", "Validate", "Decode"]),
(
"Literal",
&["FromInt", "FromString", "FromBytes", "FromBool", "FromUnit"],
Expand All @@ -32,7 +30,10 @@ pub const MODULES: &[(&str, &[&str])] = &[
("Option", &["Option", "type option"]),
("Ordering", &["Ordering", "type ordering"]),
("Cons", &["type cons"]),
("Function", &[]),
("Int", &[]),
("Rational", &[]),
("Crypto", &[]),
("Bytes", &[]),
("String", &[]),
("List", &[]),
Expand All @@ -41,6 +42,10 @@ pub const MODULES: &[(&str, &[&str])] = &[
("Array", &[]),
("Prop", &[]),
("Test", &[]),
("Cardano.Tx", &[]),
("Cardano.Address", &[]),
("Cardano.Value", &[]),
("Cardano.Time", &[]),
];

pub fn imports<'a>(
Expand Down
2 changes: 2 additions & 0 deletions crates/nash-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ nash-config = { path = "../nash-config", version = "0.5.0" }
thiserror.workspace = true

[dev-dependencies]
nash-driver = { path = "../nash-driver" }
url.workspace = true
nash-parse = { path = "../nash-parse" }
nash-constrain = { path = "../nash-constrain" }
nash-nitpick = { path = "../nash-nitpick" }
Expand Down
10 changes: 8 additions & 2 deletions crates/nash-codegen/src/build/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ fn with_base_modules(
let bump = arena.as_bump();
let mut interfaces = BTreeMap::from([("Builtin", nash_can::kinds::builtin_interface(bump))]);
let mut units = Vec::new();
for (source, package) in modules {
for (source, package) in crate::harness::dependency_order(modules) {
let source = bump.alloc_str(source);
let parsed = nash_parse::Parser::new(bump, source).module().unwrap();
let canonical = nash_can::canonicalize(
Expand All @@ -188,7 +188,13 @@ fn with_base_modules(
units.push(Unit { canonical, solved });
}
let root = QualifiedName {
home: units.last().unwrap().canonical.module.name,
home: units
.iter()
.find(|unit| unit.canonical.module.name.package.is_none())
.unwrap()
.canonical
.module
.name,
name: "main",
};
let build = Build::new(units.iter().map(|u| Input {
Expand Down
1 change: 1 addition & 0 deletions crates/nash-codegen/src/build/tests/source.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const BASE_MODULES: &[&str] = &[
include_str!("../../../../nash-driver/base/src/Function.nash"),
include_str!("../../../../nash-driver/base/src/Lift.nash"),
include_str!("../../../../nash-driver/base/src/Bool.nash"),
include_str!("../../../../nash-driver/base/src/Unit.nash"),
Expand Down
Loading
Loading