Quick Start
Installing Oraset
From Source
- Clone or download the Oraset source code to your local machine
- Ensure your system has Python 3.6 or higher installed
- Navigate to the Oraset directory and run the
oraset.py file directly
From Binary
- Download the binary file for your platform (
.exe for Windows, executable for Linux)
- Extract it to any directory
- Add the executable directory to your system environment variables (optional)
Running Your First Program
Create a Program File
Create a file named hello.oraset with the following content:
| !! This is a comment
show(`Hello, Oraset!`);
|
Run the Program
Using Python
| python oraset.py hello.oraset
|
Using Binary
| # Windows
oraset.exe hello.oraset
# Linux
./oraset hello.oraset
|
Expected Output
After running the program, you should see the following output:
Basic Syntax Examples
Variable Assignment
| name = `John`;
age = 25;
price = 9.99;
|
Output
| show(`Name: `, name);
show(`Age: `, age);
show(`Price: `, price);
|
Simple Calculation
| num1 = 10;
num2 = 20;
sum = num1 + num2;
show(`Sum: `, sum);
|
Next Steps
Common Issues
No Output When Running Program
- Check if you're using the
show function
- Ensure the file path is correct
- Check for syntax errors
Syntax Errors
- Check that parentheses are matched
- Ensure strings are enclosed in backticks
- Verify variable names are correct
Command Not Found
- Ensure the Oraset directory is added to your environment variables
- Or use the absolute path to run
Example Code
Calculating Factorial
| def factorial(n) {
if (n <= 1) {
return 1;
}
return n * factorial(n - 1);
}
show(`5! = `, factorial(5));
|
Array Operations
| fruits = arr(`apple`, `banana`, `cherry`);
show(`Fruits: `, fruits);
show(`First fruit: `, fruits[0]);
|