CompTime.jl icon indicating copy to clipboard operation
CompTime.jl copied to clipboard

Optionally generated functions

Open MasonProtter opened this issue 3 years ago • 3 comments

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.

MasonProtter avatar Mar 29 '22 23:03 MasonProtter

Bump @olynch

MasonProtter avatar Apr 21 '22 18:04 MasonProtter

Oh shoot! I totally didn't see this @MasonProtter. I will look at it now.

olynch avatar May 01 '22 19:05 olynch

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.

olynch avatar May 01 '22 19:05 olynch

@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.

olynch avatar Aug 19 '22 18:08 olynch

No problem! I know how these things go.

MasonProtter avatar Aug 19 '22 18:08 MasonProtter