Skip to content

Latest commit

 

History

History
216 lines (145 loc) · 4.98 KB

File metadata and controls

216 lines (145 loc) · 4.98 KB

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 →

  • 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

💻 Code Examples

🤝 Community

Quick Reference

Essential Commands

# 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

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

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

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 →