Skip to content

Commit 41621d1

Browse files
committed
Port the wasi-filesystem API to the new wai format. WebAssembly#35
This makes a number of changes, to make use of interface-types features such as expected, variant types, and resources. The change to use resources in particular means that filesystem functions are now methods of the descriptor resource. Since this means renaming everything, take this opportunity to introduce a new naming conventions, with _at being used for functions that take dirfd+path arguments. This also eliminates the rights concept what was present in earlier versions of WASI, has has discussed in WebAssembly#31. This required adding new flags to open_at, so while here, this also adds basic chmod-like support, as discussed in WebAssembly#33. And, this removes support for readdir seeking (seekdir/telldir), as discussed in WebAssembly#7. And it adds a fifo file type and a more general socket type, as discussed in WebAssembly#4.
1 parent e99230f commit 41621d1

File tree

4 files changed

+2057
-0
lines changed

4 files changed

+2057
-0
lines changed

README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# [Example WASI proposal]
2+
3+
This template can be used to start a new proposal, which can then be proposed in the WASI Subgroup meetings.
4+
5+
The sections below are recommended. However, every proposal is different, and the community can help you flesh out the proposal, so don't block on having something filled in for each one of them.
6+
7+
Thank you to the W3C Privacy CG for the [inspiration](https://github.com/privacycg/template)!
8+
9+
# [Title]
10+
11+
A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) API.
12+
13+
### Current Phase
14+
15+
[Fill in the current phase, e.g. Phase 1]
16+
17+
### Champions
18+
19+
- [Champion 1]
20+
- [Champion 2]
21+
- [etc.]
22+
23+
### Phase 4 Advancement Criteria
24+
25+
TODO before entering Phase 2.
26+
27+
## Table of Contents [if the explainer is longer than one printed page]
28+
29+
- [Introduction](#introduction)
30+
- [Goals [or Motivating Use Cases, or Scenarios]](#goals-or-motivating-use-cases-or-scenarios)
31+
- [Non-goals](#non-goals)
32+
- [API walk-through](#api-walk-through)
33+
- [Use case 1](#use-case-1)
34+
- [Use case 2](#use-case-2)
35+
- [Detailed design discussion](#detailed-design-discussion)
36+
- [[Tricky design choice 1]](#tricky-design-choice-1)
37+
- [[Tricky design choice 2]](#tricky-design-choice-2)
38+
- [Considered alternatives](#considered-alternatives)
39+
- [[Alternative 1]](#alternative-1)
40+
- [[Alternative 2]](#alternative-2)
41+
- [Stakeholder Interest & Feedback](#stakeholder-interest--feedback)
42+
- [References & acknowledgements](#references--acknowledgements)
43+
44+
### Introduction
45+
46+
[The "executive summary" or "abstract". Explain in a few sentences what the goals of the project are, and a brief overview of how the solution works. This should be no more than 1-2 paragraphs.]
47+
48+
### Goals [or Motivating Use Cases, or Scenarios]
49+
50+
[What is the end-user need which this project aims to address?]
51+
52+
### Non-goals
53+
54+
[If there are "adjacent" goals which may appear to be in scope but aren't, enumerate them here. This section may be fleshed out as your design progresses and you encounter necessary technical and other trade-offs.]
55+
56+
### API walk-through
57+
58+
[Walk through of how someone would use this API.]
59+
60+
#### [Use case 1]
61+
62+
[Provide example code snippets and diagrams explaining how the API would be used to solve the given problem]
63+
64+
#### [Use case 2]
65+
66+
[etc.]
67+
68+
### Detailed design discussion
69+
70+
[This section should mostly refer to the .wai.md file that specifies the API. This section is for any discussion of the choices made in the API which don't make sense to document in the spec file itself.]
71+
72+
#### [Tricky design choice #1]
73+
74+
[Talk through the tradeoffs in coming to the specific design point you want to make.]
75+
76+
```
77+
// Illustrated with example code.
78+
```
79+
80+
[This may be an open question, in which case you should link to any active discussion threads.]
81+
82+
#### [Tricky design choice 2]
83+
84+
[etc.]
85+
86+
### Considered alternatives
87+
88+
[This section is not required if you already covered considered alternatives in the design discussion above.]
89+
90+
#### [Alternative 1]
91+
92+
[Describe an alternative which was considered, and why you decided against it.]
93+
94+
#### [Alternative 2]
95+
96+
[etc.]
97+
98+
### Stakeholder Interest & Feedback
99+
100+
TODO before entering Phase 3.
101+
102+
[This should include a list of implementers who have expressed interest in implementing the proposal]
103+
104+
### References & acknowledgements
105+
106+
Many thanks for valuable feedback and advice from:
107+
108+
- [Person 1]
109+
- [Person 2]
110+
- [etc.]

test/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Testing guidelines
2+
3+
TK fill in testing guidelines
4+
5+
## Installing the tools
6+
7+
TK fill in instructions
8+
9+
## Running the tests
10+
11+
TK fill in instructions

0 commit comments

Comments
 (0)