|
| 1 | +<p align="center"> |
| 2 | + <span>English</span> | |
| 3 | + <a href="https://github.com/dotnetcore/natasha">中文</a> |
| 4 | +</p> |
| 5 | + |
| 6 | +# Natasha |
| 7 | + |
| 8 | +[](https://github.com/dotnetcore) |
| 9 | +[](https://www.nuget.org/packages/DotNetCore.Natasha) |
| 10 | +[](https://gitter.im/dotnetcore/Natasha?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) |
| 11 | +[](https://996.icu/#/zh_CN) |
| 12 | +[](https://github.com/dotnetcore/Natasha/blob/master/LICENSE) |
| 13 | + |
| 14 | +    This is a roslyn-based dynamic compilation library that provides you with efficient, high-performance, traceable dynamic build solutions. It is compatible with stanadard2.0, and uses only native C # syntax without Emit. |
| 15 | +Make your dynamic approach easier to write, track, and maintain. Welcome to discuss with me online.:[Click and join the gitter](https://gitter.im/dotnetcore/Natasha) |
| 16 | + |
| 17 | +<br/> |
| 18 | + |
| 19 | +### Library Info |
| 20 | + |
| 21 | + |
| 22 | +[](https://github.com/dotnetcore/Natasha/releases)  [](https://github.com/dotnetcore/Natasha/commits/master) [](https://codecov.io/gh/dotnetcore/Natasha) |
| 23 | + |
| 24 | +| Script | .NET Env | Document | |
| 25 | +| ------ | -------- | -------- | |
| 26 | +|  |    | [](https://natasha.dotnetcore.xyz/) | |
| 27 | + |
| 28 | +| CI Platform | Build Server | Master Build | |
| 29 | +|--------- |--------- |---------| |
| 30 | +| Github || [](https://github.com/dotnetcore/Natasha/actions) | |
| 31 | +| Azure | | [](https://dev.azure.com/NightMoonStudio/Natasha/_build/latest?definitionId=3&branchName=master)| |
| 32 | +| Azure | |[](https://dev.azure.com/NightMoonStudio/Natasha/_build/latest?definitionId=3&branchName=master)| |
| 33 | +| Azure || [](https://dev.azure.com/NightMoonStudio/Natasha/_build/latest?definitionId=3&branchName=master)| |
| 34 | + |
| 35 | +<br/> |
| 36 | +<br/> |
| 37 | + |
| 38 | +### User Api: |
| 39 | +| Order | Operation | Target | Description | |
| 40 | +|-- |-------- |--------------| --------| |
| 41 | +| 1 | Reference Library | DotNetCore.Natasha.CSharp.All | | |
| 42 | +| 2 | Initialization | NatashaInitializer.InitializeAndPreheating(); / Initialize(); | Preheating will take some time, and later compilation will be fast, or you can only initialize without preheating. | |
| 43 | +| 3 | Write code | instructions [https://natasha.dotnetcore.xyz/](https://natasha.dotnetcore.xyz/) | Contact me: [email protected] or [FAQ ](https://github.com/dotnetcore/Natasha/blob/master/docs/FAQ.md) or [create issue ](https://github.com/dotnetcore/Natasha/issues/new) | |
| 44 | + |
| 45 | +<br/> |
| 46 | +<br/> |
| 47 | + |
| 48 | +### 发布日志 |
| 49 | +- Release log in 2019 [[Done]](https://github.com/dotnetcore/Natasha/blob/master/docs/zh/update/2019.md) |
| 50 | +- Release log in 2020 [[In process]](https://github.com/dotnetcore/Natasha/blob/master/docs/zh/update/2020.md) |
| 51 | + - 2020-08-06 : 发布 v4.1.0.0,支持域内动态编程时插件 Using 引用覆盖 以及 动态生成程序集的 Using 引用覆盖, 减少开发者在域内编程时对 Using 的过多关注。 升级 Natasha.Framework; 添加 GetReferenceElements API 以便返回当前域所有的引用,增加 AddAssemblyEvent/RemoveAssemblyEvent 事件,在程序集加载与移除操作时触发。 增加方法返回值的 ref 修饰的反解。增加 Natasha.CSharp.All 库,提供组件库的自动引用。 |
| 52 | + |
| 53 | + - 2020-10-10 : 发布 Natasha.CSharp.All v2.0.0.0,重整项目结构,分离出 C# 相关组件,修复域管理操作类对域的弱引用关系,完善周边类库。 |
| 54 | + |
| 55 | + - 2020-10-28 : 发布 Natasha.CSharp.All v2.0.1.1,使用初始化开关,避免多次初始化调用,支持 netcore3.1 Runtime 版本。 |
| 56 | + |
| 57 | + - 2020-11-14 : 发布 Natasha.CSharp.All v2.0.2.1,支持 .NET5 ,初始化函数增加参数,false 代表不初始化默认域的引用,此时引用需要在域中手动添加。 |
| 58 | + |
| 59 | + - 2020-11-20 : 发布 Natasha.CSharp.All v2.0.2.2,支持 .NET5 / C# 9 ;增加 NRecord 构建模板;增加 RecordProperty<T>(name) 只读包装属性,增加 OOP 模板 Property 构建是关于 init 类型的 API; 增加支持 fixed 修饰符;.NET5 版本 增加 SkipInit 方法跳过初始化,即 SkipLocalsInit 特性(注解),可用在存储结构构建以及方法上;修复日志输出格式。 |
| 60 | + |
| 61 | + - 2020-11-24 : 发布 Natasha.CSharp.All v2.0.2.3,修复禁断警告功能,升级周边类库依赖。 |
| 62 | + |
| 63 | +<br/> |
| 64 | +<br/> |
| 65 | + |
| 66 | +### 生态周边 |
| 67 | +| 项目名称 | 项目地址 | 项目简介 | |
| 68 | +|------------- |-----------| --------| |
| 69 | +| NatashaPad | [Github](https://github.com/night-moon-studio/NatashaPad) | 由 Roslyn 和 Natasha 支持的另一种dotnet调试工具,如 LinqPad 和 dotnet fiddle。 | |
| 70 | +| Leo | [Github](https://github.com/night-moon-studio/NCaller) | 基于 Natasha 和 查找树算法的高速反射类,可以操作对象的属性以及字段。 | |
| 71 | +| DeepClone | [Github](https://github.com/night-moon-studio/DeepClone) | 由 Natasha 的高性能深度克隆库。 | |
| 72 | +| BTFindTreee | [Github](https:https://github.com/dotnet-lab/BTFindTreee) | 快速查找算法的构建,包括哈希二分查找,字串模糊查找,字串归并精确查找。 | |
| 73 | +| Papper | [Github](https:https://github.com/dotnet-lab/Papper) | 对语法树解析库,主要目标时服务于 SG(Source Generator)技术。 | |
| 74 | +| RuntimeToDynamic | [Github](https://github.com/night-moon-studio/RuntimeToDynamic) | 将运行时数据压入到动态代理类中,以方便其他动态构建时对其进行复用。| |
| 75 | +| DynamicDictionary | [Github](https://github.com/night-moon-studio/DynamicCache) | 高速动态缓存,在只读并发场景中提供超高性能的数据查找功能。| |
| 76 | +| Aries | [Github](https://github.com/night-moon-studio/Aries) | 对 FreeSql 的高度封装,提供高性能、直观的 外联 / 乐观锁 / CURD 操作。| |
| 77 | + |
| 78 | +<br/> |
| 79 | +<br/> |
| 80 | + |
| 81 | +### 开发计划 |
| 82 | +#### 2.0+ 计划 |
| 83 | + |
| 84 | + - [ ] 编写英文文档,以后将以英文文档为主 |
| 85 | + - [x] 调研 .NET6 中性能优化的新特性 |
| 86 | + - [ ] 完善 UT 测试 |
| 87 | + - [ ] 挣钱, 生存下来 |
| 88 | + |
| 89 | +#### 周边项目计划 |
| 90 | + |
| 91 | + - [ ] BTF 算法 |
| 92 | + - [ ] 每周定时跑算法随机测试程序 |
| 93 | + - [x] 持续评估 `span` 序列比较方法 及 指针转换比较 的性能 |
| 94 | + - [ ] 评估 Trie 及变种 与 BTF 算法的性能差距 |
| 95 | + - [ ] 元数据 |
| 96 | + - [ ] 优化性能 |
| 97 | + - [x] 精确解析 |
| 98 | + - [x] 持续评估封装架构的设计方案 |
| 99 | + - [ ] 改造 [Leo](https://github.com/night-moon-studio/Leo) |
| 100 | + - [x] 持续优化性能 |
| 101 | + - [x] 私有支持 |
| 102 | + - [ ] 评估是否支持 AOP |
| 103 | + - [x] 评估 [Leo](https://github.com/night-moon-studio/Leo) 代理方式 和 [DynmaicDictionary](https://github.com/night-moon-studio/DynmaicDictionary) 代理方式 在 R2D 模板下的异同及抽象 |
| 104 | + - [x] 优化静态自动机代码 |
| 105 | + - [x] 使用委托指针优化性能 |
| 106 | + |
| 107 | + - [ ] 依赖还原库 |
| 108 | + - [ ] NET 模块 |
| 109 | + - [ ] NUGET 模块 |
| 110 | + - [ ] FOLDER SCAN 模块 |
| 111 | + - [ ] 跨平台 模块 |
| 112 | + |
| 113 | + - [ ] 定制语法/语法糖 to Natasha |
| 114 | + - [ ] 持续评估 Natasha 在灵活授权模型上的应用 |
| 115 | + - [ ] 持续搜集反编译的需求 |
| 116 | + - [ ] 调研 JAVA to C# |
| 117 | + - [ ] 调研 GO to C# |
| 118 | + - [ ] 考虑要不要调研 PHP to C# |
| 119 | + - [ ] 谁能来帮我一起搞,帮我点上左边的小对号? |
| 120 | + |
| 121 | +> 欢迎大家提交PR |
| 122 | +
|
| 123 | +<br/> |
| 124 | +<br/> |
| 125 | + |
| 126 | +### 性能测试 |
| 127 | + |
| 128 | + - [x] **动态初始化性能测试(对照组: emit, origin)** |
| 129 | +  |
| 130 | + - [x] **内存及CPU监测截图** |
| 131 | +  |
| 132 | + |
| 133 | +<br/> |
| 134 | +<br/> |
| 135 | + |
| 136 | +### 赞助: |
| 137 | + |
| 138 | +<img width=200 height=200 src="https://images.gitee.com/uploads/images/2020/1201/163955_a29c0b44_1478282.png" title="Scan and donate"/><img width=200 height=200 src="https://images.gitee.com/uploads/images/2020/1201/164809_5a67d5e2_1478282.png" title="Scan and donate"/> |
| 139 | + |
| 140 | + |
| 141 | +#### 捐助明细 |
| 142 | + |
| 143 | +- ****天下 10元 |
| 144 | +- **航 5元 |
| 145 | + |
| 146 | +<br/> |
| 147 | + |
| 148 | +--------------------- |
| 149 | + |
| 150 | + |
| 151 | +## License |
| 152 | +[](https://app.fossa.io/projects/git%2Bgithub.com%2Fdotnetcore%2FNatasha?ref=badge_large) |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
0 commit comments