Where would you use C# Runtime Compilation?

前端 未结 7 1330
余生分开走
余生分开走 2021-02-20 05:34

I happened upon a brief discussion recently on another site about C# runtime compilation recently while searching for something else and thought the idea was interesting. Have

7条回答
  •  长情又很酷
    2021-02-20 06:20

    I used runtime compiler services from .NET in my diploma thesis. Basically, it was about visually creating some graphical component for a process visualization, which is generated as C# code, compiled into an assembly and can then be used on the target system without being interpreted, to make it faster and more compact. And, as a bonus, the generated images could be packaged into the very same assembly as resources.

    The other use of that was in Java. I had an application that had to plot a potentially expensive function using some numerical algorithm (was back at university) the user could enter. I put the entered function into a class, compiled and loaded it and it was then available for relatively fast execution.

    So, these are my two experiences where runtime code generation was a good thing.

提交回复
热议问题