News for hackers. Stuff that matters.
Re:Announcing the new Roslyn-powered .NET Framework Referenc... by sytelus on Monday February 24, 2014 @02:49PM (#7293011)
Here's very cool example of what compiler as service can do: let's say you want extend SQL so that you can write C# expressions in SELECT like this:

  SELECT MyClass1.Method1(ColumnA, Math.Round(ColumnB))
  FROM Table1
Another example is you can extend your scripting language so that user can use full power of Linq.

So in otherwords, you can extend any of your little languages so that you can mix C# in it. Considering C# supports tons of functional features, Linq, anonymous types, dynamic types etc this can really beef up host language.

Re:Announcing the new Roslyn-powered .NET Framework Referenc... by taspeotis on Monday February 24, 2014 @03:52PM (#7293363)
For what it's worth if you set up your SQLCLR assemblies right, that line of Transact-SQL can run just fine now, on SQL Server 2005 and later.
Re:Announcing the new Roslyn-powered .NET Framework Referenc... by noblethrasher on Monday February 24, 2014 @02:53PM (#7293030)
I thought that Roslyn expressly did not support extending the language.
Re:Announcing the new Roslyn-powered .NET Framework Referenc... by taspeotis on Monday February 24, 2014 @04:12PM (#7293440)
My understanding is that you use Roslyn to use C# anywhere. It can parse expressions and compile and execute them.

E.g. If you're writing a BASIC interpreter:

    10 PRINT "Hello World"
    20 CSHARP "Console.WriteLine(42);"
    30 GOTO 10
You call Roslyn on line 2 with the expression to parse and execute.
Re:Announcing the new Roslyn-powered .NET Framework Referenc... by Guvante on Monday February 24, 2014 @04:45PM (#7293608)
Roslyn expressly does not support accepting the entire string that he provided. So if you want SQL wrapping C#, Roslyn won't support it until (and if) it supports SQLCLR.

However what Roslyn does support is "transform this snippet for me", which is useful if you know the boundary between your code and code it cares about.