| ▲ | galangalalgol 3 hours ago |
| Const generic expressions are still being worked. They are what is blocking portable simd. They are also a much cleaner way to implement things like matrix operations or really anything where a function with two or more arguments of one or more types returns things that have types that are a combination or modification of the input types. |
|
| ▲ | zozbot234 2 hours ago | parent [-] |
| The problem AIUI is that "const generic expressions" in full generality are as powerful as dependent types. It's not clear to me that the Rust folks will want to open that particular can of worms. |
| |
| ▲ | galangalalgol 2 hours ago | parent [-] | | I thought dependent types were types that depended on a value? What they are proposing are types that depend on types or compile time constants. | | |
| ▲ | zozbot234 2 hours ago | parent [-] | | The problem is combining the "const generic" and "expression" part. If your "compile time constants" can actually be complex expressions, you arguably end up with the same kind of generality as dependent types. This is true even for expressions that are only evaluated in a compile-time context, since dependently-typed languages do "everything" at compile time anyway, they don't have a phase distinction where you can talk about "runtime" being separate. | | |
| ▲ | galangalalgol 2 hours ago | parent [-] | | Ah, yeah! I get it now. So c++ is a dependently typed language. That is hilarious. I want lisp syntax in c++29. That said, too many features are blocked on const generic expressions, so I think they are going to have to bite that off. There is already talk about migrating proceduralacros to be something more like normal rust, this moght fit in with that. |
|
|
|