Skip to content
/ Sona Public

Sona is a lightweight, REPL-first programming language that prioritizes human-readable code and developer mental flow. Designed from the ground up with modular agents, hybrid AI integration, and ADHD-friendly structure, Sona reimagines the coding experience for clarity, rapid prototyping, and long-term scalability.

License

Notifications You must be signed in to change notification settings

Bryantad/Sona

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sona Programming Language v0.7.0

Version License Language

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.

✨ Key Features

Object-Oriented Programming

  • 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

Advanced Dictionary Support

  • 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

Enhanced Module System

  • 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

Developer-Friendly Features

  • 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

🚀 Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Install from PyPI

pip install sona

Install from Source

git clone https://github.com/Bryantad/Sona.git
cd Sona
pip install -e .

Verify Installation

sona --version

📚 Quick Start

GUI Interface (Recommended for New Users)

# 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

Command Line Interface

# Run Sona files directly
python -m sona examples/hello_world.sona

# Start interactive REPL
python -m sona

# Get help
python -m sona --help

Basic Syntax Examples

Variables and Functions

// 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"))

Object-Oriented Programming

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 Operations

// 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"

Module System

import math
import string

let result = math.sqrt(25)
print("Square root: " + str(result))

let text = "hello world"
print("Capitalized: " + string.capitalize(text))

📖 Language Guide

Control Flow

// 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
}

Error Handling

try {
    // risky code
} catch (error) {
    print("Error occurred: " + str(error))
}

🧪 Examples

Explore the examples/ directory for comprehensive code samples:

  • dictionary_operations.sona - Advanced dictionary usage
  • module_system.sona - Module import and usage patterns
  • object_oriented.sona - Class definitions and inheritance
  • basic_features.sona - Core language functionality

🔧 Development

Setting Up Development Environment

git clone https://github.com/Bryantad/Sona.git
cd Sona
pip install -e .[dev]

Running Tests

python -m pytest tests/

Code Style

We follow PEP 8 guidelines. Format code using:

black sona/

📋 Version 0.7.0 Highlights

  • 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

🤝 Contributing

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

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links


Happy coding with Sona! 🎵

About

Sona is a lightweight, REPL-first programming language that prioritizes human-readable code and developer mental flow. Designed from the ground up with modular agents, hybrid AI integration, and ADHD-friendly structure, Sona reimagines the coding experience for clarity, rapid prototyping, and long-term scalability.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •