kevin-montrose / Jil

Fast .NET JSON (De)Serializer, Built On Sigil
MIT License
2.15k stars 253 forks source link

Compile-time code generation #336

Open kg opened 4 years ago

kg commented 4 years ago

Is compile-time code generation something that would be possible given Jil's design? There are scenarios where runtime IL compiles aren't feasible (iOS, xbox, etc) or will drop you into the interpreter. If I know all the types I'm going to be serializing I could definitely run a generator in my build pipeline to spit a .dll out next to my executables and ship it (like XmlSerializer) but it's not clear to me whether I could do something like this on top of Jil since runtime code generation seems central to the design.