Skip to content
/ veyra Public

Veyra is a cutting-edge, general-purpose programming language designed for both beginners and professional. It combines performance, safety, concurrency, simplicity, and expressiveness into a single, modern language. Veyra emphasizes readability, maintainability, and developer productivity, making complex programming tasks intuitive and elegant.

License

Notifications You must be signed in to change notification settings

nishal21/veyra

Repository files navigation

Veyra Programming Language

CI PyPI License

Veyra is a modern programming language designed for web development and rapid prototyping, featuring built-in web capabilities and a clean, readable syntax.

✨ Features

  • 🚀 Fast Development: Simple syntax with powerful built-ins
  • 🌐 Web-Native: Built-in HTML, CSS, and web server functionality
  • 📦 Package Management: Easy dependency management with veyra-pm
  • 🎯 AI-Ready: Integrated machine learning functions (matrix operations, neural network primitives)
  • 🔧 Extensible: Easy to add new features and libraries
  • 📚 Rich Standard Library: Math, string manipulation, file I/O, JSON, and utility functions
  • 🏗️ Object-Oriented: Full class support with inheritance, methods, and instances
  • 🛡️ Error Handling: Try/catch blocks for robust error management
  • 🔄 Concurrency: Channel-based communication
  • 🖥️ Interactive REPL: Multi-line input support for rapid prototyping

📦 Installation

From PyPI (Recommended)

pip install veyra

From Source

git clone https://github.com/nishal21/veyra.git
cd veyra
pip install -e .

Requirements

  • Python 3.8+

🚀 Quick Start

Create a file hello.veyra:

fn main() {
    println("Hello, Veyra!");
}

Run it:

veyra hello.veyra

🌐 Web Development Example

fn main() {
    let page = create_page(
        "My App",
        html_element("h1", "Welcome to Veyra!"),
        css_style("body", "background: #f0f0f0;")
    );
    web_serve(page, 8080);
}

Visit http://localhost:8080 in your browser!

📚 Language Features

Variables and Functions

let message = "Hello";
let count = 42;

fn greet(name) {
    return "Hello, " + name + "!";
}

Control Flow

if count > 10 {
    println("Count is high");
} else {
    println("Count is low");
}

while count > 0 {
    println(count);
    count = count - 1;
}

Arrays and Objects

let numbers = [1, 2, 3, 4, 5];
let person = {"name": "Alice", "age": 30};

📖 Standard Library

Math Functions

  • abs(x) - Absolute value
  • sqrt(x) - Square root
  • pow(x, y) - Power function
  • max(...) - Maximum value
  • min(...) - Minimum value

String Functions

  • upper(s) - Convert to uppercase
  • lower(s) - Convert to lowercase
  • split(s, sep) - Split string
  • join(arr, sep) - Join array elements
  • len(obj) - Get length

Web Functions

  • html_element(tag, content, attrs) - Create HTML elements
  • css_style(selector, rules) - Generate CSS
  • create_page(title, body, css) - Build complete HTML pages
  • web_serve(content, port) - Start web server

📦 Package Management

Install packages:

veyra pm install math
veyra pm list

📁 Project Structure

veyra/
├── src/veyra/           # Core language implementation
│   ├── __init__.py
│   ├── cli.py          # Command line interface
│   ├── lexer.py        # Lexical analysis
│   ├── parser.py       # Syntax parsing
│   ├── interpreter.py  # Runtime execution
│   ├── pm.py           # Package manager
│   └── lib/            # Installed packages
├── examples/           # Example programs
├── tests/              # Test suite
├── docs/               # Documentation
└── README.md

🧪 Running Tests

pip install -e .[test]
pytest tests/

📚 Documentation

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📄 License

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

🙏 Acknowledgments

  • Built with Python
  • Inspired by modern programming languages
  • Community-driven development

📞 Contact


Veyra - Making web development fun and accessible! 🎉

About

Veyra is a cutting-edge, general-purpose programming language designed for both beginners and professional. It combines performance, safety, concurrency, simplicity, and expressiveness into a single, modern language. Veyra emphasizes readability, maintainability, and developer productivity, making complex programming tasks intuitive and elegant.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages