Sona is a modern, interpreted programming language featuring object-oriented programming, advanced dictionary operations, and an intuitive module system. Designed for readability and ease of use, Sona combines familiar syntax with powerful features.
- Classes and Inheritance: Full support for class definitions, method calls, and inheritance chains
- Property Access: Clean dotted notation for accessing object properties and methods
- Method Calls: Intuitive syntax for calling methods on objects
- Dictionary Literals: Create dictionaries with
{key: value}
syntax - Dotted Property Access: Access dictionary values using dot notation (
dict.property
) - Dynamic Properties: Set and get properties dynamically at runtime
- Dotted Imports: Import modules with clean dotted notation
- Standard Library: Rich collection of built-in modules for common operations
- Custom Modules: Easy creation and sharing of custom module files
- Interactive REPL: Full-featured read-eval-print loop for rapid development
- Detailed Error Messages: Comprehensive error reporting with line/column information
- Cross-Platform: Runs on Windows, macOS, and Linux
- Python 3.8 or higher
- pip package manager
pip install sona
git clone https://github.com/Bryantad/Sona.git
cd Sona
pip install -e .
sona --version
# Clone and run with graphical interface
git clone https://github.com/Bryantad/Sona.git
cd Sona
python launcher.py
The GUI launcher provides:
- 📁 Example Browser - Browse and run all Sona examples
- 💻 Interactive REPL - Test code snippets in real-time
- 🎮 Embedded Apps - Run games and demos directly in the interface
- 📝 Code Editor - View and edit Sona files with syntax highlighting
For the enhanced modern interface, install PySide6:
pip install PySide6
python launcher.py
# Run Sona files directly
python -m sona examples/hello_world.sona
# Start interactive REPL
python -m sona
# Get help
python -m sona --help
// Variables and basic operations
let name = "Sona"
let version = 0.7
func greet(user) {
return "Welcome to " + name + " v" + str(version) + ", " + user + "!"
}
print(greet("Developer"))
class Person {
func init(name, age) {
self.name = name
self.age = age
}
func introduce() {
return "Hi, I'm " + self.name + " and I'm " + str(self.age) + " years old."
}
}
let person = Person("Alice", 30)
print(person.introduce())
// Dictionary literals with dotted access
let config = {
app_name: "My App",
version: "1.0.0",
debug: true
}
print("Running " + config.app_name + " v" + config.version)
// Dynamic property setting
config.environment = "production"
import math
import string
let result = math.sqrt(25)
print("Square root: " + str(result))
let text = "hello world"
print("Capitalized: " + string.capitalize(text))
// Conditional statements
if (condition) {
// code
} else if (other_condition) {
// code
} else {
// code
}
// Pattern matching
match value {
case 1: print("One")
case 2: print("Two")
default: print("Other")
}
// Loops
for (let i = 0; i < 10; i += 1) {
print(i)
}
while (condition) {
// code
}
try {
// risky code
} catch (error) {
print("Error occurred: " + str(error))
}
Explore the examples/
directory for comprehensive code samples:
dictionary_operations.sona
- Advanced dictionary usagemodule_system.sona
- Module import and usage patternsobject_oriented.sona
- Class definitions and inheritancebasic_features.sona
- Core language functionality
git clone https://github.com/Bryantad/Sona.git
cd Sona
pip install -e .[dev]
python -m pytest tests/
We follow PEP 8 guidelines. Format code using:
black sona/
- Enhanced OOP Support: Improved class syntax and inheritance mechanisms
- Dictionary Enhancements: Better performance and cleaner syntax for dictionary operations
- Module System Improvements: More intuitive import syntax and better standard library organization
- Developer Experience: Enhanced error messages and debugging capabilities
- Performance Optimizations: Faster execution and reduced memory usage
We welcome contributions from the community! Please read our Contributing Guidelines for details on:
- Code of conduct
- Development workflow
- Coding standards
- Testing requirements
- Pull request process
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: docs/
- Examples: examples/
- Issues: GitHub Issues
- Releases: GitHub Releases
Happy coding with Sona! 🎵