The transpiler · the editor tools · the whole thing

Get SHRT

Put a small language in front of a very large compiler.

● Preview 0.1.2 Windows x64 Linux x64 MIT
01 / DOWNLOADS

Choose your artifact.

The CLI only transpiles SHRT into C++. Keep using the C++20 compiler and build system you already trust.

Windows · x86-64

Native executable

ZIP · 202 KB · STATIC MSVC RUNTIME

Includes shrt.exe, a PowerShell installer, the MIT license, and a compact command reference. No WSL required.

Linux · x86-64

Static binary

TAR.GZ · 865 KB · NO SHARED LIBS

Includes the portable shrt binary and an installer targeting ~/.local/bin by default.

Any platform

Build from source

ZIP · 40 KB · CMAKE + C++20

The lexer, rewriter, CLI, language specification, and examples. Use this for another architecture or to inspect every transformation.

VS Code · Visual Studio

Editor extensions

SYNTAX · BUILD & RUN · CONVERT · C++ LENS

Install only the editor tools you want. Syntax support, compilation commands, and in-place conversion remain separate extensions.

SHA-256 checksums
47b1e7d719e89bdd03c38b9cd9828bc46d6412fc17b2683947c20d538b69a10  shrt-0.1.2-linux-x64.tar.gz
be841f870c03a194f47cf3d7dd84a2a91ccc398afddd66e4ec3b259e5f2b4d71  shrt-0.1.2-source.zip
2fa45821754ea0ec005a7f78085832024a384fb3ed0a0830d0fa6b4368bf7b2e  shrt-0.1.2-windows-x64.zip
07f8be474ff13e6036df1dc510f891eddcc8b4571ad44b34b3fd849ceecbdfcf  shrt-build-run-0.5.1.vsix
4bcfc34d464d451e850b78860f67d0bd7a5c5fb7aa89faa2495cb3f128d36ca1  shrt-convert-1.0.0.vsix
8206ab2499b448f880f47360ab2695a166a494031211f48909127274cdf66d47  shrt-tools-visual-studio-1.1.1.vsix
07aa4eda79994e53bf22bc81fe87ef7fcac6b3107c3aafcf887fd9770fe6e7c1  shrt-syntax-0.3.1.vsix
02 / INSTALL

One command. Then verify.

The recommended installers download the signed-off release archive, place one binary in a user-local folder, and add it to PATH. No administrator account, package manager, WSL, or project changes.

Windows

RECOMMENDED
  1. Open a normal PowerShell window. Administrator mode is not needed.
  2. Install latest Windows x64 release

    irm https://antonveselskyi.com/shrt/install.ps1 | iex
  3. Open a new terminal—or restart your editor—then verify both the location and version.
    where.exe shrt
    shrt --version
Prefer a manual install?

Download the Windows ZIP, extract it, and run its bundled installer:

Expand-Archive .\shrt-0.1.2-windows-x64.zip .\shrt
powershell -ExecutionPolicy Bypass -File .\shrt\shrt-0.1.2-windows-x64\install.ps1

Inspect the quick-install script before running it.

Linux

RECOMMENDED
  1. Open a terminal. Root access is not needed for the default install.
  2. Install latest Linux x64 release

    curl -fsSL https://antonveselskyi.com/shrt/install.sh | sh
  3. Open a new shell—or restart your editor—then verify both the location and version.
    command -v shrt
    shrt --version
Prefer a manual install?

Download the tarball, extract it, and run its bundled installer:

tar -xzf shrt-0.1.2-linux-x64.tar.gz
cd shrt-0.1.2-linux-x64
./install.sh

If needed, add ~/.local/bin to your shell PATH. You can also inspect the quick-install script.

Install locationWindows: %LOCALAPPDATA%\Programs\shrt\bin
Install locationLinux: ~/.local/bin
CompilerNot bundled. Use your existing C++20 compiler; Build & Run specifically expects g++.

Custom location: set SHRT_INSTALL_DIR before the Windows quick installer or SHRT_PREFIX before the Linux quick installer. The downloadable archives also work fully offline after download.

03 / FIRST BUILD

Transpile. Compile. Run.

SHRT owns the front end. Your normal compiler remains the back end. Pass -g so diagnostics map to the original SHRT lines.

Hello, shorter world.

Save this as hello.shrt. Any valid C++ also remains valid SHRT, so existing libraries and build knowledge carry over.

hello.shrt
i iostream

int main()
{
    a who = $string("world");
    p $"hello, {who}!";
    r 0;
}

Linux / MinGW / Clang

shrt hello.shrt -g -o hello.shrt.cpp
g++ -std=c++20 hello.shrt.cpp -o hello
./hello

Use clang++ in place of g++ if that is your compiler.

Visual Studio developer shell

shrt hello.shrt -g -o hello.shrt.cpp
cl /std:c++20 /EHsc hello.shrt.cpp /Fe:hello.exe
.\hello.exe

Run from a Developer PowerShell or Developer Command Prompt so cl and the C++ headers are available.

04 / EDITORS

Install only what you need.

Syntax, build/run, and in-place conversion remain separate tools. Every command-line integration resolves shrt from PATH—there is no project-folder discovery.

SHRT Syntax

VSIX · 0.3.1 · HIGHLIGHTING ONLY

Registers .shrt, highlights SHRT sugar, and falls back to VS Code's C++ TextMate grammar for ordinary C++.

  1. Download the VSIX.
  2. Open Extensions in VS Code.
  3. Choose Views and More Actions… → Install from VSIX….
  4. Select the file, then run Developer: Reload Window.

SHRT Build & Run

VSIX · 0.5.1 · PATH COMMANDS

Resolves shrt and g++ from PATH, transpiles the active file, and compiles it. It runs an existing current binary without rebuilding.

  1. Install the SHRT CLI and g++ first; both commands must be on PATH.
  2. Install this VSIX using the same menu.
  3. Open a .shrt file and use the shortcuts below.
CtrlAltBbuild
CtrlAltRbuild if stale + run

VS Code · Convert to C++

VSIX · 1.0.0 · IN-PLACE EDIT

Select any SHRT text and convert it directly to C++. With no selection, the command finds the function containing the caret—including concise => functions.

  1. Install the SHRT CLI and verify shrt --version in a new terminal.
  2. Install this VSIX, then run Developer: Reload Window.
  3. Select text or place the caret inside a function. Required includes and the defer runtime are added once.
CtrlAltCconvert in place

Visual Studio · SHRT Lens + Convert

VSIX · 1.1.1 · NATIVE SYNTAX + LENS

Built-in, theme-aware SHRT and C++ highlighting for every .shrt file—no grammar copy required. Open ordinary C++ through an editable SHRT Lens; saving patches only changed, reversible regions into the backing C++ as one Undo step.

  1. Install the SHRT CLI first, then restart Visual Studio so it receives the updated PATH.
  2. Close Visual Studio and double-click the downloaded VSIX.
  3. Select your VS 2022 installation, choose Install, then reopen the IDE.
  4. Open C++ and toggle the lens. Save to patch C++; toggle again to return to the canonical file.
CtrlAltShiftLtoggle SHRT Lens
CtrlAltCconvert in place

VS Code CLI alternative: code --install-extension .\package.vsix --force. After installing SHRT or changing PATH, fully restart the editor before testing a command. SHRT Tools supports VS 2022 Community, Professional, and Enterprise on x64 Windows. Lens mode rejects generated-code features such as defer so the C++ view always round-trips safely.

05 / TROUBLESHOOTING

Make PATH boring.

The editor tools intentionally use the same commands as a terminal. If those commands work in a newly opened terminal, the extensions work after the editor is restarted.

“shrt is not on PATH”

Open a completely new terminal and run shrt --version. If it works there, fully exit and reopen VS Code or Visual Studio. Reloading only the file is not enough.

Build & Run cannot find g++

The build extension deliberately requires g++ on PATH. Syntax highlighting and both converters do not require a compiler.

No text selected

Place the caret anywhere inside a braced function or a concise => function. Inside nested loops and conditionals, the converter walks outward to the enclosing function.

Undo or generated preamble

Conversion is an editor edit, so ordinary Undo restores the SHRT source. Missing includes and the defer helper are inserted once at the top of the document.

06 / SOURCE

Build it yourself.

The source package needs CMake 3.16+ and a C++20 compiler. It contains no third-party runtime dependencies.

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

The executable is build/shrt on single-config Linux generators and commonly build/Release/shrt.exe with Visual Studio generators. See the bundled README and spec.md for CLI and language details.