About

Microsoft MakeCode is a framework for creating interactive and engaging programming experiences for those new to the world of programming. The platform provides the foundation for a tailored coding experience to create and run user programs on actual hardware or in a simulated target.

Editor to target

The primary goal of MakeCode is to introduce programming in an a way that is approachable and inviting. To do this, MakeCode uses the blocks programming model to let the user learn coding concepts in a more tangible fashion. Once the user becomes comfortable with the coding elements and structure, they can progress to create more complex programs. The blocks map directly to actual lines of code in a programming language. So, once a user has a sense of confidence and familiarity with how the blocks work, they can transition to coding more complex programs in the programming language itself.

MakeCode is not a universal programming platform but an extensible framework to create any number of MakeCode based experiences customized to a specific target. These targets are typically maker-style or educational single board computers, but could also be a simulated only “soft” target. A list of MakeCode supported targets is at MakeCode.com.

Target developers use the MakeCode framework and extend it by customizing the user interface and by adding additional blocks and functions specific to their hardware.

MakeCode essentials

All of the parts of the MakeCode programming experience, when put toghether, create what’s typically called an “editor”. Even though MakeCode incorporates much more than just editors, this concrete term is used more often, rather than referring to the MakeCode target as a “programming experience”.

To describe the essentials of a MakeCode editor, it is combination of: a blocks editor, a language editor, a target simulator, and a target code generator.

Blocks editor

The Blocks editor is where the user can interactively create a program by “pulling” or “dragging” blocks onto the editor workspace. The blocks are found under the categories available in the Blocks Toolbox aligning next to the workspace.

Blocks represent coding actions and programming structures that would traditionally be written in text. Coding elements such as loops, conditonal statements, and events are containing blocks with other blocks fitting inside. Functions and assignments are “flat” blocks that fit into others. Variables, values, and properties are mini-blocks that fit into slots of functions, assignments, or evaluators.

Blocks editor

A single discrete block may have selectors for values or variables, and possibly slots for values or parameters.

Change block

Language editor

A language editor complements the Blocks editor in MakeCode. When blocks are defined for functions, statements, and assignments, the code matching them in the Language editor will represent the corresponding blocks in the Blocks editor. In the Language editor, however, a user can write additional code with greater complexity than what is available with blocks.

JavaScript editor

Simulator

A simulator has visual elements that represent the functions of a target board. Developers of a MakeCode target can add image items and code actions to simulate what happens when the program is run on the board.

Simulator

Target code

When a program is ready for test or use on the target board, the user starts a download. In MakeCode, a download action will convert the code in the editor to the target’s native format and generate a HEX file to copy to the board.

Download button

The board appears as a file storage device connected to a user’s computer. The HEX file is simply copied directly to this storage location. A program loader already present on the board reads the HEX file. It flashes it into memory and then runs the new program.

Download to board

MakeCode and PXT

Microsoft MakeCode is based on the open source project Microsoft Programming Experience Toolkit (PXT). The project is hosted as a public repository on GitHub.

PXT repository on GitHub

Language

MakeCode’s underlying programming language is a subset of TypeScript called Static TypeScript, which omits the dynamic features of JavaScript.

Features

The main features of MakeCode and its PXT implementation are:

MakeCode targets

A MakeCode target is a complete MakeCode editor developed for a particular board or target platform. A functioning editor is built on top of, or inherits from, PXT. The target editor’s code and resources are in a separate GitHub repository.

PXT and Target repos

Extensions

Because of the extensiblity of PXT, extension projects can be created and published to add additional blocks and other functionality to existing editors. The extensions simply plug into the editor while it’s running, adding the new features.

PXT, Target, and extension repos

Open Source

MakeCode is an open source project and is provided as a joint effort between Microsoft Research and Visual Studio.