# SomonScript Tutorial

Learn SomonScript step by step with comprehensive tutorials designed for
developers of all experience levels.

## Learning Path

### 🌟 Getting Started

Perfect for developers new to SomonScript:

**[📚 Getting Started Guide →](getting-started.md)**

- Installation and setup
- Your first SomonScript program
- Basic syntax and concepts
- Variables, functions, and control flow
- Classes and objects
- Error handling

_Estimated time: 2-3 hours_

### 🚀 Next Steps

After completing the getting started guide, explore:

#### Advanced Language Features

- **Generic Types**: Write reusable, type-safe code
- **Module System**: Organize large applications
- **Async Programming**: Handle asynchronous operations
- **Advanced Types**: Union, intersection, and tuple types

#### Integration & Deployment

- **JavaScript Interop**: Use existing JavaScript libraries
- **Build Systems**: Integration with webpack, rollup, etc.
- **Testing**: Writing tests for SomonScript code
- **Production Deployment**: Optimizing for production

#### Best Practices

- **Code Organization**: Structuring SomonScript projects
- **Performance**: Writing efficient code
- **Type Safety**: Leveraging the type system
- **Documentation**: Documenting your code

## Tutorial Format

Each tutorial follows a consistent structure:

1. **Learning Objectives**: What you'll learn
2. **Prerequisites**: What you need to know first
3. **Step-by-Step Instructions**: Clear, actionable steps
4. **Code Examples**: Real, runnable code
5. **Practice Exercises**: Reinforce your learning
6. **Next Steps**: Where to go from here

## Prerequisites

### Required Knowledge

- Basic programming concepts (variables, functions, loops)
- Command line familiarity
- Text editor or IDE usage

### System Requirements

- Node.js 20.x or 22.x
- npm or yarn package manager
- Modern terminal/command prompt

### Recommended Setup

- VS Code with SomonScript extension
- Git for version control
- Basic understanding of JavaScript (helpful but not required)

## Learning Resources

### 📖 Documentation

- [Language Reference](../reference/) - Complete syntax guide
- [How-to Guides](../how-to/) - Problem-solving guides
- [Architecture](../explanation/architecture.md) - How SomonScript works
- [Testing Guide](../explanation/testing.md) - Quality assurance

### 💻 Code Examples

- [Examples Directory](../../examples/) - 32+ comprehensive examples
- [GitHub Repository](https://github.com/Slashmsu/somoni-script) - Source code

### 🤝 Community

- [GitHub Discussions](https://github.com/Slashmsu/somoni-script/discussions) -
  Q&A and discussions
- [Issues](https://github.com/Slashmsu/somoni-script/issues) - Bug reports and
  features

## Quick Reference

### Essential Commands

```bash
# Install SomonScript
npm install -g @lindentech/somon-script

# Verify installation
somon --version

# Run a program
somon run program.som

# Compile to JavaScript
somon compile program.som

# Get help
somon --help
```

### Basic Syntax

```som
// Variables
тағйирёбанда ном = "Аҳмад";
собит ПИ = 3.14159;

// Functions
функсия салом(ном: сатр): сатр {
    бозгашт "Салом, " + ном;
}

// Classes
синф Корбар {
    хосусӣ ном: сатр;

    конструктор(ном: сатр) {
        ин.ном = ном;
    }
}

// Control flow
агар шарт {
    // код
} вагарна {
    // код
}
```

## Learning Tips

### 1. Start Small

Begin with simple programs and gradually add complexity.

### 2. Practice Regularly

Write code daily, even if it's just small exercises.

### 3. Use the REPL

Experiment with SomonScript interactively:

```bash
somon repl
```

### 4. Read Examples

Study the examples in the `/examples` directory to see best practices.

### 5. Join the Community

Ask questions and share your progress in GitHub Discussions.

### 6. Build Projects

Apply what you learn by building real projects:

- Calculator application
- Todo list manager
- Simple web server
- Data processing scripts

## Getting Help

### Common Issues

- **Installation Problems**: Check Node.js version and permissions
- **Compilation Errors**: Review syntax and type annotations
- **Runtime Issues**: Use debugging tools and error messages

### Support Channels

- 📚 [Documentation](../../README.md) - Comprehensive guides
- 💬 [Discussions](https://github.com/Slashmsu/somoni-script/discussions) -
  Community Q&A
- 🐛 [Issues](https://github.com/Slashmsu/somoni-script/issues) - Bug reports
- 📧 [Email Support](mailto:support@somoni-script.org) - Direct help

### Before Asking for Help

1. Check the documentation
2. Search existing issues and discussions
3. Create a minimal example that reproduces your problem
4. Include error messages and system information

## Success Stories

_Share your learning journey and projects with the community! We'd love to
feature success stories from SomonScript learners._

---

Ready to start learning?
**[Begin with the Getting Started Guide →](getting-started.md)**
