ProtoLang.net

Reference: Index

☰ Hide Sidebar

ProtoLang Reference

This page provides a general overview of how the ProtoLang programming language works and its fundamental syntax rules.

Core Syntax Principles

Understanding how ProtoLang processes your code will help you write programs more effectively. When you write code, it is processed by the parser—the internal engine that reads your instructions and translates them into actions the computer can understand. The parser breaks your code down into tokens, which are the smallest, most basic units of the language. You can think of tokens as the individual "words" or "punctuation marks" in a ProtoLang sentence. Many tokens have aliases, which means different symbols or written forms represent the exact same unit to the parser. For example, INT and INTEGER are aliases that both represent the integer data type token. Similarly, = and EQUAL TO both represent the assignment operator token.

Dual Syntax Structure

ProtoLang offers two equivalent syntax structures: short syntax and long syntax. Both structures are functionally identical and represent the same underlying tokens to the language parser.

The short syntax uses symbols or partial words (called aliases in ProtoLang) for a more compact writing style:

NEW INT x = 5
PRINT x

The long syntax uses full words (the token unit) for improved readability:

NEW INTEGER x EQUAL TO 5
PRINT x

This token-based system means that short and long syntax are truly equivalent - they produce identical tokens for the parser to process. You can freely mix both syntax styles within the same program because the parser sees them as the same instructions:

NEW INT x = 5
NEW INTEGER y EQUAL TO 10
PRINT x + y

The ProtoLang IDE includes a Toggle button that instantly switches your code between short and long syntax at any time. This feature allows you to work in whichever style you prefer while exploring how the two formats correspond to each other.

Basic Syntax Rules

ProtoLang follows these fundamental rules:

  • Case Sensitivity: ProtoLang tokens are case-insensitive (PRINT, Print, and print are equivalent). Variables are case-sensitive (x and X are different variables).
  • Token Spacing: Within a statement, ProtoLang's parser expects exactly 1 space between tokens. This helps prevent coding errors by making it easier for the programmer to identify each token's position and role in a statement.
  • Whitespace: While tokens must be separated by a single space, you may use any number of spaces, tabs, or newlines before a statement starts or after it ends. This allows you to indent your code or add vertical gaps to keep your scripts organized and readable.
  • Comments: Use (// or COMMENT) to create single-line comments that are ignored during execution.

Finding Detailed Information

Each language feature has its own dedicated reference page with comprehensive documentation and examples. Use the navigation to explore specific topics, and you'll find detailed explanations of syntax, behavior, and common usage patterns for every token in the language.

Documentation Convention

All reference documentation examples follow a standardized style for clarity: variables are written in camelCase, while all other language tokens are written in UPPERCASE. Additionally, examples use the short syntax for consistency and brevity. Remember that you can toggle any example to long syntax using the IDE's Toggle button, or write your own code using either syntax style or a mixture of both.


This section provides documentation for all core features of the ProtoLang programming language.

  • Commands

    Instructions that direct the computer to perform specific actions, forming the basis of every statement.

  • Data Types

    Define the kind of information a variable can store: Boolean, Integer, Float, and String.

  • Values

    The data acted upon by commands, literals provided, variables, or expressions.

  • General Operators

    Serve unique purposes beyond standard arithmetic, comparison, or logical operations.

  • Arithmetic Operators

    Perform mathematical calculations on Integer and Float values.

  • Comparison Operators

    Compare two values and produce a Boolean result.

  • Logical Operators

    Combine multiple Boolean expressions to form complex conditions.

  • Conditionals

    Enable conditional execution of code blocks based on Boolean expressions.

  • Loops

    Allow repeated execution of code blocks under specified conditions.

  • Functions

    Define reusable code blocks with optional parameters and local scope.

  • Delimiters

    Special syntax tokens that structure statements and delimit values.