roslyn support?

Shafev

Well-Known Member
Jan 19, 2019
104
13
I see its part of servuo now but i wander why such a beta product was added. I guess its not beta any more but still early stages of it. Why i ask because any kinda support is out the window because it costs money.

Also how can we update it if it does cost money?

just some questions i have on it.

also noticed only a hand few for features are using it.

thanks for any info that can help me understand such 3rd party product
Post automatically merged:

Okay let me back paddle on that i found this github'


is this same project we have in servuo.

If these is i was wrong about the cost part lol.
 

Grimoric

Well-Known Member
Mar 21, 2015
144
29
43
RunUO and ServUO don't use Roslyn they use the old technique called CodeDOM. CodeDOM was added to framework 1.0 for supporting WinFORM and is a wrapper for .net compilers. It allows you to compile code in a closed box and the only information you get out if it has failed to successfully compile the code or not. Roslyn, on the other hand, allows you to build and inspect code on the fly. Roslyn also allowed to manipulate code and not just compile it.

This is a good thread about it:

Roslyn is free to use and has been developed from 2011 to 2015 then it went RTM and today 4 years after it is really stable.

-Grim
 

Grimoric

Well-Known Member
Mar 21, 2015
144
29
43
*I think* It was added to give support for c#6.0 in the project. It still uses CSharpCodeProvider in Server\ScriptCompiler.cs line 217.

If I'm not wrong here but I think that Roslyn compiler platform only supports 4.6.1 for scripting but I'm not sure of this.
I did test it under 4.6.1 sins it didn't work for me with version 4.7 back then. But this was like a year ago.
 
Last edited:

Shafev

Well-Known Member
Jan 19, 2019
104
13
Yeah there 5 scripts using it and i think this bad for coding because its a limited 3rd party app. Very limited in way it should be used. Has any one done there research for sticking such 3rd party program into servuo?
 

dmurphy

Admin
ServUO Developer
Feb 10, 2014
1,017
233
30
Roslyn is not a third party app.

.NET Compiler Platform, also known by its nickname Roslyn,[1] is a set of open-source compilers and code analysis APIs for C# and Visual Basic .NET languages from Microsoft
It's as much third party as the .net framework is third party.

It was introduced with c#6.0 and in order to use the syntax sugar and newer API's roslyn is required. ServUO comes with Microsoft.CodeDom.Providers.DotNetCompilerPlatform now which allows you to use roslyn features in your scripts as all scripts are now compiled using the roslyn compiler instead of the more than a decade old CodeDom featured since .net 1
 

Grimoric

Well-Known Member
Mar 21, 2015
144
29
43
I was going to copy this from Microsoft Roslyn pages, these are the main people behind it.

Karen Ng, Principal Lead Program Manager, Microsoft Corporation
Matt Warren, Principal Architect, Microsoft Corporation
Peter Golde, Partner Architect, Microsoft Corporation
Anders Hejlsberg, Technical Fellow, Microsoft Corporation
 

Shafev

Well-Known Member
Jan 19, 2019
104
13
okay so its used for newer .net features
that is what i was looking for i am reading up on Roslyn and how it is used and all its features.
 

dmurphy

Admin
ServUO Developer
Feb 10, 2014
1,017
233
30
okay so its used for newer .net features
Yes, it allows for compiling scripts that use syntax from C#6 to C#8 as well as opening up a lot more analysis API's. It also allows for runtime manipulation of code rather than just simply compiling it.

Example of something that would not compile using CodeDom but does using DotNetCompilerPlatform

C#:
   string a = "one";
   string b= "two";
   WriteLine($"{a} is smaller than {b}!");
This is a syntax sugar feature that was included in c#6 called string interpolation. There are many more examples of what is included in newer version of C# that google will help you find.
 
Last edited:

Shafev

Well-Known Member
Jan 19, 2019
104
13
yeah i was using some when i was updating code didnt realize it. until this thread now looking and i have better understanding of roslyn i can see it does have plenty features to use.

Okay well last update to it was 6 months ago when it was added. any plans on updatuing it to the current github they have as they have fixed lots of issues with it since then?
 

dmurphy

Admin
ServUO Developer
Feb 10, 2014
1,017
233
30
yeah i was using some when i was updating code didnt realize it. until this thread now looking and i have better understanding of roslyn i can see it does have plenty features to use.

Okay well last update to it was 6 months ago when it was added. any plans on updatuing it to the current github they have as they have fixed lots of issues with it since then?
Roslyn was added to ServUO 2 months ago, not 6 months ago.

There is no need to update the compiler at this time as it works perfectly for our usage. It will be considered for a future major release of ServUO or CSharp. Possibly when CSharp 8 is fully released if Roslyn requires an update.

Edit: Actually we are using the latest stable version of the compiler already which is 2.0.1.