Hacker News new | ask | show | jobs
by SeveredCross 5350 days ago
I agree with all of your points, though the only one I can address is the LINQ for source code quip and amend it somewhat to an already possible "LINQ for codebases." It should, in theory, be just a few weekends worth of work to use Mono.Cecil (https://github.com/jbevain/cecil) to provide a nice queryable API to inspect an (already compiled) codebase. I'm sure some nice static evaluation tools could be written based on this that nobody's thought of yet.

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.

3 comments

Roslyn will be good. It has to be because from what I understand, the MS team themselves will use Roslyn in Visual Studio and other products. Roslyn isn't just a public API for others to analyze code. It will be the foundation on which .NET framework languages will depend upon.

See Eric Lippert (Member of the Roslyn team, C# Principal) notes here:

http://blogs.msdn.com/b/ericlippert/archive/2011/10/19/the-r...

Well…I think Roslyn will be good, but I think it's reaching to say it must be because the MS team themselves will use it.

After all, these are the same people who invented (and used!) MFC, long known as the Microsoft Frustration Classes.

1992 called and wants its Microsoft stereotype back.
It was a joke, lighten up. For what it's worth, I'm a .NET developer and think it's awesome.
Well, MFC was actually a library. And I know it was a poor library. But this is a different ball game.

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.

I wrote a static code analysis tool with Cecil (you can write linq statements against your assemblies). And it is free. www.nitriq.com
as someone who's tried to use Mono.Cecil, it kind of sucks if you're not already developing on the Mono toolchain (among other things, there's no interoperability between System.Reflection types and Mono.Cecil types, and even if you're on Mono, I don't think you can "vivisect" running Assemblies.) Microsoft has a product called FxCop (http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx) which does style analysis and linting -- however, the code analysis is all embedded in the FxCop binary and undocumented.

suffice to say, I'm psyched about Roslyn -- more about code transformations than correctness aids.