You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: support using the compiler as a zig.zon package #18834
Use the native zig backends (once they are ready, of course) as an alternative to using libLLVM*.a
Use the compiler as a library
Use case 2 is what I'm in need of since I want to make an alternative to Nix flakes but with a flake.zig. A build.zig does not fit my use case since I want to have a nix-like CLI with a zix develop similar to nix devShells. This would mean using the compiler to parse the flake.zig, checking types and running the outputs function to extract devShells.default.
Related to this, a similar idea I had was being able to use the zig compiler as a library, such that one could use zig as a scripting language.
You would be able to embed the compiler as a library, then have it compile different zig files at runtime into dylibs. This would allow you to use zig for the same purposes as one currently uses scripting languages like lua.
The advantage to this would be that there would not be any complex interfacing functions or anything required. Zig can easily interface with other zig code since it's the same language.
The use case for this would be things that need to be easily user extensible, such as games and text editors.
Reacted by 16hournaps, Visen, Nir Lahad, df51d, Will Lillis and U-Zyn Chua
yeah the solution to this is to get the compiler in the std.zig namespace not expose it with zon imo. but its a ways out and easier to do once development isnt as rapid (thus making movements cause a wave of merge conflicts)
Reacted by Theo Paris, Visen, Arnau Camprubí, Paperdev and Max Milton
No. I have given up on using zig after what happened on the Zig discord. Additionally, there is nowhere else for me to go because it is the only active Zig community.
I have moved to rust and c++ and I do not intend on coming back until the Zig community deals with these horrible moderators/contributors.
Reacted by Arnau Camprubí, InKryption, Kauê 地球の土星人 and Sayan J. Das
Regardless of your feelings about the Zig community, it would still be worthwhile to keep the issue open because it allows the Zig developers (distinct from the community) to track it. You can re-open and then click "Unsubscribe" on the sidebar to not receive notifications about it.
Reacted by Arnau Camprubí, Jozef Steinhübl, InKryption, Tristan Ross, Visen and Will Lillis
Activity
Arnau478 commentedon Feb 6, 2024
The parser and lexer are already on the
std. Maybe what we should do is move the other stages to thestdas well.VisenDev commentedon Feb 6, 2024
+1
Related to this, a similar idea I had was being able to use the zig compiler as a library, such that one could use zig as a scripting language.
You would be able to embed the compiler as a library, then have it compile different zig files at runtime into dylibs. This would allow you to use zig for the same purposes as one currently uses scripting languages like lua.
The advantage to this would be that there would not be any complex interfacing functions or anything required. Zig can easily interface with other zig code since it's the same language.
The use case for this would be things that need to be easily user extensible, such as games and text editors.
nektro commentedon Feb 6, 2024
yeah the solution to this is to get the compiler in the
std.zignamespace not expose it with zon imo. but its a ways out and easier to do once development isnt as rapid (thus making movements cause a wave of merge conflicts)VisenDev commentedon May 12, 2024
@theoparis has this been implemented?
theoparis commentedon May 13, 2024
No. I have given up on using zig after what happened on the Zig discord. Additionally, there is nowhere else for me to go because it is the only active Zig community.
I have moved to rust and c++ and I do not intend on coming back until the Zig community deals with these horrible moderators/contributors.
sin-ack commentedon May 13, 2024
Regardless of your feelings about the Zig community, it would still be worthwhile to keep the issue open because it allows the Zig developers (distinct from the community) to track it. You can re-open and then click "Unsubscribe" on the sidebar to not receive notifications about it.