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
1 change: 0 additions & 1 deletion quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export.md);
- [Drop in the TypeScript translator](/quest/m2/ts-drop.md) - every value that drops in moq-net and kio drops where Rust drops it
- [Async in the TypeScript translator](/quest/m2/ts-async.md) - moq-net's and kio's async code translates with Rust's lazy futures
- [Shared ownership](/quest/m2/ts-shared.md) - `Arc`/`Rc`/`Weak` keep exact counts, and locks and atomics become plain values
- [Iterator skips that read as std's](/quest/m2/ts-iter-nth.md) - `nth` and `nth_back` of what drops nothing read the items std's do
- [Translate moq-net's model to TypeScript](/quest/m2/ts-model/README.md) - the model translates with kio, moq-clock, and moq-pattern, for moq to compare against WASM
- [Waiting: Swift 6.4 in nixpkgs-unstable](/quest/m2/uniffi-swift-arm.md) - the nightly UniFFI fixtures move back to arm
- [Waiting: ubrn reads UniFFI 0.32](/quest/m2/ubrn-release.md) - the binding benchmark's browser runner pins a ubrn release, not an open PR
23 changes: 0 additions & 23 deletions quest/m2/ts-iter-nth.md

This file was deleted.

4 changes: 4 additions & 0 deletions ts/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

- The runtime no longer exports `ownedNth`, `ownedNthBack`, `ownedSkip`, `ownedTake`, or
`ownedStepBy`: `iterNth`, `iterNthBack`, `iterSkip`, `iterTake`, and `iterStepBy` take
what drops an item last. `rt.Iter`'s `nthItem` and `nthBackItem` are `nth` and
`nthBack`, which return `rt.DONE` past the end.
- Translation builds std from source for `wasm32-unknown-unknown`, so the toolchain needs
its `rust-src` component, as the flake's has, and the first run compiles std.
- `Option`'s and `Result`'s combinators lower from core's MIR into `core/option.ts` and
Expand Down
3 changes: 2 additions & 1 deletion ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ would: `rt.fmtToString((f) => DecodeError.fmt$Display(err, f))` and
An iterator's `next()` returns its next item or `rt.DONE`, never `undefined`, so an
iterator of `Option` keeps each `None` apart from its end. std's adaptors and consumers
are runtime functions taking the iterator first, `rt.iterMap(it, f)`, lazy and
short-circuiting as std's are, and call their closures in the same order and as often.
short-circuiting as std's are, and call their closures, and read what they wrap, in
the same order and as often, a skip by `nth` included.
An iterator over a slice, array, or `Vec`, or a small range, that only its `next` and
moves read steps in place, as two variables: the array and an index into it, or the
range's bounds, with no `rt.Iter` made. The crate's own `impl Iterator` returns `rt.DONE` from its `next` too, and joins
Expand Down
2 changes: 1 addition & 1 deletion ts/fixtures/lang/expected/chunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function chunks(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void {
}
_234.data[_234.start] = _234.data[_234.start + 1];
}
const copies: Uint8Array[] = rt.iterToArray(rt.iterMap(rt.iterMap(rt.iterSlice(pairs), rt.byteSliceFrom), rt.byteSliceToArray));
const copies: Uint8Array[] = rt.iterToArray(rt.iterCopied(rt.iterMap(rt.iterSlice(pairs), rt.byteSliceFrom), rt.byteSliceToArray));
rt.iterExtendBytes(out, rt.iterChain(rt.iterMap(rt.iterMap(rt.iterSlice(pairs), rt.byteSliceFrom), (p: rt.ByteSlice): rt.u8 => {
return p.data[p.start];
}), rt.iterMap(rt.iterMap(rt.iterSlice(copies), rt.byteSliceFrom), (p2: rt.ByteSlice): rt.u8 => {
Expand Down
7 changes: 7 additions & 0 deletions ts/fixtures/lang/expected/core/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,13 @@ export function mapOr$Option_u8_usize_shares_closure1(self: rt.u8 | undefined, d
return f(self);
}

export function mapOr$Option_u8s_u8_skips_closure44(self: Uint8Array | undefined, default_: rt.u8, f: (a0: Uint8Array) => rt.u8): rt.u8 {
if (self === undefined) {
return default_;
}
return f(self);
}

export function mapOr$Option_u8s_u8s_u8_splits_closure0(self: [rt.ByteSlice, rt.ByteSlice] | undefined, default_: rt.u8, f: (a0: [rt.ByteSlice, rt.ByteSlice]) => rt.u8): rt.u8 {
if (self === undefined) {
return default_;
Expand Down
8 changes: 5 additions & 3 deletions ts/fixtures/lang/expected/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { durations } from "./durations.ts";
import { ints, strings, derived, written, panics } from "./fmt.ts";
import { methods } from "./generics.ts";
import { u8Op, u16Op, u32Op, u64Op, u128Op, usizeOp, i8Op, i16Op, i32Op, i64Op, i128Op, isizeOp, i8Neg, i16Neg, i32Neg, i64Neg, i128Neg, isizeNeg, cast, convert } from "./ints.ts";
import { adaptors, consumers, ranges, options, own, values } from "./iters.ts";
import { adaptors, consumers, skips, ranges, options, own, values } from "./iters.ts";
import { keys } from "./keys.ts";
import { refs } from "./refs.ts";
import { copies, order, discriminants, loops, patterns, closures, library, flows } from "./shapes.ts";
Expand All @@ -26,7 +26,7 @@ export function run(input: rt.ByteSlice): rt.ByteVec {
const _10: [rt.u8, rt.u8] = [input.data[input.start], input.data[input.start + 1]];
const op: rt.u8 = _10[0];
const kind: rt.u8 = _10[1];
const _14: rt.u8 = rt.u8Rem(op, 51);
const _14: rt.u8 = rt.u8Rem(op, 52);
if (_14 === 0) {
u8Op(kind, new rt.ByteSlice(input.data, input.start + 2, input.length - 2), out);
} else if (_14 === 1) {
Expand Down Expand Up @@ -144,8 +144,10 @@ export function run(input: rt.ByteSlice): rt.ByteVec {
combinators(kind, new rt.ByteSlice(input.data, input.start + 2, input.length - 2), out);
} else if (_14 === 49) {
splits(kind, new rt.ByteSlice(input.data, input.start + 2, input.length - 2), out);
} else {
} else if (_14 === 50) {
refs(new rt.ByteSlice(input.data, input.start + 2, input.length - 2), out);
} else {
skips(kind, new rt.ByteSlice(input.data, input.start + 2, input.length - 2), out);
}
return out;
}
Expand Down
Loading