Hacker News new | past | comments | ask | show | jobs | submit login

I'm not sure about Zig, but in Nim compile-time code produces a stack trace just like run-time code. But perhaps you are talking about debugging using a debugger like GDB? That is indeed not supported. But using a simple `print` statement is enough in most cases for debugging.



Yeah he's definitely talking about a full fledged debugger like GDB. For the most part yeah, some print statements will get the job done, but that's a serious pain in the ass if you've got a ton of variables that you need to look at. Significantly simpler to just be able to look at everything at once. Also, I'm unfamiliar with Zig, but is it even possible to print anything from your code during compilation? Seems like you wouldn't be able to do that.


In libbug you can do anything at compile time. Open and write to files, run a test suite, anything. http://billsix.github.io/cac.html


Very cool!


Yes, I was talking about full-fledged debugger. Even VC++ quite often prints the whole stack when there is an error in template code, but the messages can be tens of lines long, and sometimes do not contain all the necessary information. This and long compile times are the reason why many people tend to avoid templates and template metaprogramming.


It shouldn't be too hard to incoroprate the debugging of compile time computation.


Indeed, yet nobody does that.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: