Getting Started with USL¶
Welcome to USL! This guide will help you get up and running quickly.
Quick Installation¶
Choose your platform:
Verify Installation¶
System Requirements¶
- Operating System: macOS 10.15+, Linux (Ubuntu 20.04+), Windows 10+
- Memory: 2GB RAM minimum (4GB recommended)
- Disk Space: 500MB for compiler + generated code
- Dependencies:
- Rust 1.75+ (for compilation from source)
- Node.js 18+ (for TypeScript code generation)
- Python 3.9+ (for Python code generation)
Editor Support¶
VS Code (Recommended)¶
Extension: Coming soon! 🚧
Planned features: - Syntax highlighting - IntelliSense and autocomplete - Error checking - Format on save - Go to definition - Refactoring support
Other Editors¶
Plugins: Coming soon! 🚧
- Vim/Neovim: In development
- Emacs: Planned
- IntelliJ IDEA: Planned
- Sublime Text: Planned
Create Your First Project¶
This creates:
my-app/
├── my-app.usl # Main specification
├── usl.toml # Project configuration
├── .gitignore # Git ignore rules
└── README.md # Project documentation
Hello World¶
Edit my-app.usl:
domain HelloWorld {
entity Greeting {
id: GreetingId @primary
message: String
}
}
service GreetingService {
action sayHello(name: String) -> Greeting
effects { Write(Greeting) }
implementation {
let greeting = Greeting {
id: generateId(),
message: "Hello, " + name + "!"
}
store(greeting)
return greeting
}
}
Compile¶
Expected output:
Compiling my-app.usl...
✓ Lexical analysis complete
✓ Parsing complete
✓ Semantic analysis complete
✓ Type checking complete
✓ Verification complete
Compilation successful!
Generate Code¶
Test Your API¶
curl -X POST http://localhost:3000/api/sayHello \
-H "Content-Type: application/json" \
-d '{"name": "World"}'
Response:
What's Next?¶
You've successfully: - ✅ Installed USL - ✅ Created your first project - ✅ Written USL code - ✅ Compiled and generated code - ✅ Tested your API
Continue learning:
- Tutorial 1: Getting Started - Build a complete task manager
- Language Overview - Learn USL syntax and semantics
- Example Projects - Explore real-world applications
Troubleshooting¶
Installation Issues¶
Problem: usl: command not found
Solution:
# Add to PATH
export PATH="$HOME/.usl/bin:$PATH"
# Add to shell profile
echo 'export PATH="$HOME/.usl/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Problem: Permission denied
Solution:
Compilation Errors¶
See Error Reference for detailed error explanations.
Getting Help¶
Configuration¶
Edit usl.toml to customize your project:
[package]
name = "my-app"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
[compiler]
# Verification level: none, basic, full
verification = "full"
# Enable experimental features
experimental = false
[generate]
# Default code generation target
default_target = "typescript"
[generate.typescript]
# Output directory
output = "./backend"
# Package manager: npm, yarn, pnpm
package_manager = "npm"
# Framework: express, fastify, nestjs
framework = "express"
[generate.rust]
output = "./api"
# Web framework: actix, axum, rocket
framework = "axum"
[generate.python]
output = "./server"
# Framework: flask, fastapi, django
framework = "fastapi"
Update USL¶
Check for updates:
Or reinstall:
Uninstall¶
Learn More¶
- Architecture - How USL works internally
- Contributing - Join the USL community
- Roadmap - Future plans