Usage
July 20, 2025About 2 minguideusagedevelopment
Basic Usage
Create Your First Hulo Program
Create a file named hello.hl
:
echo "Hello, Hulo!"
Compile and Run
# Compile to Bash script
hulo hello.hl -t bash
# Compile to PowerShell script
hulo hello.hl -t powershell
# Compile to VBScript
hulo hello.hl -t vbs
# Run directly (defaults to current platform script)
hulo hello.hl
Command Line Options
hulo [options] <file>
Options:
-t, --target <platform> Specify target platform (bash|powershell|vbs)
-o, --output <file> Specify output file
-V, --version Show version information
-h, --help Show help information
--verbose Show detailed compilation information
Project Structure
A typical Hulo project structure:
my-project/
├── src/
│ ├── main.hl # Main program entry
│ ├── utils.hl # Utility functions
│ └── config.hl # Configuration files
├── tests/
│ └── test.hl # Test files
├── dist/ # Compiled output directory
└── huloc.yaml # Project configuration file
Project Configuration
Create a huloc.yaml
configuration file:
main: main.hl # Main program entry point
targets: # Platforms to compile to
- vbs
- bash
out_dir: dist/ # Output path after compilation
Development Workflow
1. Write Code
import "utils"
fn main() {
utils.greet("World")
echo "Program execution completed!"
}
2. Compile and Test
# Compile and test
hulo src/main.hl -t bash
./dist/main.sh
3. Debug
# Enable verbose output
hulo src/main.hl --verbose
# Check syntax
hulo src/main.hl --check
Best Practices
Code Organization
- Organize related functionality into modules
- Use meaningful file names and function names
- Add appropriate comments and documentation
Development Integration
Editor Support
- VS Code: Install Hulo extension for syntax highlighting and IntelliSense
- Vim/Neovim: Configure syntax highlighting and auto-completion
- Other editors: Support for generic syntax highlighting
Version Control
# Initialize Git repository
git init
# Add .gitignore
echo "dist/" >> .gitignore
echo "*.log" >> .gitignore
# Commit code
git add .
git commit -m "Initial commit"
Deployment
Local Deployment
# Compile production version
hulo src/main.hl -t bash -o dist/app.sh
# Set execution permissions
chmod +x dist/app.sh
Cross-platform Distribution
# Compile for multiple platforms
hulo src/main.hl -t bash -o dist/app.sh
hulo src/main.hl -t powershell -o dist/app.ps1
hulo src/main.hl -t vbs -o dist/app.vbs
Frequently Asked Questions
Q: How to specify a custom output directory?
A: Use the -o
option: hulo main.hl -o /path/to/output/script.sh
Q: Which target platforms are supported?
A: Currently supports Bash, PowerShell, VBScript, with more platforms under development.
Q: How to handle dependency management?
A: Use the huloc.yaml
configuration file to manage project dependencies and build settings.
Q: How to debug compilation errors?
A: Use the --verbose
option to get detailed compilation information.