Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Commit bfff49c

Browse files
authored
Merge pull request #139 from WebAssembly/update-wit-0.3.0-rc-2025-09-16
Update 0.3.0 WIT definitions to 0.3.0-rc-2025-09-16
2 parents afa82c7 + 7ac2da7 commit bfff49c

File tree

9 files changed

+96
-85
lines changed

9 files changed

+96
-85
lines changed

wit-0.3.0-draft/deps.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[clocks]
22
url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz"
33
subdir = "wit-0.3.0-draft"
4-
sha256 = "626953ec28ae956ec1233c4350deab6e5cdcbdd9ae6d491e102ad7c6901cc8bf"
5-
sha512 = "ae375b002cfaacdbaa133bb87747d1b86675e13144067c3005d6c32cf5c37bb7a52b693ae46d5cd65fc4910a78d7255d0ada5142828a022497fd0eaacb61761f"
4+
sha256 = "cf61a3785c2838340ce530ee1cdc6dbee3257f1672d6000ca748dfe253808dec"
5+
sha512 = "f647de7d6c470595c3e5bf0dba6af98703beb9f701c66543cea5d42e81f7a1a73f199c3949035a9c2c1bd717056e5e68788f520af39b9d26480242b7626f22ce"

wit-0.3.0-draft/deps/clocks/monotonic-clock.wit

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.3.0-rc-2025-08-15;
1+
package wasi:clocks@0.3.0-rc-2025-09-16;
22
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
33
/// time.
44
///
@@ -7,38 +7,41 @@ package wasi:[email protected];
77
///
88
/// A monotonic clock is a clock which has an unspecified initial value, and
99
/// successive reads of the clock will produce non-decreasing values.
10-
@since(version = 0.3.0-rc-2025-08-15)
10+
@since(version = 0.3.0-rc-2025-09-16)
1111
interface monotonic-clock {
12+
use types.{duration};
13+
1214
/// An instant in time, in nanoseconds. An instant is relative to an
1315
/// unspecified initial value, and can only be compared to instances from
1416
/// the same monotonic-clock.
15-
@since(version = 0.3.0-rc-2025-08-15)
17+
@since(version = 0.3.0-rc-2025-09-16)
1618
type instant = u64;
1719

18-
/// A duration of time, in nanoseconds.
19-
@since(version = 0.3.0-rc-2025-08-15)
20-
type duration = u64;
21-
2220
/// Read the current value of the clock.
2321
///
2422
/// The clock is monotonic, therefore calling this function repeatedly will
2523
/// produce a sequence of non-decreasing values.
26-
@since(version = 0.3.0-rc-2025-08-15)
24+
///
25+
/// For completeness, this function traps if it's not possible to represent
26+
/// the value of the clock in an `instant`. Consequently, implementations
27+
/// should ensure that the starting time is low enough to avoid the
28+
/// possibility of overflow in practice.
29+
@since(version = 0.3.0-rc-2025-09-16)
2730
now: func() -> instant;
2831

2932
/// Query the resolution of the clock. Returns the duration of time
3033
/// corresponding to a clock tick.
31-
@since(version = 0.3.0-rc-2025-08-15)
34+
@since(version = 0.3.0-rc-2025-09-16)
3235
get-resolution: func() -> duration;
3336

3437
/// Wait until the specified instant has occurred.
35-
@since(version = 0.3.0-rc-2025-08-15)
38+
@since(version = 0.3.0-rc-2025-09-16)
3639
wait-until: async func(
3740
when: instant,
3841
);
3942

40-
/// Wait for the specified duration has elapsed.
41-
@since(version = 0.3.0-rc-2025-08-15)
43+
/// Wait for the specified duration to elapse.
44+
@since(version = 0.3.0-rc-2025-09-16)
4245
wait-for: async func(
4346
how-long: duration,
4447
);

wit-0.3.0-draft/deps/clocks/timezone.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.3.0-rc-2025-08-15;
1+
package wasi:clocks@0.3.0-rc-2025-09-16;
22

33
@unstable(feature = clocks-timezone)
44
interface timezone {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package wasi:clocks@0.3.0-rc-2025-09-16;
2+
/// This interface common types used throughout wasi:clocks.
3+
@since(version = 0.3.0-rc-2025-09-16)
4+
interface types {
5+
/// A duration of time, in nanoseconds.
6+
@since(version = 0.3.0-rc-2025-09-16)
7+
type duration = u64;
8+
}

wit-0.3.0-draft/deps/clocks/wall-clock.wit

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.3.0-rc-2025-08-15;
1+
package wasi:clocks@0.3.0-rc-2025-09-16;
22
/// WASI Wall Clock is a clock API intended to let users query the current
33
/// time. The name "wall" makes an analogy to a "clock on the wall", which
44
/// is not necessarily monotonic as it may be reset.
@@ -13,10 +13,10 @@ package wasi:[email protected];
1313
/// monotonic, making it unsuitable for measuring elapsed time.
1414
///
1515
/// It is intended for reporting the current date and time for humans.
16-
@since(version = 0.3.0-rc-2025-08-15)
16+
@since(version = 0.3.0-rc-2025-09-16)
1717
interface wall-clock {
1818
/// A time and date in seconds plus nanoseconds.
19-
@since(version = 0.3.0-rc-2025-08-15)
19+
@since(version = 0.3.0-rc-2025-09-16)
2020
record datetime {
2121
seconds: u64,
2222
nanoseconds: u32,
@@ -35,12 +35,12 @@ interface wall-clock {
3535
///
3636
/// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16
3737
/// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time
38-
@since(version = 0.3.0-rc-2025-08-15)
38+
@since(version = 0.3.0-rc-2025-09-16)
3939
now: func() -> datetime;
4040

4141
/// Query the resolution of the clock.
4242
///
4343
/// The nanoseconds field of the output is always less than 1000000000.
44-
@since(version = 0.3.0-rc-2025-08-15)
44+
@since(version = 0.3.0-rc-2025-09-16)
4545
get-resolution: func() -> datetime;
4646
}

wit-0.3.0-draft/deps/clocks/world.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package wasi:clocks@0.3.0-rc-2025-08-15;
1+
package wasi:clocks@0.3.0-rc-2025-09-16;
22

3-
@since(version = 0.3.0-rc-2025-08-15)
3+
@since(version = 0.3.0-rc-2025-09-16)
44
world imports {
5-
@since(version = 0.3.0-rc-2025-08-15)
5+
@since(version = 0.3.0-rc-2025-09-16)
66
import monotonic-clock;
7-
@since(version = 0.3.0-rc-2025-08-15)
7+
@since(version = 0.3.0-rc-2025-09-16)
88
import wall-clock;
99
@unstable(feature = clocks-timezone)
1010
import timezone;

wit-0.3.0-draft/ip-name-lookup.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
@since(version = 0.3.0-rc-2025-08-15)
1+
@since(version = 0.3.0-rc-2025-09-16)
22
interface ip-name-lookup {
3-
@since(version = 0.3.0-rc-2025-08-15)
3+
@since(version = 0.3.0-rc-2025-09-16)
44
use types.{ip-address};
55

66
/// Lookup error codes.
7-
@since(version = 0.3.0-rc-2025-08-15)
7+
@since(version = 0.3.0-rc-2025-09-16)
88
enum error-code {
99
/// Unknown error
1010
unknown,
@@ -57,6 +57,6 @@ interface ip-name-lookup {
5757
/// - <https://man7.org/linux/man-pages/man3/getaddrinfo.3.html>
5858
/// - <https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo>
5959
/// - <https://man.freebsd.org/cgi/man.cgi?query=getaddrinfo&sektion=3>
60-
@since(version = 0.3.0-rc-2025-08-15)
60+
@since(version = 0.3.0-rc-2025-09-16)
6161
resolve-addresses: async func(name: string) -> result<list<ip-address>, error-code>;
6262
}

0 commit comments

Comments
 (0)