Microsoft has declared the Polyglot Notebooks extension to Visual Studio Code ready for business, enabling multiple programming languages to be used in the VS Code version of Jupyter Notebooks – with the caveat that a feature on which it depends, called .NET interactive, is still in preview.
“Polyglot Notebooks’ philosophy is that developers should always be able to choose the best language for the task at hand,” Regio writes; but Python is not supported by these multi-language notebooks. Developers can still use Python in VS Code Jupyter Notebooks, but these are not Polyglot and it is necessary to select a kernel matching the language required.
The original Jupyter is an open source project for interactive computing and is based on Python though other languages are supported by plugging in different kernels (programming language specific processes), adding support for Go, Julia, Ruby, TypeScript, R, Perl, SQL and many more. Jupyter notebooks are widely used for data science and also useful in other contexts such as education.
In 2020 Microsoft released a Jupyter extension for VS Code. Developers benefit from the excellent coding support in VS Code, but it is a complex project and the company has struggled at times to maintain its quality. The extension has over 61 million installs but just 2.5 stars on the VS Code marketplace, with a recent reviews stating “cannot get new kernels working easily”, “will not connect to kernel,” “expect disconnection if you leave and come back an hour later,” and “I wouldn’t recommend using this for work-related tasks as it’s not very stable,” though another review says “the 2023.1 pre-release version is excellent.”
The .NET Interactive project is open source on GitHub and provides the engine that drives Polyglot Notebooks, though it can also be used in other contexts. The multiple language support harks back to the original concept of .NET as a “common language runtime,” though in practice .NET has been dominated by C#, followed by Visual Basic .NET and F#.
Microsoft once supported Python on .NET in the form of IronPython, which now continues as an independent .NET Foundation project. As for Python in Polyglot Notebooks, a member of the team stated in November 2022 that “.NET Interactive has recently been working on Python and R integration” though it is currently a private preview with those interested required to sign an NDA.