UNPKG

odiascript

Version:

Odia (Oriya) keyword-based programming language runtime. Created by Atikin Verse.

321 lines (228 loc) 9.59 kB
# 🪔 OdiaScript A fun, beginner-friendly, **Odia language-based programming language** built for Indian developers who want to code in their own mother tongue. With syntax inspired by **Odia words and grammar**, OdiaScript makes programming more relatable, fun, and culturally connected. **Created by Atikin Verse.** --- ## 📌 Snippets This is a simple code snippet table for OdiaScript projects. | 🧠 **OdiaScript Syntax** | 💻 **JavaScript Equivalent** | |--------------------------------|--------------------------------------------| | `ଲେ x = 5` | `let x = 5` | | `ସ୍ଥିର y = 10` | `const y = 10` | | `ଛାପ "ନମସ୍କାର"` | `console.log("ନମସ୍କାର")` | | `ଯଦି (x > 3)` | `if (x > 3) {` | | `ନଚେତ୍` | `} else {` | | `ଯାହା ପର୍ଯ୍ୟନ୍ତ (x < 5)` | `while (x < 5) {` | | `କାମ greet(ନାମ)` | `function greet(name) {` | | `ଫେରାଇବା x * y` | `return x * y` | | `କାମ ସମାପ୍ତ` | `}` | | `ଡାକ greet("ପ୍ରିୟ")` | `greet("ପ୍ରିୟ")` | | `ସତ୍ୟ` | `true` | | `ମିଥ୍ୟା` | `false` | | `ପଢିବା_ଫାଇଲ "data.txt"` | `fs.readFileSync("data.txt", "utf-8")` | | `ଲେଖିବା_ଫାଇଲ "out.txt", "hi"` | `fs.writeFileSync("out.txt", "hi")` | | `ଚେଷ୍ଟା କର` | `try {` | | `ଧର (ତ୍ରୁଟି)` | `} catch (error) {` | | `ତ୍ରୁଟି "ସନ୍ଦେଶ"` | `throw new Error("ସନ୍ଦେଶ")` | | `ଘଟଣା click = ଛାପ "ok"` | `click = function() { console.log("ok") }` | --- ## 🚀 Features - **Pure Odia syntax** for variable declaration, loops, conditions, and more. - Easy-to-use **CLI tool** for running `.os` files. - Works without showing or mentioning JavaScript anywhere. - Beginner-friendly learn programming in your own mother tongue. - File operations (read/write), error handling, and event handling in Odia. - Created with ❤️ by **Atikin Verse**. --- ## 🔧 Installation | Step | Command / Description | |--------------------------------|--------------------------------------------------------------------------------| | Clone the repository | `git clone https://github.com/atikinverse/odiascript.git` | | Navigate to project folder | `cd odiascript` | | Install globally | `npm install -g .` | | Run an OdiaScript file | `odiascript path/to/file.os` | --- ## 🏁 Getting Started **1. Create a `.os` file** Example: `hello.os` ```odia # 1️⃣ Simple Hello World କାର୍ଯ୍ୟ ପରୀକ୍ଷା1() { ଛାପ("ନମସ୍କାର, ବିଶ୍ୱ!"); } ପରୀକ୍ଷା1(); # Output: ନମସ୍କାର, ବିଶ୍ୱ! --- # 2️⃣ Variables & Addition କାର୍ଯ୍ୟ ପରୀକ୍ଷା2() { ଲେ = 5; ଲେ = 3; ଛାପ("ଯୋଗଫଳ: " + (କ + ଖ)); } ପରୀକ୍ଷା2(); # Output: ଯୋଗଫଳ: 8 --- # 3️⃣ If-Else କାର୍ଯ୍ୟ ପରୀକ୍ଷା3() { ଲେ ସ୍କୋର = 75; ଯଦି (ସ୍କୋର >= 80) { ଛାପ("ଦରୁଣ!"); } ନହେଲେ ଯଦି (ସ୍କୋର >= 60) { ଛାପ("ଭଲ!"); } ନହେଲେ { ଛାପ("ପାସ୍!"); } } ପରୀକ୍ଷା3(); # Output: ଭଲ! --- # 4️⃣ While Loop କାର୍ଯ୍ୟ ପରୀକ୍ଷା4() { ଲେ ଗଣନା = 1; ଯାହାପର୍ଯ୍ୟନ୍ତ (ଗଣନା <= 3) { ଛାପ("ଗଣନା: " + ଗଣନା); ଗଣନା = ଗଣନା + 1; } } ପରୀକ୍ଷା4(); # Output: # ଗଣନା: 1 # ଗଣନା: 2 # ଗଣନା: 3 --- # 5️⃣ For Loop କାର୍ଯ୍ୟ ପରୀକ୍ଷା5() { ପାଇ (ଲେ i = 1; i <= 3; i = i + 1) { ଛାପ("ଆଇଟମ୍: " + i); } } ପରୀକ୍ଷା5(); # Output: # ଆଇଟମ୍: 1 # ଆଇଟମ୍: 2 # ଆଇଟମ୍: 3 --- # 6️⃣ Array Usage କାର୍ଯ୍ୟ ପରୀକ୍ଷା6() { ଲେ ତାଲିକା = ["ଆମ୍ବ", "କଦଳୀ", "ଲିଚୁ"]; ତାଲିକା.ପ୍ରତି(କାର୍ଯ୍ୟ(ଫଳ) { ଛାପ("ଫଳ: " + ଫଳ); }); } ପରୀକ୍ଷା6(); # Output: # ଫଳ: ଆମ୍ବ # ଫଳ: କଦଳୀ # ଫଳ: ଲିଚୁ --- # 7️⃣ Function with Return କାର୍ଯ୍ୟ ଯୋଗ(କ, ଖ) { ଫେରତ କ + ଖ; } କାର୍ଯ୍ୟ ପରୀକ୍ଷା7() { ଛାପ("ଫଳାଫଳ: " + ଯୋଗ(10, 15)); } ପରୀକ୍ଷା7(); # Output: ଫଳାଫଳ: 25 --- # 8️⃣ Object Usage କାର୍ଯ୍ୟ ପରୀକ୍ଷା8() { ଲେ ମଣିଷ = {ନାମ: "ଆତିକିନ", ବୟସ୍: 25}; ଛାପ("ନାମ: " + ମଣିଷ.ନାମ); ଛାପ("ବୟସ୍: " + ମଣିଷ.ବୟସ୍); } ପରୀକ୍ଷା8(); # Output: # ନାମ: ଆତିକିନ # ବୟସ୍: 25 --- # 9️⃣ Try-Catch କାର୍ଯ୍ୟ ପରୀକ୍ଷା9() { ଚେଷ୍ଟା { ଛାଡ଼ "ତ୍ରୁଟି ଘଟିଲା!"; } ଧର (ଭୁଲ) { ଛାପ("ଧରା ପଡ଼ିଥିବା ତ୍ରୁଟି: " + ଭୁଲ); } } ପରୀକ୍ଷା9(); # Output: ଧରା ପଡ଼ିଥିବା ତ୍ରୁଟି: ତ୍ରୁଟି ଘଟିଲା! --- # 🔟 Async & Await (Simulated) ଅସମ୍ପୂର୍ଣ୍ଣ କାର୍ଯ୍ୟ ପରୀକ୍ଷା10() { ଛାପ("ଡାଟା ଆଣୁଛି..."); ଅପେକ୍ଷା କର ନୂତନ ପ୍ରତିଶ୍ରୁତି(କାର୍ଯ୍ୟ(ସମାଧାନ) { ସମୟପରେ(କାର୍ଯ୍ୟ() { ସମାଧାନ(); }, 1000); }); ଛାପ("ଡାଟା ଲୋଡ୍ ସମ୍ପୂର୍ଣ୍ଣ!"); } ପରୀକ୍ଷା10(); # Output: # ଡାଟା ଆଣୁଛି... # (1 ସେକେଣ୍ଡ ପରେ) # ଡାଟା ଲୋଡ୍ ସମ୍ପୂର୍ଣ୍ଣ! ``` --- ## ⚙️ ଇନସ୍ଟଲେସନ (Installation) ```bash npm install -g odiascript ``` --- 🧪 ବ୍ୟବହାର (Usage) ## CLI ଦ୍ୱାରା OdiaScript ଫାଇଲ ଚଳାନ୍ତୁ: ```bash odiascript path/to/file.os ``` ```bash ଉଦାହରଣ (Example): odiascript samples/hello.os ``` --- ## 🏁 How to Run OdiaScript Follow these steps to create and run your first OdiaScript program: 1️⃣ Install Node.js - Download from https://nodejs.org - Install it on your system. 2️⃣ Install OdiaScript ```bash npm install -g odiascript ``` 3️⃣ Create a .os File Example: hello.os ଲେ ନାମ = "ଆତିକିନ" ଛାପ "ନମସ୍କାର " + ନାମ 4️⃣ Run the File ```bash odiascript hello.os ``` 5️⃣ Output: ନମସ୍କାର ଆତିକିନ --- ## 🔖 ଲାଇସେନ୍ସ MIT License ଅନୁସାରେ ପ୍ରଦାନ କରାଯାଇଛି। --- ## 🧑‍💻 ସୃଷ୍ଟା Atikin Verse ହୃଦୟରୁ ତିଆରି କେବଳ ଶିକ୍ଷା ଏବଂ ଭାଷା ପ୍ରେମ ପାଇଁ ❤️ --- ## FOLLOW US ON For more information: Join our social media for exciting updates, news, and insights! Follow us on : <!--Table--> | ACCOUNTS | USERNAME | |------------ | -------------- | | FACEBOOK | atikinverse | | INSTAGRAM | atikinverse | | LINKEDIN | atikinverse | | TWITTER (X) | atikinverse | | THREADS | atikinverse | | PINTREST | atikinverse | | QUORA | atikinverse | | REDDIT | atikinverse | | TUMBLR | atikinverse | | SNAPCHAT | atikinverse | | SKYPE | atikinverse | | GITHUB | atikinverse | --- ## 📬 ଯେକ for‌ଣସି ପ୍ରତିକ୍ରିୟା, ପରାମର୍ଶ କିମ୍ବା ସହଯୋଗ ପାଇଁ ସମ୍ପର୍କ କରନ୍ତୁ। **OdiaScript ଓଡ଼ିଆ ଭାଷା ସହିତ ଆନନ୍ଦଦାୟକ କୋଡିଂ! 🚀**