Syntax Reference
BigC uses a unique "Grammar" to separate actions, destinations, and values.
1. Variables
In BigC, variables are created simply by assigning a value to a name. You do not need to declare types.
Assignment
- Strings:
Name = "John" - Numbers:
Price = 10.50 - Math:
get Price 1 + & set as {NewPrice}
Rules
- Variable names must start with a letter.
- They are case-sensitive.
- Numeric variables can be assigned directly (
X = 10) or via calculation (set as {X}).
2. String Interpolation
Use the $ symbol to inject variables into text.
print "Hello $Name"print "Your balance is ${Credits}!"
Variable Interpolation (The Warp)
Standard assignment (Name = "Val") creates literal strings. To inject variables into a new variable, use get warp.
get warp "Hello $Name" & set as {Greeting}
3. The Type System (Automatic Coercion)
BigC is designed to be "Textbook Simple," so it handles most type conversions automatically.
String to Number
When you use a string variable in a math operation (get, if, etc.), the engine automatically attempts to parse it as a number.
- If the string is
"10", it becomes the number10.0. - If the string is not a valid number (e.g.,
"Hello"), it defaults to0.0.
Example:
X = "10"
Y = 5
get X Y + & set as {Result}
# Result is 15
Implicit Conversion Hacks
While BigC doesn't require explicit "cast" commands, you can force a type change using these patterns:
- Force to Number (Plus Zero):
get StringVal 0 + & set as {NumericVar} - Force to String (The Warp):
get warp "$NumericVal" & set as {StringVar}
4. The Grammar Symbols
& (The Connector)
The & symbol is the bridge between a Cause and an Effect. It allows you to chain multiple commands or conditions on a single line.
get 1 1 + & set as {Result}(Calculate AND Save)if X > 10 & print "Big!"(Check AND Action)
{} (The Container)
Wraps an output variable name. This tells the engine: "Put the result inside this box."
set as {Var}
@ (The Target)
Points to a destination, such as a physical file, a Data Map, or a search source.
write "Text" @"file.txt"look for "h1" @Response