Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 914975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:48:32+00:00 2026-05-15T17:48:32+00:00

In Anders Hejlsberg’s .NET 4.0 presentation he discussed in NET 5.0 (or some future

  • 0

In Anders Hejlsberg’s .NET 4.0 presentation he discussed in NET 5.0 (“or some future release”) they are working on a “Compiler as a Service” model.

Anders Hejlsberg’s states: [source][1]
“We want to open up our compiler so it becomes an API you can call to compile a piece of code and get back expression trees and/or IL. This enables a whole host of scenarios, such as application programmability, an interactive prompt, user-written refactorings, and domain specific languages that have little islands of C# imbedded in them.”

I’m struggling to find a real world example where this could actually be useful. Am I missing the major concept here? or is this really going to benefit the language?

[1]: http://www.simple-talk.com/opinion/geek-of-the-week/anders-hejlsberg-geek-of-the-week/ Compiler as a Service

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:48:33+00:00Added an answer on May 15, 2026 at 5:48 pm

    For some problems, it is easier to write a program that can generate a program that will solve the actual problem. One area where this is particular useful is for building parsers for compilers.

    In other cases, you can generate code on the fly which can be tailored to provide optimum performance when working with a particular data type, about whose properties you just learned at runtime by reflecting over its metadata. One example I can give you for that is my Modelshredder project. What it basically does is taking all the fields and properties of an object and packs their value into an object array.

    My first approach to that problem was hand coded MSIL injection using Reflection.Emit. The second approach was a little more dynamic and relied on Expression Trees, which can effectively be constructed and compiled at runtime to provide the same functionality as my hand coded MSIL injection. You can see that realised in the MoreLinq trunk (just have a look at the Modelshredder site, there’s a link for that). Having Compiler as a Service would actually allow me to raise abstraction level and emit C# code which will then get compiled to MSIL.

    The case for Domain Specific Languages has already been made, also I think that an imperative language like C# is not well-suited for the “command line” scenario but rather than for bigger scripts.
    There’s a neat make system based on an F# DSL called FAKE, which borrows a lot of concepts of Compiler as a Service. Similar concepts are employed by the F# Interactive Window (is it called that way?) inside VisualStudio.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was watching Anders' talk about C# 4.0 and sneak preview of C# 5.0
In his PDC talk, Anders said that the dynamic keyword would dispatch any function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.