0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/std
Andrew Kelley 89763c9a0d
stage1 is now a hybrid of C++ and Zig
This modifies the build process of Zig to put all of the source files
into libcompiler.a, except main.cpp and userland.cpp.

Next, the build process links main.cpp, userland.cpp, and libcompiler.a
into zig1. userland.cpp is a shim for functions that will later be
replaced with self-hosted implementations.

Next, the build process uses zig1 to build src-self-hosted/stage1.zig
into libuserland.a, which does not depend on any of the things that
are shimmed in userland.cpp, such as translate-c.

Finally, the build process re-links main.cpp and libcompiler.a, except
with libuserland.a instead of userland.cpp. Now the shims are replaced
with .zig code. This provides all of the Zig standard library to the
stage1 C++ compiler, and enables us to move certain things to userland,
such as translate-c.

As a proof of concept I have made the `zig zen` command use text defined
in userland. I added `zig translate-c-2` which is a work-in-progress
reimplementation of translate-c in userland, which currently calls
`std.debug.panic("unimplemented")` and you can see the stack trace makes
it all the way back into the C++ main() function (Thanks LemonBoy for
improving that!).

This could potentially let us move other things into userland, such as
hashing algorithms, the entire cache system, .d file parsing, pretty
much anything that libuserland.a itself doesn't need to depend on.

This can also let us have `zig fmt` in stage1 without the overhead
of child process execution, and without the initial compilation delay
before it gets cached.

See #1964
History 2019-04-16 19:12:20 -04:00
..
atomic rename std lib files to new convention 2019-03-02 16:46:04 -05:00
build rename std lib files to new convention 2019-03-02 16:46:04 -05:00
c rename std lib files to new convention 2019-03-02 16:46:04 -05:00
crypto rename std lib files to new convention 2019-03-02 16:46:04 -05:00
debug breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
event fixed broken casts in std 2019-03-31 16:47:34 -05:00
fmt rename std lib files to new convention 2019-03-02 16:46:04 -05:00
hash rename std lib files to new convention 2019-03-02 16:46:04 -05:00
io rename std lib files to new convention 2019-03-02 16:46:04 -05:00
math Pack big.Int sign and length fields 2019-04-11 19:36:35 +12:00
meta rename std lib files to new convention 2019-03-02 16:46:04 -05:00
os wasi: switch to "standard" wasi_unstable module fn 2019-04-15 18:44:33 -04:00
rand rename std lib files to new convention 2019-03-02 16:46:04 -05:00
special stage1 is now a hybrid of C++ and Zig 2019-04-16 19:12:20 -04:00
valgrind remove the valgrind integration with std.mem.Allocator 2019-03-11 13:34:51 -04:00
zig fmt: support trailing comma after var_args 2019-04-05 12:27:13 -04:00
array_list.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
ascii.zig fix std.ascii type error and inverted logic 2019-03-29 12:18:42 -04:00
atomic.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
base64.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
buf_map.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
buf_set.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
buffer.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
build.zig stage1 is now a hybrid of C++ and Zig 2019-04-16 19:12:20 -04:00
c.zig munmap allows address 0 2019-03-25 16:04:25 -04:00
coff.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
crypto.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
cstr.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
debug.zig A bunch of fixes for the DWARF parser (#2254) 2019-04-11 14:34:13 -04:00
dwarf.zig Add definition for DW_AT_alignment 2019-04-11 10:36:15 +02:00
dynamic_library.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
elf.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
event.zig update std lib API for I/O 2018-09-30 17:28:35 -04:00
fmt.zig support comptime_int in formatInt{,Value} 2019-04-05 11:11:04 -04:00
hash.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
hash_map.zig Fix std.HashMap.remove returning incorrect KV 2019-04-07 15:47:09 -04:00
heap.zig Revert "DirectAllocator: on windows, use HeapFree instead of HeapReAlloc to free memory." 2019-04-16 19:11:37 -04:00
io.zig Changes as suggested by andrewrk 2019-04-03 20:05:24 +00:00
io_test.zig (De)serializer now uses enum instead of bool to determine packing mode (byte/bit). 2019-04-03 15:47:46 +00:00
json.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
json_test.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
lazy_init.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
linked_list.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
macho.zig New Zig formal grammar (#1685) 2018-11-13 05:08:37 -08:00
math.zig fix tests for math.mulWide 2019-03-29 12:17:48 -04:00
mem.zig doc comments for parameters in std.mem.Allocator 2019-04-09 17:43:49 -04:00
meta.zig breaking: fix @typeInfo handling of global error set type 2019-03-14 11:57:56 -04:00
mutex.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
net.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
os.zig update std.os.page_size for WebAssembly 2019-04-15 21:20:41 -04:00
pdb.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
priority_queue.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
rand.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
rb.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
segmented_list.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
sort.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
spinlock.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
statically_initialized_mutex.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
std.zig add std.ascii to std.std test "std" 2019-03-29 12:18:42 -04:00
testing.zig introduce the enum literal type 2019-03-24 00:44:18 -04:00
unicode.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
valgrind.zig remove the valgrind integration with std.mem.Allocator 2019-03-11 13:34:51 -04:00
zig.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00