Skip to content

Repository files navigation

Mach VS Code Extension

Official editor support for the Mach programming language.

About Mach

Mach is a statically typed, compiled systems language with explicit control over data layout and resource management. The language emphasizes:

  • Explicit control - No implicit heap allocation, lifetime management, or type coercion
  • Predictable semantics - Well-defined types and compile-time error checking
  • C interoperability - Data layout and calling conventions align with the platform C ABI
  • Minimal core - Small, orthogonal feature set that composes well

For the complete language specification, see the doc/language/ directory in the mach repository (grammar.md is the authoritative syntax reference).

Features

  • Syntax highlighting kept in sync with the current compiler keywords, intrinsics, and operators
  • Support for current Mach syntax including:
    • Records (rec), unions (uni) and tags (tag Name: u8 { case; case: Payload; })
    • Tag construction Type.case{payload} and the sel place.case test
    • Generic types and functions with [T] bracket syntax
    • Method definitions using Type.method syntax
    • Comptime directives $if/$or/$each/$error, $-intrinsics ($size_of, $cases, $is_tag, $discriminant_of, ...), and $mach.* reads
    • Value (::), bit-reinterpret (:~) and public-result (:>) casts, address-of (?) / dereference (@) operators
    • Decorators #[inline], #[deprecated("msg")], #[oblivious], #[packed], ...
    • Inline assembly blocks (asm <isa> { ... })
    • Variadic functions (...)
  • Line comments with # including toggle/comment actions
  • Bracket, brace, and quote auto-closing/surrounding pairs aligned with the Mach parser

Getting Started

  1. Install the extension from the Marketplace or install a packaged .vsix in VS Code
  2. Open a .mach source file - syntax highlighting and comment toggling work out-of-the-box
  3. Pair with the mach compiler from the mach repository

Contributing

  • Report syntax gaps or highlighting bugs in the mach-vscode repository
  • For language design issues, see the main mach repository
  • When publishing, remember to bump the version in package.json and run:
npx @vscode/vsce publish

The Mach language is under active development; changes may occur as the language evolves toward self-hosting.

About

Mach language support for Visual Studio Code

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages