Introduction to Soplang

Welcome to the official documentation for Soplang, a modern programming language inspired by Python that combines simplicity, readability, and performance.

What is Soplang?

Soplang is a high-level, general-purpose programming language designed with a focus on code readability and developer productivity. It takes inspiration from Python's clean syntax while introducing performance optimizations and modern language features.

Key Features

  • Clean, Readable Syntax: Soplang uses indentation to define code blocks, making your code clean and consistent.
  • Strong, Dynamic Typing: Variables are dynamically typed, but the language enforces type consistency during operations.
  • Performance Optimized: Soplang includes a just-in-time compiler that provides significant performance improvements over traditional interpreted languages.
  • Modern Language Features: Includes pattern matching, async/await, and other modern programming paradigms.
  • Comprehensive Standard Library: Comes with batteries included - a rich set of modules and functions for common tasks.
  • Cross-Platform: Runs on Windows, macOS, Linux, and more.

A Simple Example

# This is a simple Soplang program
def greet(name):
    """Return a greeting message"""
    return f"Hello, {name}! Welcome to Soplang."

# Using the function
message = greet("World")
print(message)

# Working with lists
numbers = [1, 2, 3, 4, 5]
squared = [n * n for n in numbers]
print(f"Original: {numbers}")
print(f"Squared: {squared}")

# Simple class definition
class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age
    
    def describe(self):
        return f"{self.name} is {self.age} years old."

# Creating an object
alice = Person("Alice", 30)
print(alice.describe())

Philosophy

Soplang follows these key principles:

  1. Readability counts: Code is read more often than it's written. Soplang prioritizes clear, readable syntax.
  2. Explicit is better than implicit: Soplang avoids hidden behaviors and magic methods where possible.
  3. Simple is better than complex: The language aims to provide straightforward solutions to common problems.
  4. Performance matters: While maintaining readability, Soplang is designed with performance in mind.

Getting Started

Ready to dive in? Here are some resources to help you get started with Soplang:

Community and Support

Soplang has a growing community of developers. Here's how you can get involved and find help: