Full range of modifiers (ie static, virtual, sealed, etc)īut even with those limitations it’s still possible to write some basic programs.Method calls (static, instance and “this”, on built in and custom defined types)īig things currently missing (most are trivial plumbing, but I’ve just not had time or inclination yet) –.The source code for the compiler is here. ![]() Which means you can do it too – it took me less than a month. But despite these limitations I have a fairly capable C# 0.5 compiler (in that it is a subset of the C# 1 compiler). Now, I didn’t do any compiler theory in uni, I’ve never written a compiler before and I’ve only ever looked at Reflection Emit in anger. Interestingly we had the similar idea at the same time about writing a parser & compiler for C#. NET today – it covers parsing and compiling actual code from SmallBasic. Phil Trelford’s excellent series on writing a SmallBasic compiler has to be the the best intro to building a compiler in. It was this desire to play with language features that MS are not going to implement that drew me to writing my own C# compiler. But I can understand the desire from users to at least open source Roslyn (especially as it doesn’t run on Mono according to Glenn Block of ScriptCS fame – although I haven’t verified this myself). I get this – it would be fairly terrible if every codebase was C# + custom changes. To make matters worse, it is not one of the goals of Roslyn to allow language extensions – C# spec is still owned by the C# team, and Roslyn wont allow you to add your own syntax. But I had a number of ideas for improvements, and unfortunately only two are in C#6 (primary constructor and read-only auto-properties). Mads’ justification seems reasonable on the face of it – C# 2, 3,4 & 5 have all had major new language additions (namely generics, linq, dynamic & async) and that C# 6 is more of a ‘tidy the pain points’ release. After Mads talk, and listening to the (proposed) new features for C# 6 I couldn’t help but feel a little underwhelmed with the direction of C#. ![]() Roslyn is a Microsoft project to rewrite the VB and C# compilers in their respective languages. ![]() Mads Torgersen repeating what I said a year ago Roslyn
0 Comments
Leave a Reply. |