vnmakarov / mir

A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
MIT License
2.29k stars 145 forks source link

Add _with_func methods for generating textual output of MIR #168

Open i509VCB opened 3 years ago

i509VCB commented 3 years ago

It is nice there are methods to output the binary MIR format via a writer function as described by MIR_write_with_func which is helpful for bindings to other languages where passing a FILE *f across the language barrier is annoying.

It would be nice if there were a similar method to write the textual output from MIR_output to a writer function.

vnmakarov commented 3 years ago

Sorry for delay with the answer and thank you for sharing your thoughts and proposal for MIR improvement.

This is not a big work, I can implement it soon when I resume my work on MIR project (approximately in a month).

You can also implement it by yourself and send me a pull request if you want to see it faster.