多语言笔记系列:Polyglot Notebooks 多种使用方式
.NET Interactive 使用方式
.NET Interactive生态,大约由:前端UI(Jupyter、VSCode等)、交互协议(PMP、JMP)、执行器(.net interactive)和语言服务组成。
有多种组合方式,来使用。最常用的还是 VS Code(Polyglot Notebooks插件)充当前端UI,调用 .net interactive 执行器。
VS Code
配合 Polyglot Notebooks
插件
这是最常用的、功能最丰富的使用方式。
使用为 Jupyter kernel
通过设置Jupyter服务(把.net interactive安装成Jupyte插件),使用 Jupyter笔记本,直接支持C#、F#、Powershell语言。
nteract 简单UI客户端
nteract 是另一个可视化UI应用。并且提供了 CoreSdk开发库,能在应用中直接使用 .net interactive 库。
下载,安装后,直接使用。官网 https://nteract.io
dotnet-repl
交互式命令行
dotnet-repl 项目是一个实验项目,使用 .NET Interactive / Polyglot Notebooks 和 Spectre.Console 创建多语言 .NET REPL 以在命令行上使用。
实质上是一个 .net tool
官网
- 安装
dotnet tool install -g dotnet-repl
-
单行命令
-
多行命令
-
执行笔记本文件