Skip to content

Add C as a target architecture #5107

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

Closed
The-Jon opened this issue Apr 19, 2020 · 6 comments
Closed

Add C as a target architecture #5107

The-Jon opened this issue Apr 19, 2020 · 6 comments
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone

Comments

@The-Jon
Copy link

The-Jon commented Apr 19, 2020

I would appreciate it if you could add a "C" Target. I know it shouldn't be used because of the optimization and information lost. But just as an option to compile Zig for platforms/architectures which aren't supported by clang.

@emekoi
Copy link
Contributor

emekoi commented Apr 19, 2020

by "c target" do you mean a c backend so that zig can transpile to c?

@The-Jon
Copy link
Author

The-Jon commented Apr 19, 2020

Yes, to support more architectures.

@andrewrk andrewrk added accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. labels Apr 20, 2020
@andrewrk andrewrk added this to the 0.8.0 milestone Apr 20, 2020
@andrewrk andrewrk changed the title Add "C" Target Add C as a target architecture Apr 20, 2020
@jayschwa
Copy link
Contributor

Interesting idea. Could a C target theoretically eliminate the need for the stage 1 compiler to be a separate implementation?

@andrewrk
Copy link
Member

andrewrk commented Apr 30, 2020

No because the point of bootstrapping is to go from source to generated code. Even if we committed the output of compilation (even if it is C code) to the repository, it would not make it source code, it would still be generated code.

It could potentially be done once, and then it would have to "fork" off, and get de-obfuscated and commented, and start being maintained separately.

@uael
Copy link

uael commented May 1, 2020

Related one #3772.
Really cool to see this feature accepted, I'm still stuck to C cause of custom architectures, this will be a big step forward!

@andrewrk
Copy link
Member

andrewrk commented May 1, 2020

Duplicated of already planned #3772

@andrewrk andrewrk closed this as completed May 1, 2020
@Vexu Vexu modified the milestones: 0.8.0, 0.7.0 Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Projects
None yet
Development

No branches or pull requests

6 participants