Coffeehouse Thread

14 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Code Name Roslyn

Back to Forum: Coffeehouse
  • User profile image
    felix9

    Eric Lippert just blogged about the code name of Compiler-as-a-Service project of .NET languages: Roslyn

  • User profile image
    vesuvius

    I first noticed this in Anders PDC 2010 demo on async towards the end with the hope that the compiler project he used was available to download somewhere.

    I think this is interesting and useful, but I am not in the compiler business, so I shall wait till it is a part of Visual Studio 2012 or 2014

  • User profile image
    Adam​Speight2008

    I didn't get why having the Compiler-as-a-Service is a good thing?

    The only things I've seen are a REPL (Anders's PDC demo) and tools for the IDE.

    What use will it serve in "normal" applications?

    I define normal as standard business applications.

    "Will it make Office run any faster?" 

  • User profile image
    figuerres

    , Adam​Speight2008 wrote

    I didn't get why having the Compiler-as-a-Service is a good thing?

    The only things I've seen are a REPL (Anders's PDC demo) and tools for the IDE.

    What use will it serve in "normal" applications?

    I define normal as standard business applications.

    "Will it make Office run any faster?" 

    WOW!

    Uh I can see a *LOT* of use for this kind to stuff.....

    for example if i want to create a tool that allows the user to define some rules for an application.

    i can possibly create a visual editor and use the compiler services to generate the assembly and then i can serialize it and run it ....

    large business systems often need some kind of "rules engine" to allow some customized logic.

    thats one area for a start.

    yes a lot of the uses will be in building tools.....

    but that can lead to "Making office run faster" (or whatever app you are making)

    why?

    well in stead of just generating C# code and compiling it you might have a tool that generates code and then ask the compiler to return a graph and then you may be able to examine the graph and modify it to optimize it and then feed that back to the compiler and generate a better assembly in the end.  in most cases the compiler will do a good job but in others you may have insight into the problems the application will have at runtime that the compiler can not today ever know about.

    and last is what if the app can re-build it's own code at runtime ?  re-compile parts of it's own IL to make it run faster on a given pc ?  collect performance data while it runs and decide that it can get beter perf if it re-generates part of it's code.

  • User profile image
    rhm

    There's lots of occasions now where you want to write a program that is customisable by the user (often another developer) in some way. Right now you have some options: Iterate over a data structure at runtime, effectively you are writing an interpreter; generate C# code and call the compiler, then load the assembly (this is more or less what ASP.NET does); Use Reflection.Emit to generate an assembly in memory. The first option is slow (relatively speaking, it might still be adequate), the second option is clunky and the third option is way too much effort to implement for most people as it involves knowing CIL and how to compilers translate high-level constructs into it.

    Compiler-as-a-service lets you generate fast code at runtime without the clunkiness. Useful for web template engines, implementing macro facilities in applications, aspect-oriented programming, ORMs, etc.

  • User profile image
    felix9

    IMHO, CaaS maybe not an immediately obvious useful thing for 'end-coders' (is there such a thing ?), because its infrastructure work, but at least it will empower the framework builders/library writers/tooling providers to create super powerful and flexible stuff and therefore benefits the 'end-coders'.

  • User profile image
    Adam​Speight2008

    I understand the reasons (sort of *1) for rewriting the compilers for C# and VB.net in C# and VB.net respectively (personally hope it the opposite way round. C# in VB.net  and VB.net in C#, as it'll end the arguments.)  

     *1 I understand it is written in unmanaged c++, Why not use C++/CLI?

    @felix9:  That's point I'm make felix9, it's purpose is not obvious. 

    "... but at least it will empower the framework builders/library writers/tooling providers to create super powerful and flexible stuff ..." 

    How? This has yet be shown. (Even conceptually.)

     

  • User profile image
    SlackmasterK

    @vesuvius:Go back and watch his future of c# video on PDC 2009. The compiler-as-a-service demo there was way better. As a result, I'm immediately interested in stuff they're "just noodling around with".

     

  • User profile image
    Richard.Hein

    Embedded scripting engines ... generation of user defined objects from user defined data, built from a highly specific business related DSL, especially useful for dynamic search tools embedded in a business application and applications requiring end-user customizability of relational data, and auto-generation of CRUD based forms as well as business logic and validation specific to user defined data and forms.  There's a ton of stuff this would be useful for.

  • User profile image
    exoteric

    Bootstrapping. Making it easier to create tools for these languages.

  • User profile image
    exoteric

    Bootstrapping. Making it easier to create tools for these languages.

  • User profile image
    Bass

    It's worth noting that Mono's C# compiler already has an API (and a REPL shell built on top of it) for several years.

    You can read more about it here: http://www.mono-project.com/CsharpRepl

  • User profile image
    felix9

    Mmmm..... dynamic scriping .... isnt it the original purpose for Iron* languages ? push them out and reinventing C#Script ? mmm ....

    , Adam​Speight2008 wrote

    "... but at least it will empower the framework builders/library writers/tooling providers to create super powerful and flexible stuff ..." 

    How? This has yet be shown. (Even conceptually.)

    Personally I am interested in extending the language itself to contain some DSLs for different scenarios, though its unlikely that CaaS will enable this in and of itself, but might become possible with some 'wrapping' compilers based on the CaaS infrastructure ?

    for example, can it lead to a neat solution to the INotifyPropertyChanged problem in WPF ?

    or generally, a neat AOP framework ?

    or, crazier, WPF have many concepts that not 'native' to the runtime and languages, we have to use complex API to access them, can we build a DSL that use them natually ? like declare and access Dependency Property or Attached Property like native ones ? access Routed Event ? access or write Binding Expressions ? walk through the Layout Tree ? interleaving XAML ? like Razor ???

    OK, for app coders they should just do MVVM and know nothing about the UI stuff, and the control writers are a market too small for this DSL. that for sure. Its just a crazy example for the use of DSL. Smiley

    and, for another even crazier idea, we do need a managed tool chain to develop on a managed operating system right ? Devil

  • User profile image
    contextfree

    , felix9 wrote

    or, crazier, WPF have many concepts that not 'native' to the runtime and languages, we have to use complex API to access them, can we build a DSL that use them natually ? like declare and access Dependency Property or Attached Property like native ones ? access Routed Event ? access or write Binding Expressions ? walk through the Layout Tree ? interleaving XAML ? like Razor ???

    great idea. actually, I guess XAML was supposed to be a DSL itself, it's just trapped within cumbersome XML syntax ...

     

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.