You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-10Lines changed: 30 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,12 +21,16 @@
21
21
22
22
**Durian is a collection of Roslyn-based analyzers, source generators and utility libraries that bring many extensions to C#, with heavy emphasis on features that can be found in other existing languages. It's main goal is to make C# easier and more pleasant to use through reducing necessary boilerplate code, while at the same time providing additional layers of flexibility.**
23
23
24
+
## Current state
25
+
26
+
Durian is at an early stage of its evolution - many core features are still missing, being either in early development or planning phase. As for now, only one fully-fledged module is complete - *DefaultParam*, with *InterfaceTargets* awaiting in experimental stage for release in the closest future.
27
+
24
28
## Features
25
29
26
-
**To see more about a specific feature, click on its name.**
30
+
To see more about a specific feature, click on its name.
DefaultParam allows to specify a default type for a generic parameter.
33
+
*DefaultParam* allows to specify a default type for a generic parameter.
30
34
31
35
```csharp
32
36
usingDurian;
@@ -56,21 +60,37 @@ class Program
56
60
57
61
```
58
62
59
-
## Current state
63
+
## Experimental
60
64
61
-
Right now, Durian is only at the first stage of its evolution. As for its initial release on the 2nd of June 2021, two modules - *Core* and *DefaultParam* - are available, with additional two - *StructInherit* and *GenericSpecialization* - in early development. This does not include two already existing packages that are not part of any module - *Durian.AnalysisServices* and *Durian.TestServices*.
For more information about a specific package or module, go to the *README.md* file in the according project's directory in the *\\src\\* folder.
67
+
*InterfaceTargets*, similar to how [System.AttributeUsageAttribute](https://docs.microsoft.com/en-us/dotnet/api/system.attributeusageattribute?view=net-5.0) works, allows to specify what kinds of members an interface can be implemented by.
64
68
65
-
## What's next?
69
+
```csharp
70
+
usingDurian;
66
71
67
-
At the moment, two modules are in experimental stage - *StructInherit* and *GenericSpecialization*, with the latter being further in development. Release dates are yet to be determined.
72
+
[InterfaceTargets(InterfaceTargets.Class)]
73
+
publicinterfaceITest
74
+
{
75
+
}
68
76
69
-
## History
77
+
// OK
78
+
// ITest can be implemented, because ClassTest is a class.
79
+
publicclassClassTest : ITest
80
+
{
81
+
}
82
+
83
+
// Error!
84
+
// ITest cannot be implemented, because StructTest is a struct, and ITest is valid only for classes.
85
+
publicstructStructTest : ITest
86
+
{
87
+
}
88
+
89
+
```
70
90
71
-
Durian started as a personal project of a high school student from Gdañsk, Poland - Piotr Stenke, amateur C# programmer and Unity Engine enthusiast. Though the sole idea for a Roslyn-based platform emerged in late 2020, any actual work didn't take place until February 2021. First months of development were especially challenging, with final exams in school, deadly virus roaming all around the globe and adult life slowly, but steadily, approaching. And all of that without even mentioning the worst part - learning from scratch this awful, unintuitive, badly-documented mess of an API that is Roslyn.
91
+
## What's next?
72
92
73
-
At its initial release on the 2nd of June 2021, Durian was meant to be a major card that would get its author into the IT industry.
93
+
With *InterfaceTargets* being close to leaving the experimental stage, two more features are almost ready to take its place - *GenericSpecialization* and *FriendClass*. Both are planned to be moved to experimental stage in late August - early September 2021.
### Separate analyzer packages detected, reference the main Durian package instead for better performance.
3
+
4
+
## Remarks:
5
+
6
+
This diagnostic is reported when a project references more than once Durian analyzer package, but not the main [Durian](https://www.nuget.org/packages/Durian/) package.
7
+
8
+
Every Durian analyzer package references [Durian.Core](../../src/Durian.Core/README.md) and [Durian.AnalysisServices](../../src/Durian.AnalysisServices/README.md). Since each analyzer package is its own being and has no knowledge of other analyzers, both [Durian.Core](../../src/Durian.Core/README.md) and [Durian.AnalysisServices](../../src/Durian.AnalysisServices/README.md) have to be loaded into memory once per each of those packages. For example, if a project references [Durian.DefaultParam](../../src/Durian.DefaultParam/README.md) and [Durian.InterfaceTargets](../../src/Durian.InterfaceTargets/README.md), [Durian.Core](../../src/Durian.Core/README.md) and [Durian.AnalysisServices](../../src/Durian.AnalysisServices/README.md) will be loaded twice - once for [Durian.DefaultParam](../../src/Durian.DefaultParam/README.md), once for [Durian.InterfaceTargets](../../src/Durian.InterfaceTargets/README.md). In such circumstances, in order to eliminate memory waste, it is recommended to use the main [Durian](https://www.nuget.org/packages/Durian/) package.
0 commit comments