compiler-as-a-service

What are the benefits of Compiler as a Service

断了今生、忘了曾经 提交于 2019-12-13 12:59:41
问题 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

Is it possible to call C# lexical/syntactic analyzers without compilation?

拈花ヽ惹草 提交于 2019-12-07 10:08:20
问题 Considering this question of SO, where whole C# in-memory compiler is being called. When only lexical and syntactic analyzing is required: parse text as a stream of lexemes, check them and exit. Is it possible in current version of System.CodeDom.Compiler, if not - will it be? 回答1: If you can use Mono, I believe it has a C# parser/lexer you may be able to use. Here's a link to look into. As for what the MS C# team is planning to do, there is some talk of at some point making the C# compiler

what is the state of the “C# compiler as a service ” [closed]

∥☆過路亽.° 提交于 2019-11-27 21:55:13
Back at the PDC in 2008, in the C# futures talk by Anders Hejlsberg he talked about rewriting the C# compiler and providing a "compiler as a service" I certainly got the impression at the time that they were targeting the C# 4.0 timeframe for this.... Well, does anyone know what the state of this is? it doesn't seem to be there in the CTP and there is almost no information on the WEB apart from links to the 2008 PDC session video (roughly an hour in). Has this initiative gone dark? Certainly not C# 4.0. We are just finishing up the last few bug fixes for C# 4.0. This direction for the toolset

Can I use Roslyn for compile time code rewriting?

牧云@^-^@ 提交于 2019-11-27 21:20:28
For example I have class Foo: INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public int Bar {get;set;} } Can I get the Foo class AST and rewrite Bar, in compile time, to public string Bar { get { return this.bar; } set { if (value != this.bar) { this.phoneNumberValue = value; PropertyChanged(this, new PropertyChangedEventArgs("Bar")); } } } . Compile time re-writing isn't directly supported by Roslyn today, but syntactic and semantic transformations definitely are. In fact, take a look at the "ImplementNotifyPropertyChanged" sample included in the CTP to see

what is the state of the “C# compiler as a service ” [closed]

给你一囗甜甜゛ 提交于 2019-11-26 23:06:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Back at the PDC in 2008, in the C# futures talk by Anders Hejlsberg he talked about rewriting the C# compiler and providing a "compiler as a service" I certainly got the impression at the time that they were targeting the C# 4.0 timeframe for this.... Well, does anyone know what the state of this is? it doesn't

Can I use Roslyn for compile time code rewriting?

爱⌒轻易说出口 提交于 2019-11-26 20:37:44
问题 For example I have class Foo: INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public int Bar {get;set;} } Can I get the Foo class AST and rewrite Bar, in compile time, to public string Bar { get { return this.bar; } set { if (value != this.bar) { this.phoneNumberValue = value; PropertyChanged(this, new PropertyChangedEventArgs("Bar")); } } } . 回答1: Compile time re-writing isn't directly supported by Roslyn today, but syntactic and semantic transformations