On 8/6/25 7:52 AM, John Ericson wrote:
The old C-style was cumbersome make making one responsible for manually
create and pass a closure (separate function and *_info class for
closed-over variables).

I would have liked to redo this with C++ lambdas, so we could:

- derive environment types implicitly
- have fewer stray static functions
- make the return-type polymorphism type safe.

But I was advised on IRC that introducing template specializations in
the driver would a open compile time performance can of worms. It was
instead suggested I do it the old OOP way: this patch.

Hmm, I would be surprised if it had any impact on build time.

But this way is certainly a nice simple adjustment.

The old OOP way I don't really like, as it doesn't really reduce
boilerplate, but at least the environment accessing is well-typed now
(no `data` to `info` casts), and the `info->` boilerplate is also gone.

Most of the diff is just fixing the indent after moving the functions
inside the new classes.

How about defining the member functions outside of the classes to avoid needing to change indentation?

Jason

Reply via email to