google-research / dex-lang

Research language for array processing in the Haskell/ML family
BSD 3-Clause "New" or "Revised" License
1.58k stars 107 forks source link

Add a built-in "print absolutely anything" function #1202

Closed dougalm closed 1 year ago

dougalm commented 1 year ago

The goal is to make this the default printing path and remove Interepreter/Serialize to unblock #1188. It'll also let us debug-print any dex value at runtime. There's still work to do in adding all the cases but I think it's worth merging this for now.

dougalm commented 1 year ago

So, is generating code to print every possible type of value, inline, going to lead to bloated IRs and compile times?

We'll see. My hope is that the sorts of values we like to print have relatively small types. If it's an issue, the next step would be to add @noinline as you say.