Re:Effect Systems vs. Print Debugging: A Pragmatic Solution
by matheusmoreira on Thursday September 25, 2025 @02:18PM
(#45376734)
To do this you made the Debug effect a special case in the compiler. Won't users want to create their own special effect types? Could these special effects be expressed within the language itself instead of being compiler builtins?
[ Parent
| on HN ]
Re:Effect Systems vs. Print Debugging: A Pragmatic Solution
by jorkadeen on Thursday September 25, 2025 @03:28PM
(#45377752)
We can certainly extend it to a language feature-- if there are good use cases.
Do you have some specific special effects in mind?
Re:Effect Systems vs. Print Debugging: A Pragmatic Solution
by morcus on Thursday September 25, 2025 @05:03PM
(#45379056)
Disclaimer: I don't know much about this programming language or about Effects, so there may be a better way to do this already
something I'd sometimes like to do when I'm profiling complex code will be to have an (essentially) global variable tracking the sum of how long a function took to execute over all invocations.
I am guessing that mutating the global counter would count as an effect, and I wouldn't really want to add the effect all the way through the call graph. I think this is something where the handling ought to be similar to how you're handling Debug.