-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall ABI #27
Comments
Thanks for kicking this off, JF!
For filesystems I think we would follow the way it was done in emscripten + NaCl and have the ability to mount different filesystems on the same hierarchy. We'd have to agree on what a particular filesystem type means, though. So in your example "websql" could be the filesystem type, but what does that mean in a non-web embedding? Are there other examples where we'd want to swap out the host's implementation? |
I am concerned that this proposal, as currently phrased, seems to be aimed at encouraging the use of non-standard Web APIs. |
I'm thinking that the
A few random ideas:
That's absolutely not my goal, and I think we can agree that such things are off the table as a design concern. If e.g. Chrome wants to implement the filesystem syscalls using HTML5 filesystem then go for it, but that's in no way tied to the present discussion. |
In the Web embedding, we don't have any constraints on the precise syscall ABI, so it means our choices will be arbitrary and hard to validate. It seems like we need some non-web embeddings to participate in this discussion--embedding that will implement the syscalls directly in the host--for the ABI to be meaningful. I have actually heard several non-web embeddings that are considering doing exactly such a thing, so perhaps we could reach out to them and get them together. Another point is that while it seems like a syscall ABI would certainly relate to the toolchain, it seems like a much broader discussion than just "toolchain conventions". It's like a new wasm-ified POSIX standard. |
These might be good goals here:
|
My non-web implementation targets .NET Standard, which is fairly restrictive, though I could make a .NET Classic build that would have full access to the Windows API. If the goal here is to make POSIX for WASM, I could probably find a way to make most of it work... |
I can see an argument in favour standardising the syscall ABI... but I'm not entirely convinced! Pro:
Con:
For what it's worth - I have my own Musl port and JavaScript syscalls implementation. I've called it Minscripten.
For my own experience, I'd suggest the following:
Finally, Wasm needs some new syscalls!
|
IIUC we currently don't have a stable syscall ABI. I think we should try to standardize something.
Having a stable ABI we agree on means that embedder don't have to roll their own. There's plenty of experience to gain from what Emscripten did, and I would love to have its JavaScript syscall layer as a free-standing thing.
Here's a quick sketch:
module
for all syscalls is the same. Saysyscall
.module
name (i.e.syscall_v0
): adding new syscalls doesn't need a new version, but changing any tool-convention ABI behavior would require bumping the version. Unless we think behavior will never change, in which case no versioning.field
for each syscall is just the syscall number macro's name (e.g.exit
,fork
,read
,write
,open
, ...)module
/field
of an export / import.One open question I have: say a JS embedding wants to let the user choose how to implement filesystem access (maybe WebSQL versus in-memory are two options). How would be offer a stable ABI, and let users choose which JS glue to use? They can't just change the "filesystem" import if all syscalls are in the "syscall" import. Should we group syscalls by theme, and are all of these orthogonal enough that you wouldn't want to have two in the same group sometimes?
The text was updated successfully, but these errors were encountered: