|
|
Subscribe / Log in / New account

Zig heading toward a self-hosting compiler

Zig heading toward a self-hosting compiler

Posted Oct 8, 2020 23:43 UTC (Thu) by khim (subscriber, #9252)
In reply to: Zig heading toward a self-hosting compiler by mathstuf
Parent article: Zig heading toward a self-hosting compiler

> I wouldn't call them comparable.

What's the difference? Both mean that you need to abandon basically all the codebase collection for a given language and start more-or-less from scratch.

> You certainly can't add any given feature to a language (without basically telling everyone to go and rewrite their code)

You certainly could. Rust does it all the time. C++ does it less frequently. Heck, even C does that. You couldn't remove — that's different.

> Here's a list of crates which support modes of being compiled without the standard library: https://lib.rs/no-std

About what I expected. 492 crates out of 48,264. And, most likely, mostly on simplistic side.

So, basically, literally 99% of codebase becomes unavailable for you if you want to handle OOM… at this point it's not materially different from switching to a new language… even if it would be 50-70 times less popular than Rust… you would have more choices for you to pick.


to post comments

Zig heading toward a self-hosting compiler

Posted Oct 9, 2020 7:49 UTC (Fri) by laarmen (subscriber, #63948) [Link]

The list is certainly not exhaustive, as it's based on user-defined tags for each crate. For instance, both the crates "serde" and "nom" (the main (de)serialization crate, and a combination parsing library), can be used (with a reduced feature set) in a no_std environment, yet neither appear on the list.

Zig heading toward a self-hosting compiler

Posted Oct 9, 2020 13:11 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

> Both mean that you need to abandon basically all the codebase collection for a given language and start more-or-less from scratch.

Having an allocation-failure-resilient standard library wouldn't require me to rewrite code using the current standard library. Certainly not with Rust's stability guarantees.

> You certainly could. Rust does it all the time. C++ does it less frequently. Heck, even C does that. You couldn't remove — that's different.

I said *any*. Sure, specific features get added all the time. Others get rejected all the time (even if they'd be nice to have) because they'd disrupt way too much.

> About what I expected. 492 crates out of 48,264. And, most likely, mostly on simplistic side.

You have to balance this against the interest involved here. There's enough to build *something* at least. Where that line is? Not sure, but it's almost certainly not at a level that is effectively useless.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds