This page provides a general overview of how the ProtoLang programming language works and its fundamental syntax rules.
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.
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 xThe long syntax uses full words (the token unit) for improved readability:
NEW INTEGER x EQUAL TO 5
PRINT xThis 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 + yThe 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.
ProtoLang follows these fundamental rules:
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.
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.
Instructions that direct the computer to perform specific actions, forming the basis of every statement.
Define the kind of information a variable can store: Boolean, Integer, Float, and String.
The data acted upon by commands, literals provided, variables, or expressions.
Serve unique purposes beyond standard arithmetic, comparison, or logical operations.
Perform mathematical calculations on Integer and Float values.
Compare two values and produce a Boolean result.
Combine multiple Boolean expressions to form complex conditions.
Enable conditional execution of code blocks based on Boolean expressions.
Allow repeated execution of code blocks under specified conditions.
Define reusable code blocks with optional parameters and local scope.
Special syntax tokens that structure statements and delimit values.