Coder Social home page Coder Social logo

compiled-templates's Introduction

Compiled templates

If you ever had to generate much IL, you are probably good and tired of the endless il.Emit(), il.Create() and il.InsertBefore(), not to mention MakeGenericInstance(). Emitting IL directly is very powerful, but being a low-level approach, it suffers from the usual problems of low-level approaches:

  1. syntactic bloat: difficult to see at a glance what the emitted code is doing
  2. you have to do the compiler's work in importing members, resolving overloads and constructing generics by hand
  3. impossible to step through the emitted code and run code coverage on it
  4. IDE integration (e.g. find all references) does not work

Compiled templates solve all these problems. Instead of a rat's nest of opcodes, the compiled templates library generates your emitted code from normal C# code decorated with some attributes. Emitted code retains the template's debug information, which means you can step through it and obtain useful code coverage. In slightly more complicated cases, you can pick and choose which parts of the template to apply, splice parts of the template into existing methods, or construct methods from parts.

compiled-templates's People

Contributors

atykhyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sakamata

compiled-templates's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.