โ๏ธSyntax
Zaidlang's syntax pulls a lot of influence from other C-like languages. In particular Go, JavaScript, and PHP. It's designed to be familiar to those coming from these languages, with the aim to be simple and predictable.
Scripts are stored in plain text files with a .zaid
file extension. Zaidlang does not compile ahead of time: programs are run directly from source, from top to bottom like any other scripting language.
Comments
Single line comments start with //
and continue to the end of the line.
Block comments are enclosed within /* ... */
and can span as many lines as necessary.
Comments behave like whitespace and are discarded during execution. While single line comments are the norm, block comments are useful within an expression or to disable large swaths of code.
Reserved Words
Zaidlang has a small subset of reserved words used as predefined identifiers. None of the identifiers listed here should be used as identifiers in any of your scripts.
Identifiers
Naming rules are similar to other programming languages. Identifiers must start with a letter or underscore and may then contain letters, digits, and underscores. Case is sensitive.
Blocks
Zaidlang uses curly braces to define blocks. You can use a block anywhere a statement is allowed, like in control flow statements.
Last updated