Skip to content
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

Design Zig's stdlib to minimize use of syscalls #324

Closed
thejoshwolfe opened this issue Apr 15, 2017 · 3 comments
Closed

Design Zig's stdlib to minimize use of syscalls #324

thejoshwolfe opened this issue Apr 15, 2017 · 3 comments

Comments

@thejoshwolfe
Copy link
Contributor

@Immortalin says from #322 (comment) :

Can the standard library be designed to minimise use of syscalls? It would be great if the stdlib can be bootstrapped by defining a few primitives. Making the runtime easily bootstrapable/generic would be really nice since pretty much every other programming language requires rewriting the entire standard library when doing OS development due to the lack of malloc, stdio etc. Imagine how much easier OS Dev would be if there's a "zig runtime function stubs" file with perhaps twenty primitives. Once the user fills them out, they would be able to do OS Dev with full access to the stdlib

@thejoshwolfe
Copy link
Contributor Author

Can you give examples of stdlib functions that would be useful in OS Dev but are typically written with dependencies on syscalls?

@andrewrk
Copy link
Member

One thing I want to note is that you can use any of the standard library when compiling for the freestanding target, and you'll get a compile error if you accidentally depend on code that had to make a syscall. If you don't get a compile error, then your code does not depend on an OS syscall.

@andrewrk
Copy link
Member

andrewrk commented May 2, 2017

I don't really understand what this issue is calling for. The standard library already tries to be efficient, and only depends on the OS if it has to. Feel free to re-open with further explanation.

@andrewrk andrewrk closed this as completed May 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants