CompTime.jl
CompTime.jl copied to clipboard
Optionally generated functions
I think one of the nicest things about this package is that it naturally gives access to the comptime and runtime versions without the user needing to repeat themselves. Therefore, I think it makes a lot of sense for this to create optionally generated functions by default rather than plain generated functions.
This PR makes the @ct_enable macro create optionally generated functions by default which fall back on the runtime definition at the compiler's discretion.
IMO this is a better default than non-optionally generated functions because it can save a lot of useless compile times in dynamic circumstances, and we can let users opt out by writing things like
@ct_enable optional=false function ...
This is just a suggestion as to how I'd approach it, but feel free to request that the default be non-optional and force users to opt into the optionally generated functions.
Bump @olynch
Oh shoot! I totally didn't see this @MasonProtter. I will look at it now.
OK, I understand what this is doing now. I have to integrate it a little with some unpushed work, but hopefully I can merge this today. Sorry, I almost never check my github notifications, and I wasn't expecting anyone to send me a PR. In the future, definitely bug me on zulip if I'm not merging something.
@MasonProtter I'm so sorry this took so long; thank you for the PR! I should be more responsive now; I was finishing my thesis May-July, and I've now started working fulltime on Julia stuff.
No problem! I know how these things go.