# Are we going to use the committed WASM code for bootstrapping?

**URL:** <https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877>\
**Category:** Brainstorming\
**Tags:** compiler\
**Created:** [June 23, 2023, 2:26pm UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877 "2023-06-23T14:26:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gegogi](https://ziggit.dev/letter_avatar_proxy/v4/letter/g/a698b9/32.png) [@gegogi](https://ziggit.dev/u/gegogi)\
**Post date:** [June 23, 2023, 2:26pm UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/1 "2023-06-23T14:26:59Z")

</div>

Out of curiosity, are we on track regarding the plan of bootstrapping the compiler via the committed WASM code?

If so, are we going to remove the zig-bootstrap repository too?

Sorry if I am totally misunderstood.

Kyung

---

<div class="post-metadata">

**Author:** ![marler8997](https://ziggit.dev/user_avatar/ziggit.dev/marler8997/32/77_2.png) [@marler8997](https://ziggit.dev/u/marler8997)\
**Post date:** [June 23, 2023, 10:06pm UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/2 "2023-06-23T22:06:51Z")

</div>

Yup, zig has been relying on the WASM blob for bootstrapping since November last year. Andrew posted an article about it here: [Goodbye to the C++ Implementation of Zig ⚡ Zig Programming Language](https://ziglang.org/news/goodbye-cpp/)

The WASM blob is able to bootstrap the Zig compiler, but, doesn’t use LLVM. The WASM blob can only translate Zig code to C code, which is then compiled by your system C compiler. Then there’s zig-bootstrap, which, is a set of scripts/tools that can compile LLVM and Zig, a much bigger task than what the WASM blob does. Both will continue to exist as far as I’m aware.

---

<div class="post-metadata">

**Author:** ![gegogi](https://ziggit.dev/letter_avatar_proxy/v4/letter/g/a698b9/32.png) [@gegogi](https://ziggit.dev/u/gegogi)\
**Post date:** [June 24, 2023, 1:31am UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/3 "2023-06-24T01:31:29Z")

</div>

Yeah, I read the article and remember watching Andrew’s video on Vimeo.  
But I couldn’t find any documentation how I can do it.  
I can see WASM blob is there in stage1 directory of zig/zig-bootstrap repo.

---

<div class="post-metadata">

**Author:** ![mohan43u](https://ziggit.dev/user_avatar/ziggit.dev/mohan43u/32/560_2.png) [@mohan43u](https://ziggit.dev/u/mohan43u)\
**Post date:** [June 24, 2023, 4:27am UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/4 "2023-06-24T04:27:39Z")

</div>

My system have only 8G memory, one of the issues I’m facing compiling zig from source is the huge memory required (more than 8G) to build `zig2` binary. Is there any improvement on that?

---

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [June 24, 2023, 5:08am UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/5 "2023-06-24T05:08:44Z")

</div>

Yes, according to that article that @marler8997 linked, the peak memory usage of compiling from source went from 11.3 GiB to 3.8 GiB.

---

<div class="post-metadata">

**Author:** ![mohan43u](https://ziggit.dev/user_avatar/ziggit.dev/mohan43u/32/560_2.png) [@mohan43u](https://ziggit.dev/u/mohan43u)\
**Post date:** [June 24, 2023, 1:09pm UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/6 "2023-06-24T13:09:43Z")

</div>

> the peak memory usage of compiling from source went from 11.3 GiB to 3.8 GiB

I assume this is on the main, unfortunately I cannot compile main locally (stuck in llvm 15.x in Arch), But when I switched to 0.10.x, `oom-killer` still get invoked during `zig2` creation.

---

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [June 24, 2023, 7:30pm UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/7 "2023-06-24T19:30:44Z")

</div>

The improvements were done in the 0.11.x release cycle. 0.11.0 is not released yet.

> [@How far away is 0.11 really?](https://ziggit.dev/t/how-far-away-is-0-11-really/744/8):
>
> I’m glad you guys are taking your time - I became a paid supporter of Zig via github because I liked how little baggage the language has and how skeptical you guys are (justifiably so) of adding piles of syntactic sugar. I (for one) say take your time… especially with async and await given that these things directly interact with keywords… gotta get those right. Speaking of which, have you guys looked into the work of Eric Niebler at all? He’s the guy that got ranges into the C++ standard libra…

---

<div class="post-metadata">

**Author:** ![JPL](https://ziggit.dev/letter_avatar_proxy/v4/letter/j/a9adbd/32.png) [@JPL](https://ziggit.dev/u/JPL)\
**Post date:** [June 28, 2023, 5:25pm UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/8 "2023-06-28T17:25:26Z")

</div>

Hello, I just updated my version from 0.10 to 0.11…

Testing : processing on a project of several thousand lines

Some not sad edits @prtCast and @intFromPtr  
I took a short time once it works, yes it seems logical…

As for enum enumfromInt etc. it is not famous as a solution, before, it was much simpler  
to modify to have more complexity seems to not me very judicious

I ended up making my own functions based on version 0.10.1

the indices with “instruction for” there too, it’s less simple, but it is true that we can advance 2 indices at the same time, I have not used it yet, now we are obliged to have a external index

For me, these are the biggest changes.

The build file, but which seems more obvious to him when reading.

being a computer veteran I don’t worry too much…

---

<div class="post-metadata">

**Author:** ![marler8997](https://ziggit.dev/user_avatar/ziggit.dev/marler8997/32/77_2.png) [@marler8997](https://ziggit.dev/u/marler8997)\
**Post date:** [June 30, 2023, 5:41pm UTC](https://ziggit.dev/t/are-we-going-to-use-the-committed-wasm-code-for-bootstrapping/877/9 "2023-06-30T17:41:03Z")

</div>

> [@marler8997](#):
>
> Both will continue to exist as far as I’m aware.

Spoke too soon 🙂 [make the main zig executable no longer depend on LLVM, LLD, and Clang libraries · Issue #16270 · ziglang/zig · GitHub](https://github.com/ziglang/zig/issues/16270)
