.NEXT (dotNext) is the family of powerful libaries aimed to improve development productivity and extend .NET API with unique features which potentially will be implemented in the next versions of C# compiler or .NET Runtime.
This chapter gives quick overview of these libraries. Read articles for closer look at all available features.
- Runtime: any .NET implementation compatible with .NET Standard 2.0
- OS: Linux, Windows, MacOS
- Architecture: any if supported by underlying .NET Runtime
- Value Delegates as allocation-free and lightweight alternative to regular .NET delegates
- Enum API to work with arbitrary enum types
- Thread-safe advanced atomic operations to work with int, long, bool, double, float, IntPtr, arbitrary reference and value types
- Unified representation of various synchronization primitives in the form of the lock
- Generic specialization with constant values
- Generation of random strings
- Low-level methods to work with value types
- Fast comparison of arrays
- Ad-hoc user data associated with arbitrary object
.NET Reflection is slow because relies on late-bound calls when every actual argument should be validated. There is alternative approach: dynamic code generation optimized for every member call. Reflection library from .NEXT family provides provides fully-featured fast reflection using dynamic code generation. Invocation cost is comparable to direct call. Check Benchmarks to see how it is fast.
Additionally, the library provides support of Type Classes. You don't need to wait C# language of version X to obtain this feature.
This library provides a rich API to write and execute code on-the-fly. It extends C# Expression Tree programming model with ordinary things for C# such as
lock statement, string interpolation and even asynchronous lambda expressions with full support of
- Structured access to unmanaged memory
- Unstructured access to unmanaged memory
- Typed unmanaged array and list
- CLS-compliant generic pointer type for .NET languages without direct support of such type. Use this feature to work with pointers from VB.NET or F#.
- Atomic thread-safe operations applicable to data placed into unmanaged memory: increment, decrement, compare-and-set etc, volatile access
- Calling unmanaged functions by pointer
The library allows you to reuse experience of blocking synchronization with help of ReaderWriteLockSlim, AsyncCountdownEvent and friends in asynchronous code using their alternatives such as asynchronous locks.
The following code describes these alternative implementations of synchronization primitives for asynchronous code:
|Synchronization Primitive||Asynchronous Version|
But this is not all features of this library. Read more here.
Provides basic framework for building clustered microservices based on network consensus and distributed messaging. Additionally, the libarary provides transport-agnostic implementation of Raft Consensus Algoritm that can be adopted for any communication protocol.
Additionally, the library contains high-performance Write Ahead Log used for log replication by Raft algorithm. However, it can be used as general-purpose log.
Allows to build clustered microservices which rely on network consensus and distributed messaging with ASP.NET Core framework. This library contains HTTP-based implementation of Raft Consensus Algorithm, HTTP-based distributed messaging across cluster nodes, cluster leader detection, automatic redirection to leader node and many other things.
.NEXT Augmentations extends compilation pipeline with tricks and optimizations not available in Roslyin Compiler out-of-the-box. It is actually not a library, but IL code weaver implemented as Fody add-in. Read more about compile-time features here.