4 ms·
AFAICT this does not really use Rust, or the Rust type system at all. This is just a procedural macro that parses "Rust-like" syntax into an AST, and then 1:1
by fluffything 7y ago
AFAICT this does not really use Rust, or the Rust type system at all.
This is just a procedural macro that parses "Rust-like" syntax into an AST, and then 1:1 fold that AST into OpenCL. This AST is not type checked, and if you were to, for example, replace the usage of an `u32` in there with a `type U32 = u32;` then parsing will probably fail, because the proc macro doesn't know what `U32` means.
The OpenCL code that gets dumped into a byte string, is compiled at run-time by your graphics driver. The proc macro can probably, at best, try to verify that it is correct at compile-time, by passing the dump to some OpenCL verification tool, but it does not appear to be doing that right now.