-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Currently, the stage1 compiler makes use of:
- cache_hash.cpp
- cache_hash.hpp
- blake2b.c
- blake2.h
As the backend for its caching. The self-hosted compiler will also need to do caching, with a similar API.
The Zig std lib has a variety of hash functions to choose from:
$ ls ../lib/std/crypto
aes.zig blake2.zig gimli.zig md5.zig sha1.zig sha3.zig x25519.zig
benchmark.zig chacha20.zig hmac.zig poly1305.zig sha2.zig test.zig
Porting this API, or implementing an alternative, yet similar API, will accomplish the following:
- 🚀 One component of self-hosted will be complete. This is real progress towards self-hosting.
- 💃 The C/C++ implementation of the API can be deleted; zig0 can be uncached, and stage1 can take advantage of the Zig code with the hybrid setup that we already use for translate-c,
zig fmt
,zig targets
, etc. Less C++ code; more Zig code. - ⬆️ This unlocks the ability to move building zig's bundled libcs to be self-hosted (see self-host building musl, glibc, and mingw-w64 #4313).
- ⬆️ ⬆️ ...which unlocks the ability to make linking self-hosted (see self-host linking #4314)
- ⬆️ ⬆️ ⬆️ ...which, combined with make the CLI support depending on system headers and libraries (include and lib search paths) #2041, makes it possible to implement use case: ability to use zig as a drop-in replacement for a C compiler #3089 in zig, rather than c++.
- ⬆️ ⬆️ ...which unlocks the ability to make linking self-hosted (see self-host linking #4314)
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.