{"id":15028845,"url":"https://github.com/dullabs/bhai-lang","last_synced_at":"2025-05-14T06:10:37.256Z","repository":{"id":41857367,"uuid":"443343128","full_name":"DulLabs/bhai-lang","owner":"DulLabs","description":"A toy programming language written in Typescript","archived":false,"fork":false,"pushed_at":"2024-06-15T09:54:53.000Z","size":1930,"stargazers_count":4047,"open_issues_count":65,"forks_count":495,"subscribers_count":42,"default_branch":"develop","last_synced_at":"2025-05-10T02:09:37.254Z","etag":null,"topics":["interpreter","javascript","parser","programming-language","typescript"],"latest_commit_sha":null,"homepage":"https://bhailang.js.org/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DulLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-31T12:41:46.000Z","updated_at":"2025-05-08T19:56:06.000Z","dependencies_parsed_at":"2024-01-18T09:58:00.674Z","dependency_job_id":"fae56333-4d15-4826-b7db-76a035096a6d","html_url":"https://github.com/DulLabs/bhai-lang","commit_stats":{"total_commits":127,"total_committers":13,"mean_commits":9.76923076923077,"dds":0.6141732283464567,"last_synced_commit":"de68714357e159719b85fae34c0df58d4ba5ce81"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DulLabs%2Fbhai-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DulLabs%2Fbhai-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DulLabs%2Fbhai-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DulLabs%2Fbhai-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DulLabs","download_url":"https://codeload.github.com/DulLabs/bhai-lang/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254083099,"owners_count":22011805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interpreter","javascript","parser","programming-language","typescript"],"created_at":"2024-09-24T20:09:10.615Z","updated_at":"2025-05-14T06:10:37.206Z","avatar_url":"https://github.com/DulLabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eBhai Lang\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://lgtm.com/projects/g/DulLabs/bhai-lang/alerts/\"\u003e\u003cimg alt=\"Total alerts\" src=\"https://img.shields.io/lgtm/alerts/g/DulLabs/bhai-lang.svg?logo=lgtm\u0026logoWidth=18\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://lgtm.com/projects/g/DulLabs/bhai-lang/context:javascript\"\u003e\u003cimg alt=\"Language grade: JavaScript\" src=\"https://img.shields.io/lgtm/grade/javascript/g/DulLabs/bhai-lang.svg?logo=lgtm\u0026logoWidth=18\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/DulLabs/bhai-lang/actions/workflows/node.js.yml/badge.svg\"\u003e\u003cimg alt=\"Build\" src=\"https://github.com/DulLabs/bhai-lang/actions/workflows/node.js.yml/badge.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://bhailang.js.org/\"\u003e\u003cimg alt=\"Build\" src=\"https://img.shields.io/badge/website-bhailang.js.org-orange\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/bhailang\"\u003e\u003cimg alt=\"Build\" src=\"https://img.shields.io/badge/npm-bhailang-orange\"/\u003e\u003c/a\u003e\n  \n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  This is official repository for bhai-lang.\u003cbr\u003e\u003cbr\u003e\n  \u003cb\u003eBhai lang is a toy programming language written in Typescript.\u003c/b\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n\u003ch2 align=\"center\"\u003eInstallation\u003c/h2\u003e\n\n```\nnpm i -g bhailang\n```\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n\u003ch4 align=\"left\"\u003eCreate a new file (\u003ccode\u003etest.bhai\u003c/code\u003e)\u003c/h4\u003e\n\n\n\u003ch4 align=\"left\"\u003eEdit the file with a text editor.\nYou can also try out your code on \u003ca href=\"https://bhailang.js.org/#playground\"\u003eBhai Lang PlayGround\u003c/a\u003e\u003c/h4\u003e\n\n```\nhi bhai\n  bol bhai \"Hello bhai\";\nbye bhai\n\n```\n\n\u003ch4 align=\"left\"\u003eRun\u003c/h4\u003e\n\n```\nbhailang test.bhai\n```\n\n\u003ch4 align=\"left\"\u003eOutput\u003c/h4\u003e\n\n```\nhello bhai\n```\n\n\u003ch2 align=\"center\"\u003eDocumentation\u003c/h2\u003e\n\n\u003ch3 align=\"center\"\u003eGeneral\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\u003ccode\u003ehi bhai\u003c/code\u003e is the entrypoint for the program and all program must end with \u003ccode\u003ebye bhai\u003c/code\u003e. Anything outside of it will be ignored.\u003c/p\u003e\n\n```\n\nThis will be ignored\n\nhi bhai\n// Write code here\nbye bhai\n\nThis too\n```\n\n\u003ch3 align=\"center\"\u003eVariables\u003c/h3\u003e\n\u003cp align=\"center\"\u003eVariables can be declared using \u003ccode\u003ebhai ye hai\u003c/code\u003e.\u003c/p\u003e\n\n```\n\nhi bhai\n  bhai ye hai a = 10;\n  bhai ye hai b = \"two\";\n  bhai ye hai c = 15;\n  a = a + 1;\n  b = 21;\n  c *= 2;\nbye bhai\n```\n\n\u003ch3 align=\"center\"\u003eTypes\u003c/h3\u003e\n\u003cp align=\"center\"\u003eNumbers and strings are like other languages. Null values can be denoted using \u003ccode\u003enalla\u003c/code\u003e. \u003ccode\u003esahi\u003c/code\u003e and \u003ccode\u003egalat\u003c/code\u003e are the boolean values.\u003c/p\u003e\n\n```\n\nhi bhai\n  bhai ye hai a = 10;\n  bhai ye hai b = 10 + (15*20);\n  bhai ye hai c = \"two\";\n  bhai ye hai d = 'ok';\n  bhai ye hai e = nalla;\n  bhai ye hai f = sahi;\n  bhai ye hai g = galat;\nbye bhai\n```\n\n\u003ch3 align=\"center\"\u003eBuilt-ins\u003c/h3\u003e\n\u003cp align=\"center\"\u003eUse \u003ccode\u003ebol bhai\u003c/code\u003e to print anything to console.\u003c/p\u003e\n\n```\n\nhi bhai\n  bol bhai \"Hello World\";\n  bhai ye hai a = 10;\n  {\n    bhai ye hai b = 20;\n    bol bhai a + b;\n  }\n  bol bhai 5, 'ok', nalla , sahi , galat;\nbye bhai\n```\n\n\u003ch3 align=\"center\"\u003eConditionals\u003c/h3\u003e\n\u003cp align=\"center\"\u003eBhailang supports if-else-if ladder construct , \u003ccode\u003eagar bhai\u003c/code\u003e block will execute if condition is \u003ccode\u003esahi\u003c/code\u003e, otherwise one of the subsequently added \u003ccode\u003enahi to bhai\u003c/code\u003e blocks will execute if their respective condition is \u003ccode\u003esahi\u003c/code\u003e, and the \u003ccode\u003ewarna bhai\u003c/code\u003e block will eventually execute if all of the above conditions are \u003ccode\u003egalat\u003c/code\u003e\n\n```\n\nhi bhai\n  bhai ye hai a = 10;\n  agar bhai (a \u003c 20) {\n    bol bhai \"a is less than 20\";\n  } nahi to bhai ( a \u003c 25 ) {\n    bol bhai \"a is less than 25\";\n  } warna bhai {\n    bol bhai \"a is greater than or equal to 25\";\n  }\nbye bhai\n```\n\n\u003ch3 align=\"center\"\u003eLoops\u003c/h3\u003e\n\u003cp align=\"center\"\u003eStatements inside \u003ccode\u003ejab tak bhai\u003c/code\u003e blocks are executed as long as a specified condition evaluates to sahi. If the condition becomes \u003ccode\u003egalat\u003c/code\u003e, statement within the loop stops executing and control passes to the statement following the loop. Use \u003ccode\u003ebas kar bhai\u003c/code\u003e to break the loop and \u003ccode className=\"language-cpp\"\u003eagla dekh bhai\u003c/code\u003e to continue within loop.\u003c/p\u003e\n\n\n```\n\nhi bhai\n  bhai ye hai a = 0;\n  jab tak bhai (a \u003c 10) {\n   a += 1;\n   agar bhai (a == 5) {\n    bol bhai \"andar se bol bhai \", a;\n    agla dekh bhai;\n   }\n   agar bhai (a == 6) {\n    bas kar bhai;\n   }\n   bol bhai a;\n  }\n  bol bhai \"done\";\nbye bhai\n```\n\n\u003ch2 align=\"center\"\u003eDevelopment\u003c/h2\u003e\n\u003cp align=\"center\"\u003eYou can explore abstract syntax tree(AST) of bhailang \u003ca href=\"https://bhailang-ast.netlify.app/\" target=\"_blank\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdullabs%2Fbhai-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdullabs%2Fbhai-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdullabs%2Fbhai-lang/lists"}