Microsoft previews Roslyn: .NET Compiler-as-a-Service infrastructure
msdn.microsoft.com
msdn.microsoft.com
http://blogs.msdn.com/b/ericlippert/archive/2011/10/19/the-r...
Platforms are a mode of operating when providing, on an ongoing basis, something that third parties use. There are several "promises" around platforms: a promise not to break compatibility, a promise not to coopt client software features, and - oddly enough - a promise to be incomplete, so that third parties have opportunities to build.
From http://msdn.microsoft.com/en-us/hh500769
I agree with the parent. Yegge's platform rants is what I thought of, too.
1. Measuring code complexity. I've often felt that code complexity can be gauged several ways, and one is the number of "if" statements (or select..case). Being able to query the code base of an extremely large solution is a big step in that direction.
2. Being able to "query" the call stack - how do I get from this line to the base constructor of my "user" object. Rather than stepping through the debugger, it could be a query of the code base to find the path from here to there.
3. Detecting bit-rot. Finding any method class that's simply never used could be another "query" of the code base. Yes, proper test-coverage would help detect this, but not every production system has unit tests.
4. I've worked on projects in the past where we really wanted to add guid tracing to the preamble of each function to dynamically trace the code at run time. If Roslyn supports "update" queries of the code, it might be easy to add such a feature across the whole code base (or perhaps only classes that inherit from some known base class).
Managing a code base like this (rather than grepping/searching) is a powerful concept. Perhaps we could see a LINQ for source code some day?
That said, being able to inspect the source-code pre-compilation is a whole other level above and beyond—as a fan of the compile-time safety that statically-typed languages provide, any opportunity to eliminate bugs and complexity before the code makes it to a customer is a welcome one, and if Roslyn is good, it could be huge.
See Eric Lippert (Member of the Roslyn team, C# Principal) notes here:
http://blogs.msdn.com/b/ericlippert/archive/2011/10/19/the-r...
After all, these are the same people who invented (and used!) MFC, long known as the Microsoft Frustration Classes.
With Roslyn, they are going to write C# compiler in C# itself (and VB compiler in VB). And if they expose this as an API, it's guaranteed that I will be able to parse every valid C# file.
suffice to say, I'm psyched about Roslyn -- more about code transformations than correctness aids.
1. ReSharper has a plugin to analyze cyclomatic complexity. http://confluence.jetbrains.net/display/ReSharper/Cyclomatic...
2. ReSharper has Call Tracking and Value Tracking.
http://www.jetbrains.com/resharper/features/code_analysis.ht...
3. Once again, if you are not shipping code to outside customers, you can use Solution Wide Analsys to find out unused code.
http://www.jetbrains.com/resharper/features/code_analysis.ht...
4. PostSharp helps you with your Aspect oriented programming.
http://www.sharpcrafters.com/postsharp/features
ReSharper is already very powerful, imagine if they don't have to write their own lexer and parser and can use the lexer/parser used by the C# compiler. I think they can build more useful features and users are isolated from bugs in their lexing/parsing.
I think this is an amazing development and I can't wait for this to go live so that there will be many products like Resharper helping us analyze and improve our code.
Relevant SO thread: What would you do with Compiler as a Service.
http://stackoverflow.com/questions/4222524/what-would-you-do...
It was innovative too, in the late 50's...
Interesting demo during BUILD: http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-816T
You can skip to 35:40ish
Cool presentation from MSR: http://research.microsoft.com/apps/video/?id=152281
You can skip to around 5:00
That aside, it's exciting to have the ability to have both.
I think it's ridiculous to thumb down the parent just because he misunderstood this.