Dialects and the C API

Yeah, I’ve been wondering that myself as working on the npcomp dialects (which have custom registration and typically some accessors for types/attributes, as you say).

If that’s the case, then this primarily becomes a code organization mechanism within the core dialects then. It would be nice to have a pattern, though, that downstreams could follow – versus just being completely ad-hoc. I ultimately want to be able to generate standalone shared libraries for each dialect, and that is going to be a mess without some standard way of doing it.

I think that each C-exported dialect really needs to grow its own capi header and cc file, and that we can have a tablegen backend for the boilerplate. This would also be a handy place to define the transformations that are implemented by the dialect (I think).

1 Like