GithubHelp home page GithubHelp logo

mir.net's Introduction

mir.net

.NET Implementation of Mir Ref-Counted Type System (MTS)

Features

  • Fast generic types that are easy to construct, use, and pass between managed and unmanaged code.
  • Faster than Protocol Buffers as well as any other serialization library because it is completely zero-copy.
  • Requires around half the user code compared to Protocol Buffers.
  • D and C++ implementations are provided via Mir Algorithm
  • D, C++, and C# MTS implementations are self-contained. C# implementation requires neither Mir Algorithm nor D/C/C++ runtimes.
  • Hands-free. Just construct, pass, and forget. Mir objects hold all required information to destroy them and free memory.

The library is used in a large private codebase.

Install with NuGet

Or build NuGet package your self.

dotnet pack --configuration Release

Basic Types

  • Array
  • Array slices
  • Matrices
  • Sorted dictionaries (Series)
  • Slim shared pointers
  • Shared Pointers with inheritance
  • POD small strings

Composed user-defined types

Mir types can be composed using other Mir types and C# POD types that don't require special marshaling. MirWrapper is a base class for all non-POD library and user-defined Mir types. It requires the structure payload (Impl) to be defined.

MirPtr and MirSlimPtr can be used to wrap a native type without defining its structure payload in C#.

Table of correspondence

(check the source repository if the table isn't rendered correctly because of the nuget issue)

D Type C# Type C++ Type
SlimRCPtr!Type MirSlimPtr<Type> mir_slim_rcptr<Type>
RCPtr!Type MirPtr<Type> mir_rcptr<Type>
RCArray!Type MirArray<Type, @> ×2 mir_rcarray<Type>
Slice!(RCI!Type) Slice<Type> ×2 mir_slice<mir_rci<Type>>
Slice!(RCI!Type, 2) Matrix<Type> ×2 mir_slice<mir_rci<Type>, 2>
Slice!(Type*) SliceView<Type, @> ×2 mir_slice<Type*>
Series!(RCI!Key, RCI!Value) Series<Key, Value, @> ×2 mir_series<mir_rci<Key>, mir_rci<Value>>
SmallString!N SmallStringN, N=4,31,32,64,128 mir::SmallString<N>
Series!(RCI!(RCArray!(const char)), RCI!Value) StringSeries<Value> mir_series<mir_rci<mir_rcarray<const char>>, mir_rci<Value>>

Name<... , @> ×2 - means a type has two declarations, Name<... > and Name<... , Impl>, where Impl is an unmanaged C# handle structure that describes non-POD Mir Type.

Composed Mir Type (CMT) is a type that is composed of CMT fields, library RefCounted fields, and POD structures and types.

Unmanaged C# handles should use byte instead of bool.

mir.net's People

Contributors

9il avatar akgvn avatar jonathangerlach avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.