Wayback Machine
53 captures
15 Mar 2023 - 09 Jul 2025
May JUL Sep
Previous capture 02 Next capture
2022 2023 2024
success
fail
About this capture
COLLECTED BY
Collection: Save Page Now
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20230702224832/https://code.visualstudio.com/docs/languages/polyglot
Skip to content  Visual Studio Code
  • Docs
  • Updates
  • Blog
  • API
  • Extensions
  • FAQ
  • Learn
  • Search
  • Search Search
  • Download VS Code Download VS Code Download

Version 1.79 is now available! Read about the new features and fixes from May.

Dismiss this update
'; document.body.appendChild(div.children[0]); } function pushCodingPackEvent(language, os) { let id = `${language}-${os}-coding-pack`; var analytics = window.vscodeAnalytics; analytics && analytics.event( 'click', 'download', id, ); }
  • Overview
  • Setup
    • Overview
    • Linux
    • macOS
    • Windows
    • Raspberry Pi
    • Network
    • Additional Components
    • Enterprise
    • Uninstall
  • Get Started
    • Intro Videos
    • Tips and Tricks
    • User Interface
    • Themes
    • Settings
    • Key Bindings
    • Display Language
    • Telemetry
  • User Guide
    • Basic Editing
    • Extension Marketplace
    • IntelliSense
    • Code Navigation
    • Refactoring
    • AI Tools
    • Debugging
    • VS Code for the Web
    • Tasks
    • Profiles
    • Settings Sync
    • Snippets
    • Emmet
    • Command Line Interface
    • Workspace Trust
    • Multi-root Workspaces
    • Accessibility
  • Source Control
    • Overview
    • Introduction to Git
    • Collaborate on GitHub
    • FAQ
  • Terminal
    • Terminal Basics
    • Terminal Profiles
    • Shell Integration
    • Appearance
    • Advanced
  • Languages
    • Overview
    • JavaScript
    • JSON
    • HTML
    • CSS, SCSS and Less
    • TypeScript
    • Markdown
    • PowerShell
    • C++
    • Java
    • PHP
    • Python
    • Julia
    • R
    • Ruby
    • Rust
    • Go
    • T-SQL
    • C#
    • .NET
    • Polyglot
  • Node.js / JavaScript
    • Working with JavaScript
    • Node.js Tutorial
    • Node.js Debugging
    • Deploy Node.js Apps
    • Browser Debugging
    • Angular Tutorial
    • React Tutorial
    • Vue Tutorial
    • Ember Tutorial
    • Debugging Recipes
    • Performance Profiling
    • Extensions
  • TypeScript
    • Tutorial
    • Compiling
    • Editing
    • Refactoring
    • Debugging
  • Python
    • Tutorial
    • Editing Code
    • Linting
    • Debugging
    • Environments
    • Testing
    • Data Science
    • Python Interactive
    • Django Tutorial
    • Flask Tutorial
    • Create containers
    • Deploy Python Apps
    • Python in the Web
    • Settings Reference
  • Java
    • Getting Started
    • Navigate and Edit
    • Refactoring
    • Formatting and Linting
    • Project Management
    • Build Tools
    • Run and Debug
    • Testing
    • Spring Boot
    • Application Servers
    • Deploy Java Apps
    • GUI Applications
    • Extensions
    • FAQ
  • C++
    • Intro Videos
    • GCC on Linux
    • GCC on Windows
    • GCC on Windows Subsystem for Linux
    • Clang on macOS
    • Microsoft C++ on Windows
    • Build with CMake
    • CMake Tools on Linux
    • Editing
    • Debugging
    • Configure debugging
    • Settings
    • Configure IntelliSense for cross-compiling
    • FAQ
  • C#
    • Get Started
    • Navigate and Edit
    • IntelliCode
    • Refactoring
    • Formatting and Linting
    • Project Management
    • Build Tools
    • Package Management
    • Run and Debug
    • Testing
    • FAQ
  • Docker
    • Overview
    • Node.js
    • Python
    • ASP.NET Core
    • Debug
    • Docker Compose
    • Registries
    • Deploy to Azure
    • Choose a dev environment
    • Customize
    • Develop with Kubernetes
    • Tips and Tricks
  • Data Science
    • Overview
    • Jupyter Notebooks
    • Data Science Tutorial
    • Python Interactive
    • PyTorch Support
    • Azure Machine Learning
    • Manage Jupyter Kernels
    • Jupyter Notebooks on the web
  • Azure
    • Extensions
    • Deployment
    • Remote Debugging for Node.js
    • Docker
    • MongoDB
    • Kubernetes
    • Azure Kubernetes Service
  • Remote
    • Overview
    • SSH
    • Dev Containers
    • Windows Subsystem for Linux
    • GitHub Codespaces
    • VS Code Server
    • Tunnels
    • SSH Tutorial
    • WSL Tutorial
    • Tips and Tricks
    • FAQ
  • Dev Containers
    • Overview
    • Tutorial
    • Attach to Container
    • Create a Dev Container
    • Advanced Containers
    • devcontainer.json
    • Dev Container CLI
    • Tips and Tricks
    • FAQ
Edit

Polyglot Notebooks in VS Code

What is Polyglot Programming?

Polyglot programming is the practice of using multiple programming languages to leverage the strength of each language for different tasks.

What are Notebooks?

Notebooks are interactive files that allow the mixing of executable code, visualizations, equations, and narrative text. Notebooks are composed of code cells that make it easy to quickly iterate on code. Popularized by the open-source project Jupyter, they have become the de facto tool for Python data science and a great resource for teaching or learning a new programming language and quick prototyping.

Polyglot Notebooks

When polyglot programming meets notebooks, you get Polyglot Notebooks! As opposed to traditional notebooks that are typically used with Python, the Polyglot Notebooks extension allows you to use multiple programming languages natively all in the same notebook in Visual Studio Code! No more needing wrapper libraries or magic commands to work with your favorite languages in the same notebook!

Polyglot Notebooks Extension

Languages supported

  • C#
  • F#
  • PowerShell
  • JavaScript
  • HTML
  • Mermaid
  • SQL
  • KQL (Kusto Query Language)

Features

In addition to executing the code for the languages above, you can take advantage of:

  • Connecting to and querying from Microsoft SQL Server databases and Kusto clusters.

  • Language server support such as IntelliSense, autocompletion, and syntax highlighting for each language.

  • Variable sharing between languages that ensures a continuous workflow within the notebook. (Variable sharing not available for HTML and Mermaid)

  • Variable Explorer to check state of variables and the subkernel variables exist in.

  • Full portability between Jupyter/JupyterLab.

To learn about all the features, visit the VS Code Marketplace Polyglot Notebooks extension.

Prerequisites

To use Polyglot Notebooks in VS Code, you will need:

  • Polyglot Notebooks extension
  • .NET 7 SDK

Why do I need the .NET SDK?

The Polyglot Notebooks extension is powered by .NET Interactive, which is a cutting edge and innovative engine built on .NET technology that can run multiple languages and share variables between them. In Polyglot Notebooks, this engine behaves as the notebook's kernel and is the reason that the .NET 7 SDK is required.

Getting started

  1. To create your first polyglot notebook, open the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and select Polyglot Notebooks: Create new blank notebook, select .ipynb, and select the language you'd like to start with.

    You can also create a notebook by creating a new file and giving it the extension .ipynb. In this case, make sure that .NET Interactive is selected as the kernel of the notebook in the top right.

    Kernel Picker

  2. By default, added cells will be the same language as the cell above it. To change the language, select the language picker in the bottom right of the cell.

    Cell Language Picker

  3. Get coding!

    Example of Polyglot Notebook

Working with data

Connect to and query Microsoft SQL Server databases and Kusto clusters.

To get more detailed instructions on connecting to and working with data sources, visit the Working with Data documentation.

Connecting to SQL Example

Language server support

Each language in Polyglot Notebooks gets a first-class editing experience with language server support such as autocompletion, syntax highlighting, and signature help.

Variable Sharing and Variable Explorer

Share variables between languages using the #!set command and check on the values of variables for each language using the Variable explorer. Note that if you were previously using the #!share command, it will continue to work. Select the Variables icon in the global toolbar to open the Variable explorer.

Sorry, your browser doesn't support HTML 5 video.

To learn more about variable sharing, visit the Variable Sharing documentation.

Feature requests and feedback

The Polyglot Notebooks extension is powered by .NET Interactive and you can provide feedback and enter issues on the .NET Interactive GitHub repository.

3/15/2022

In this article there are 8 sectionsIn this article

  • Polyglot Notebooks
  • Features
  • Prerequisites
  • Getting started
  • Working with data
  • Language server support
  • Variable Sharing and Variable Explorer
  • Feature requests and feedback
  • Hello from Seattle.
  • Follow @code
  • Support
  • Privacy
  • Manage Cookies
  • Terms of Use
  • License
Microsoft homepage Microsoft homepage © 2023 Microsoft