logoalt Hacker News

CathalMullanyesterday at 7:36 PM2 repliesview on HN

There are plans to experiment with language level comptime support too: https://github.com/rust-lang/rust/pull/148820


Replies

zozbot234yesterday at 10:39 PM

This is a very interesting feature, especially if comptime can become a true language superset with features such as the ability for seamless type-level programming, leveraging `const fn` code throughout. This would unlock the potential for having true dependent types in (the comptime portion of) Rust programs, and write arbitrary end-to-end compiler-verified proofs about code that will ultimately run in the final program.

smj-edisonyesterday at 9:40 PM

Oh my gosh, that would be incredible! In one of my rust projects, I used enum dispatch so simple functions could be inlined, but it used a slightly hacky macro that couldn't do static dispatch. One of those things that comptime matches very well.