Comments (1)
This idea was inspired by Jonathan Blow's language but I'm fairly confident in my decision now that we will not have a macro to run code at compile time.
Instead, Zig will have a build.zig
file which replaces configure / cmake / gyp / ninja / make etc. This file is executed at compile time and creates the build description. Where in most projects the thing you do is configure, make, make install, with zig projects it will be:
zig build [args]
(executes build.zig)
zig build --install [args]
(again executes build.zig)
build.zig will import a library to assist in common tasks such as building zig executables, libraries, and shared objects. The library will also assist in other common tasks such as building C/C++ code and executing arbitrary commands.
So if you wanted to run code at compile time, no problem, just have build.zig import that code, run it, potentially save the output to another .zig file, and then import that in your other file.
from zig.
Related Issues (20)
- C translation issue with downcasting pointer HOT 3
- Inefficient code generation of `@mod` and `@divFloor` HOT 4
- Improve `std.StaticStringMap.initComptime` HOT 6
- Support more hash algorithms in the package manager HOT 1
- build system caching run step false negatives regression HOT 1
- Memory leaks or not? HOT 2
- Incorrect @wasmMemoryGrow codegen for wasm64 target
- `std.options.crypto_always_getrandom` ignores overridden `std.options.cryptoRandomSeed` HOT 2
- `standalone_test_cases.stack_iterator` tests fail on Gentoo Linux x86_64
- Missing optional for lpName param on std.os.windows.kernel32.CreateEventExW HOT 1
- failed assertion in `writeManifest` consecutively using `zig build run` HOT 1
- Missing null terminator on various kernel32 signatures
- C interop: expected type `bool` found `c_int` HOT 6
- Const pointer with large array size doesn't throw any compiler error
- `readPackedIntBig` reads from end of array
- BoundedArray segfaults for items larger than stack HOT 1
- Compiler gets stuck in Infinite (so far) loop HOT 4
- Cannot directly access method of pointer to struct from HashMap's iterator HOT 4
- LLVM Basic Block has no termintor error when calling `@errorName` with `@as(error{}, undefined)` HOT 1
- anon union initialization at runtime reaches unreachable code HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zig.