Skip to content

Comment on Effect Systems vs. Print Debugging: A Pragmatic Solutionparent

Comments

We can certainly extend it to a language feature-- if there are good use cases.

Do you have some specific special effects in mind?

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.