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
zig build --init should create a working hello world, and it should be in the test suite #1035
Comments
@andrewrk Maybe also rename |
|
I like option 1 because it forces the programer to think which init procedure they would like. |
|
@viluon this is too much like rust and there are times that you can forget if lib or bin is the default. Option 1 is better because it forces the programer to think/choose. |
When I am building a library, I find it useful to also create examples of using the library, so I tend to create single projects that build both library and executable artifacts. At least with CMake, this is possible, if clearly not the most easily supported option. Would this be allowed with this notation?
Personally I like the idea of separating the idea of initializing the project from the type of project it will be. That allows for future additions without quite as much additional syntax (though this is minor). The built in test parts of zig make the utility of additional executables a bit less interesting, but I find that for any reasonably sized library, having a working example to start from is very handy. |
I went ahead with @kyle-github Indeed zig build does support building any combination of executables and libraries, but I'm not sure how deep we want to get into providing code templates. I think that "hello world" for executables and libraries goes a long way, perhaps as far as we need to go. |
Right now the
zig build --init
template is bitrotted again. Fix it, and then let's update it so that it creates a working hello world example, and add that to the test suite.The text was updated successfully, but these errors were encountered: