upvote
GPU compilation is definitely something I intend Valen to support. I wrote about it back in 2022, [0] and I learned a lot of lessons on how to do it (and how not to do it!) from working on the Mojo compiler.

The biggest decision for Valen is what to lower to:

* Rust MIR, since rustc has CUDA now, [1] (perhaps other cards soon?)

* SPIR-V, like Zig does for its GPU compilation [2]

* MLIR

Rust MIR is looking pretty nice. Valen already has Rust interop by doing some rustc sorcery, [3] and it would be somewhat straightforward to switch from emitting LLVM to emitting Rust MIR. I just need to figure out if Rust MIR can support the optimizations I have planned for Valen.

In a perfect world, Rust would be able to lower its MIR to MLIR, since MLIR has so many backends. I recall there were some efforts to do that, unsure where that ended up.

[0] https://verdagon.dev/blog/next-gen-languages-gpu

[1] https://developer.nvidia.com/blog/introducing-cuda-rust-two-...

[2] https://ziglang.org/devlog/2026/#2026-06-26

[3] https://verdagon.dev/blog/golden-spike-reviving-vale-valen

reply
reply
I don’t want to hijack Evan’s post by posting a link, but if you’re interested I’ve implemented many of the ideas in that presentation in the language I’m working on. You can check out the latest link in my post history for a rundown of how it works and a demo.
reply
Feel free to talk about it here, would love to hear about it!
reply
I'll submit a post to HN soon, probably not on r/programminglanguages since I'm using more AI than they'd appreciate in my work these days.
reply
is it the mech-lang?
reply