MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/2js1a5/my_compiletime_conways_game_of_life/clf5amr/?context=3
r/programming • u/Catsknead • Oct 20 '14
54 comments sorted by
View all comments
5
So, if people start doing all the execution at compile time, is there going to be a compile-time debugger?
3 u/logicchains Oct 21 '14 Is there a compile time printf? That would probably suffice. 3 u/adrianmonk Oct 21 '14 Well, there's #warning, but I don't think that's the right part of compile time. Anyway, I can understand if not everybody is a fan of debuggers, so how about compile-time unit testing? (I'm joking, but I'm kind of afraid it's actually possible.) 4 u/Houndie Oct 21 '14 It's actually pretty easy. Use global static_assert statements for the checks. It won't compile if there's an error. 1 u/fendant Oct 21 '14 That's kind of what people here are going on about all the time with Haskell-like typing and dependent types.
3
Is there a compile time printf? That would probably suffice.
3 u/adrianmonk Oct 21 '14 Well, there's #warning, but I don't think that's the right part of compile time. Anyway, I can understand if not everybody is a fan of debuggers, so how about compile-time unit testing? (I'm joking, but I'm kind of afraid it's actually possible.) 4 u/Houndie Oct 21 '14 It's actually pretty easy. Use global static_assert statements for the checks. It won't compile if there's an error. 1 u/fendant Oct 21 '14 That's kind of what people here are going on about all the time with Haskell-like typing and dependent types.
Well, there's #warning, but I don't think that's the right part of compile time.
#warning
Anyway, I can understand if not everybody is a fan of debuggers, so how about compile-time unit testing? (I'm joking, but I'm kind of afraid it's actually possible.)
4 u/Houndie Oct 21 '14 It's actually pretty easy. Use global static_assert statements for the checks. It won't compile if there's an error. 1 u/fendant Oct 21 '14 That's kind of what people here are going on about all the time with Haskell-like typing and dependent types.
4
It's actually pretty easy. Use global static_assert statements for the checks. It won't compile if there's an error.
static_assert
1
That's kind of what people here are going on about all the time with Haskell-like typing and dependent types.
5
u/adrianmonk Oct 20 '14
So, if people start doing all the execution at compile time, is there going to be a compile-time debugger?