Is M# a Code Generator or a Language?


Literally speaking, every language compiler is a Code Generator because it generates some low-level code from a higher level code. (think C# compiler to MSIL, or JIT compiler from MSIL to Native).

More recently the term "Code Generator" has used for certain tools that transform a database schema into a basic application code for CRUD operations (Create, Read, Update, Delete). There are plenty of these tools out there including: 

  • Iron Speed Designer
  • Code Smith
  • LLBLGen
  • ...

As you might have experienced yourself, such tools are incapable of handling the complexity of real world projects. They are agnostic to the fact that real world applications are way beyond CRUD. Their very nature make them too limited for handling:

  1. Multi-user security
  2. Workflows
  3. Business logic
  4. Complex user interfaces
  5. Customised and design-driven look and feel
  6. Integration with other systems
  7. ....

On the contrary, M# gives you a high level language with which you can define any structure, behaviour, logic, look and feel. Where the intended logic is beyond M#, you will be able to use C# to fill the gaps, without leaving M# or without having to manually modify the generated code. So you can keep building, changing, and regenerating the code and get absolutely everything done from within M#.

That makes M# architecturally a "language" as opposed to a "Code Generator" in the conventional sense.