News for hackers. Stuff that matters.
Re:Small Joys with Odin by crdavidson on Friday July 21, 2023 @11:02AM (#36814639)
Ooh, hadn't seen @disable before, super useful to know! That'll be handy for doing toggleable build options for tracing / debugging.

I've been using Odin for about a year now, many of the pain-points I've had have just been knowledge gaps. Odin's docs and debug info have slowly gotten better over time, and little discord-community tips here and there have made a huge difference for my quality of life.

Re:Small Joys with Odin by memco on Friday July 21, 2023 @11:51AM (#36815281)
I was curious after reading: can the @disable behavior be modified at runtime? For long running programs I find it helpful to be able to set a certain log level up front but have a way to update it without rebuilding or restarting the program. There may be other operations that can’t immediately be shut down and restarted so requiring a rebuild or restart to get debug logs is not an option in those cases.
Re:Small Joys with Odin by zannzen on Friday July 21, 2023 @12:06PM (#36815512)
It cannot, it's purely a build-time feature. The disabled proc isn't even in the binary if you disassemble it.

Also for the record I just noticed I wrote @disable everywhere instead of @disabled. That's been fixed now

Re:Small Joys with Odin by munificent on Friday July 21, 2023 @12:32PM (#36815900)
@disabled is neat. C# has long had the same feature: the [Conditional] attribute.