{"id":25663759,"url":"https://github.com/maxxsoft/yulang","last_synced_at":"2025-08-14T21:25:22.973Z","repository":{"id":40457689,"uuid":"242163509","full_name":"MaxXSoft/YuLang","owner":"MaxXSoft","description":"The Yu (羽) programming language.","archived":false,"fork":false,"pushed_at":"2023-07-14T08:20:04.000Z","size":579,"stargazers_count":79,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-21T05:41:32.290Z","etag":null,"topics":["compiler","llvm","programming-language","yulang"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxXSoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2020-02-21T14:54:32.000Z","updated_at":"2025-06-19T07:07:22.000Z","dependencies_parsed_at":"2024-01-14T16:13:38.413Z","dependency_job_id":"3424a7a4-69ea-4e55-b0bf-ab60832f1877","html_url":"https://github.com/MaxXSoft/YuLang","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/MaxXSoft/YuLang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2FYuLang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2FYuLang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2FYuLang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2FYuLang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxXSoft","download_url":"https://codeload.github.com/MaxXSoft/YuLang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2FYuLang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265198300,"owners_count":23726446,"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":["compiler","llvm","programming-language","yulang"],"created_at":"2025-02-24T05:19:01.364Z","updated_at":"2025-07-13T20:03:11.477Z","avatar_url":"https://github.com/MaxXSoft.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yu\n\n![YuLang](YuLang.png)\n\n[![Build and Test](https://github.com/MaxXSoft/YuLang/workflows/Build%20and%20Test/badge.svg)](https://github.com/MaxXSoft/YuLang)\n[![羽语言简明教程](https://img.shields.io/badge/tutorial-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-blue)](https://maxxsoft.github.io/YuLang-doc/tutorial/zh-cn/)\n\nYu (羽) is a simple system programming language.\n\n## Documentations\n\n* Tutorial: [简体中文版 (GitHub)](https://maxxsoft.github.io/YuLang-doc/tutorial/zh-cn/), [简体中文版 (Gitee)](https://maxxsoft.gitee.io/yulang-doc/tutorial/zh-cn/).\n\nVisit [YuLang-doc](https://github.com/MaxXSoft/YuLang-doc) for more details.\n\n## Features\n\n* Block expression\n* Modules and `import` statement\n* Type deduction and reference type\n* Inline function/variable/constant\n* Function/operator overloading\n* Operator-formed identifier\n* Dot function and infix function\n* Iterator\n\n## Examples: Hello World\n\nC style:\n\n```yu\nimport sys.unistd\nimport sys.string\n\nextern def main(argc: i32, argv: u8**): i32 {\n  let hello = \"Hello world!\\n\", len = strlen(hello)\n  write(FD_STDOUT, hello, len)\n  0\n}\n```\n\nOOP-like style (but not real OOP):\n\n```yu\nimport sys.unistd\nimport sys.string\n\nstruct Output {}\n\ndef println(this: Output\u0026, str: u8*) {\n  write(FD_STDOUT, str, strlen(str))\n  write(FD_STDOUT, \"\\n\", 1 as u32)\n}\n\nlet out = [Output] {}\n\nextern def main(argc: i32, argv: u8**): i32 {\n  out.println(\"Hello world!\")\n  0\n}\n```\n\nC++ `cout` style with custom operator `\u003c\u003c\u003c`:\n\n```yu\nimport io\n\nextern def main(argc: i32, argv: u8**): i32 {\n  out \u003c\u003c\u003c \"Hello world! \" \u003c\u003c\u003c 123 \u003c\u003c\u003c '\\n'\n  0\n}\n```\n\nNatural language style (see [natural.yu](examples/natural.yu)):\n\n```yu\nextern def main(argc: i32, argv: u8**): i32 {\n  // be polite\n  please put \"Hello world! \" and 123 to stdout\n  thanks\n}\n```\n\n## Building from Source\n\nBefore building YuLang compiler, please make sure you have installed the following dependencies:\n\n* `cmake` 3.13 or later\n* `llvm` 10.0 or later\n* C++ compiler supporting C++17\n\nYou may want to check the toolchain configuration in `toolchain.mk`. Then you can build this repository by executing the following command lines:\n\n```\n$ git clone --recursive https://github.com/MaxXSoft/YuLang.git\n$ cd YuLang\n$ mkdir build\n$ cd build\n$ cmake .. \u0026\u0026 make -j8\n```\n\n## EBNF of Yu\n\n```ebnf\nprogram   ::= {line};\nline      ::= stmt {\";\" stmt} [\";\"];\nstmt      ::= var_def   | let_def | fun_def | declare\n            | ty_alias  | struct  | enum    | import;\n\nvar_def   ::= property \"var\" var_elem {\",\" var_elem};\nlet_def   ::= property \"let\" let_elem {\",\" let_elem};\nfun_def   ::= property \"def\" [id | bin_op | unary_op]\n              \"(\" [arg_list] \")\" [\":\" type] block;\ndeclare   ::= property \"declare\" [\"var\"] id \":\" type;\nty_alias  ::= property \"type\" id \"=\" type;\nstruct    ::= property \"struct\" id \"{\" arg_list [\",\"] \"}\";\nenum      ::= property \"enum\" id [\":\" type] \"{\" enum_list \"}\";\nimport    ::= property \"import\" id {\".\" id};\n\nproperty  ::= [\"public\" | \"extern\" | \"inline\"]\nvar_elem  ::= id [\":\" type] [\"=\" expr];\nlet_elem  ::= id [\":\" type] \"=\" expr;\narg_list  ::= id \":\" type [\",\" arg_list];\nenum_list ::= id [\"=\" expr] [\",\" enum_list] [\",\"];\n\nblock     ::= \"{\" {blk_line} \"}\";\nblk_line  ::= blk_stmt {\";\" blk_stmt} [\";\"];\nblk_stmt  ::= var_def | let_def | declare | ty_alias  | struct\n            | enum    | if_else | when    | while     | for_in\n            | asm     | control | expr;\n\nif_else   ::= \"if\" expr block [\"else\" (if_else | block)];\nwhen      ::= \"when\" expr \"{\" when_elem {when_elem} [\"else\" block] \"}\";\nwhile     ::= \"while\" expr block;\nfor_in    ::= \"for\" id \"in\" expr block;\nasm       ::= \"asm\" \"{\" string {string} \"}\";\ncontrol   ::= \"break\" | \"continue\"  | (\"return\" [expr]);\n\nwhen_elem ::= expr {\",\" expr} block;\n\nexpr      ::= binary {id binary};\nbinary    ::= cast {bin_op cast};\ncast      ::= unary {\"as\" type};\nunary     ::= [unary_op] factor | \"sizeof\" type;\nfactor    ::= value | block     | if_else   | when\n            | index | fun_call  | access    | \"(\" expr \")\";\n\nbin_op    ::= \"+\"   | \"-\"   | \"*\"   | \"/\"   | \"%\"   | \"\u0026\"\n            | \"|\"   | \"^\"   | \"\u0026\u0026\"  | \"||\"  | \"\u003c\u003c\"  | \"\u003e\u003e\"\n            | \"==\"  | \"!=\"  | \"\u003c\"   | \"\u003c=\"  | \"\u003e\"   | \"\u003e=\"\n            | \"=\"   | \"+=\"  | \"-=\"  | \"*=\"  | \"/=\"  | \"%=\"\n            | \"\u0026=\"  | \"|=\"  | \"^=\"  | \"\u003c\u003c=\" | \"\u003e\u003e=\" | \".\";\nunary_op  ::= \"+\"   | \"-\"   | \"!\"   | \"~\"   | \"*\"   | \"\u0026\";\nindex     ::= factor \"[\" expr \"]\";\nfun_call  ::= factor \"(\" [expr {\",\" expr}] \")\";\naccess    ::= factor \".\" id [\"(\" [expr {\",\" expr}] \")\"];\n\nvalue     ::= INT_VAL | FLOAT_VAL | CHAR_VAL | id\n            | string  | bool      | null_ptr | val_init;\nid        ::= ID_VAL;\nstring    ::= STR_VAL;\nbool      ::= \"true\"  | \"false\";\nnull_ptr  ::= \"null\";\nval_init  ::= \"[\" type \"]\" \"{\" [expr {\",\" expr} [\",\"]] \"}\";\n\ntype      ::= (prim_type | id | pointer | array | ref | func) [\"volatile\"];\nprim_type ::= \"i8\"  | \"i16\" | \"i32\"   | \"i64\" | \"isize\" | \"u8\"  | \"u16\"\n            | \"u32\" | \"u64\" | \"usize\" | \"f32\" | \"f64\" | \"bool\";\npointer   ::= type [\"var\"] \"*\";\narray     ::= type \"[\" expr \"]\";\nref       ::= type [\"var\"] \"\u0026\";\nfunc      ::= \"(\" [type {\",\" type}] \")\" [\":\" type];\n```\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md)\n\n## License\n\nCopyright (C) 2010-2020 MaxXing. License GPLv3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxxsoft%2Fyulang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxxsoft%2Fyulang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxxsoft%2Fyulang/lists"}