Skip to content

Conversation

Techatrix
Copy link
Member

This removes the dependency on Zig for showing ast-check diagnostics.
This is also the starting pointer for integrating AstGen based analysis into ZLS.

@SuperAuguste SuperAuguste added the pr:fuzz Attach to a PR to start fuzzing / continually fuzz (please do this before merging!) label Feb 14, 2023
@g-w1
Copy link
Contributor

g-w1 commented Feb 14, 2023

I believe it should be LICENCE -> LICENSE :)

@llogick
Copy link
Contributor

llogick commented Feb 20, 2023

Something that occurred to me after the multi-object-for change — Have you considered how the embedded ast-check would handle codebases meant to be compiled with older compiler versions? Theoretically, if ZLS (w/ embedded AstGen) gets compiled with 0.11.0-dev.1681+0bb178bbb but then someone tries using it with an earlier compiler version, wouldn't they get error diagnostics for their for loops?
The obv solution is to have prefer_ast_check_as_child_process set to true by default, but also something to consider before going forward with deeper integration of compiler components.

@truemedian
Copy link
Contributor

zls master is only intended to really work with zig master, they update in lock-step. zls gets pinned in time for the zig releases to fix this exact problem.

@llogick
Copy link
Contributor

llogick commented Feb 20, 2023

zls master is only intended to really work with zig master, they update in lock-step. zls gets pinned in time for the zig releases to fix this exact problem.

I know, but keeping build_runner.zig backwards compatible says otherwise 😀

@leecannon
Copy link
Member

leecannon commented Feb 20, 2023

We do try to keep the runtime zig version requirements as wide as possible by making sure the build runner can run on as many versions as possible but we only do this as a best effort.

As @nullptrdevs points out the multi-object for is a breaking change to the language (for (a) |*item, i| is no longer valid) this means the embeded ast-check will find valid 0.9.1/0.10.1 code as invalid which means that with this change zls will only support zig versions after the multi-object change (which is a good excuse to simplify the build_runner to remove all the compatibility stuff)

@SuperAuguste
Copy link
Member

On its own, this PR does not make sense, but in the wider picture Techatrix painted in the Discord of using ZIR for analysis and eventually comptime interpreting, it absolutely does. I believe that for now, it would make the most sense to have prefer_ast_check_as_child_process set to true by default.

Copy link
Member

@SuperAuguste SuperAuguste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been thinking this PR through and, at first I was a bit skeptical, but YOLO.

I guess we're getting closer and closer to becoming zig-analyzer huh :P

@SuperAuguste SuperAuguste merged commit 471d971 into zigtools:master Apr 2, 2023
@Techatrix Techatrix deleted the stage2-zir branch May 5, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:fuzz Attach to a PR to start fuzzing / continually fuzz (please do this before merging!)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants