Skip to content

a2Fsa2k/swaraj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swaraj

A Marathi Programming Language

Swaraj Demo

Swaraj is a programming language with Marathi keywords, designed to honor Maharashtra's linguistic heritage while providing modern programming capabilities.

Philosophy

Swaraj means "self-rule" or "independence" in Marathi. This language embodies that spirit by using authentic Marathi words for all keywords, making programming accessible and natural for Marathi speakers.

Features

  • Marathi Keywords - Every keyword is authentic Marathi
  • Fast & Safe - Written in Rust for performance and safety
  • Simple & Clean - Easy to learn, powerful to use
  • Intuitive Syntax - Based on natural Marathi grammar
  • Modern Features - Functions, recursion, loops, conditionals, lists

Installation

Prerequisites

Build from Source

git clone https://github.com/urngmi/swaraj
cd swaraj
cargo build --release

The compiled binary will be at target/release/swaraj.

Usage

Run a Program

swaraj program.sw

Interactive REPL

swaraj

Command-Line Options

swaraj --help       # Show help
swaraj --version    # Show version
swaraj -i           # Start REPL
swaraj file.sw      # Run a file

Quick Start

Hello World

bol "Namaste, Duniya!"

Variables

samajh name = "Maharashtra"
samajh count: puranaank = 42
samajh price: ardhaank = 99.99
bol name

Functions

kaarya square(n: puranaank): puranaank {
    dya n * n
}

bol square(5)

Conditionals

jar (age >= 18) tar {
    bol "Adult"
} naahi {
    bol "Minor"
}

Loops

prati i madhye 1..10 {
    bol i
}

Lists

samajh numbers = [10, 20, 30]
bol numbers[0]

Keywords Reference

Core Keywords

Marathi Devanagari English Usage
samajh समज understand/let Variable declaration
kaarya कार्य function/work Function declaration
dya द्या give/return Return statement
bol बोल say/print Output

Control Flow

Marathi Devanagari English Usage
jar जर if Conditional
tar तर then Then clause
naahi नाही else/not Else clause
prati प्रति for each For loop
madhye मध्ये in Range specification
paryant पर्यंत while/until While loop

Data Types

Marathi Devanagari English Example
puranaank पूर्णांक integer 42
ardhaank अर्धांक float 3.14
akshar अक्षर string "text"
satya सत्य true boolean true
asatya असत्य false boolean false
yaadi यादी list [1, 2, 3]

Examples

The examples/ directory contains tutorial programs:

swaraj examples/01_hello.sw

See examples/README.md for the complete tutorial guide.

Development

Running Tests

cargo test

Building Release

cargo build --release

License

MIT License


Swaraj - Programming with Independence

Made with love for Maharashtra

About

Minimal C-like programming language with Marathi keywords, featuring interpreter and REPL, written in Rust.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages