Hot Fixes

Online Help





CS-Script and Roslyn

I am frequently asked about I have any plans to integrate Roslyn. The short answer is "YES". I do plan to integrate Roslyn eventually. However the issue is not as simple as it seems. 

The latest (April 2014) Roslyn release is largely misunderstood. And, well... oversold.

Since the first Roslyn public appearance as CTP in 2011 I stated that I plan integrating Roslyn with CS-Script to address some CodeDOM limitations. However I had to wait as Roslyn wasn't complete yet at that time.

The intriguing aspect of the recent Roslyn Preview is that apart from the positive open-source move it is actually a step back comparing to 2011 release. Yes, due to the significant amount of the rework the Roslyn team had to cut down the functionality dramatically. Thus Compilers API (required for code compilation/execution) has been completely removed. And the Roslyn team is only reviewing the design "before re-introducing these components".

Thus, while it can change in the future, today Roslyn is an incomplete (alpha and beta) set of components for code analysis only. 

The bottom line is that today Roslyn is not a "compiler-as-service" but a beta release of a "code analysis" framework.

All this leaves very little opportunity for the adding any value to CS-Script by bringing Roslyn into it.

These are the potential areas where Roslyn can be used in CS-Script.

Code Analysis
CS-Script uses Notepad++ plugin (CS-Script.Npp) to deliver Intellisense and code navigation. The feature is implemented with NRefactory (Mono). Today Roslyn is in an "embryonic" state with respect to assisting with any code auto-completion solution and cannot really compete with the mature NRefactory.

Code Formatting
CS-Script Notepad++ plugin implements custom code formatting. This was a forced choice of the development direction. This is because the available NRefactory code formatting is not customizable enough to satisfy the real-life scenarios. On the other hand Roslyn's formatting implementation currently does not offer any customization at all. All this makes both frameworks not suitable for the task.

Code Execution
CS-Script uses two Compilers API models CodeDOM and Mono compiler-as-service. Potentially Roslyn
compiler-as-service can also be added as a third model. Thus CS-Script would represent one unified interface for the script hosting solutions based on the compiling engine (model) of user choice. Roslyn may also potentially address some limitations that the other two models cannot. However currently Roslyn has no Compilers API implemented at all. 

Oleg Shilo 20 May 2014



Copyright (C) 2004-2015 Oleg Shilo