Questions tagged [c#]
The c# tag has no summary.
8 questions
16
votes
1
answer
2k
views
Incremental Compilation in Recursive‑Descent Parser (Roslyn)
I wrote a simple recursive‑descent parser for my DSL, but every edit in vscode forces me to reparse the whole file.
Roslyn (the C# compiler) also uses a hand-written recursive-descent parser yet ...
4
votes
2
answers
448
views
How do immutable compilers like Roslyn handle cyclic references in type definitions?
I'm learning about how modern compilers like Roslyn handle symbol tables and type information. From what I understand, Roslyn uses immutable data structures to represent symbols, which helps ensure ...
5
votes
1
answer
1k
views
Semantics on `with` keyword in C# for (heap-based) records
I have a question about a C# language design. Let's have a following code:
...
3
votes
2
answers
414
views
Does the C# type of generics need compiling to multiple instances of target code?
In C++, templated code are compiled multiple times according to the parameters. But I just realized how restrictive C# generics are:
The interfaces you are using on variables in a generic parameter ...
8
votes
2
answers
2k
views
Are delegates still relevant in modern C#?
Delegates have been part of the design of C# for decades. But would it be wrong to say that over time, all the uses of delegates have become better achieved through other means?
(Or, dramatically ...
14
votes
1
answer
3k
views
Async Implementation
I have recently been making my own programming language and I am finding most concepts easy to understand, however I'm not sure how to implement async/await in my language.
ATM, I'm using C# to create ...
5
votes
2
answers
656
views
What if all static methods in Java or C# could be extension methods just by default?
C# 3.0 introduced extension methods to "enhance" behavior of existing types without interface bloating to avoid modifying/breaking existing interfaces. This was the first time I learned of ...
16
votes
3
answers
1k
views
Why does C# have events as a language construct, rather than in the standard library?
In C#, events and event listeners have direct support within the language, with event being a keyword, and event declarations being a special kind of member ...