{"id":13649469,"url":"https://github.com/PhoenXHO/UwU","last_synced_at":"2025-04-22T14:31:40.223Z","repository":{"id":148196410,"uuid":"463214013","full_name":"PhoenXHO/UwU","owner":"PhoenXHO","description":"Just an UwU esoteric programming language interpreter written in C++.","archived":false,"fork":false,"pushed_at":"2023-11-20T15:52:05.000Z","size":90,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-10T00:33:04.527Z","etag":null,"topics":["bytecode","bytecode-compiler","bytecode-interpreter","compiler","compiler-design","interpreter","language","programming-language","uwu","uwulang"],"latest_commit_sha":null,"homepage":"","language":"C++","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/PhoenXHO.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2022-02-24T16:10:29.000Z","updated_at":"2024-10-18T12:18:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a09ae6e-46c8-4f94-93d8-c7c9cf7f4c35","html_url":"https://github.com/PhoenXHO/UwU","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhoenXHO%2FUwU","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhoenXHO%2FUwU/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhoenXHO%2FUwU/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhoenXHO%2FUwU/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhoenXHO","download_url":"https://codeload.github.com/PhoenXHO/UwU/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250259007,"owners_count":21401022,"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":["bytecode","bytecode-compiler","bytecode-interpreter","compiler","compiler-design","interpreter","language","programming-language","uwu","uwulang"],"created_at":"2024-08-02T02:00:17.225Z","updated_at":"2025-04-22T14:31:35.214Z","avatar_url":"https://github.com/PhoenXHO.png","language":"C++","funding_links":[],"categories":["Programming Languages"],"sub_categories":[],"readme":"# UwU\nUwU is an esoteric dynamically-typed programming language that is very simple and easy to use.\n\n\n# Installation\n## Prerequisites\n- GNU Make 4.0 or above\n\n\n## Build\nTo clone the repository:\n```\ngit clone https://github.com/PhoenixHO-dev/UwU.git\n```\nTo build:\n```\nmake\n```\nTo run:\n```\nuwu\n```\nto activate a REPL session,\nor\n```\nuwu \u003cpath\u003e [-p | -e]\n```\nto execute a `.uwu` file.\n- `\u003cpath\u003e` is the path of the `.uwu` file.\n- The optional flag `-p` can be used to print code instructions for debugging, while `-e` can be used to trace program execution.\n\n\n\n\n# Language Features/Syntax\n## Identifiers\n**UwU** follows the same rules as **C** and **C++** in terms of naming identifiers.\n## Variables\nVariable declaration syntax:\n```\nuwu variable_name\n```\nTo assign a value to the variable:\n```\nvariable_name := value\n```\nVariables can also be initialized in their declaration like so:\n```\nuwu variable_name := value\n```\n\n\n## Data Types\n**UwU** is a statically typed programming language and you don't need to specify the data type when declaring a variable. It supports the following data types:\n- Numbers (integers, decimal numbers, ...)\n- Characters\n- Strings\n- Boolean\n\nTo declare a number variable:\n```\nuwu number := value\n```\n`value` can be any number (integer or decimal number).\n\nTo declare a string variable:\n```\nuwu string := \"This is a string\"\n```\n\nTo declare a character variable:\n```\nuwu character := `c`\n```\n\nTo declare a boolean variable:\n```\nuwu boolean := value\n```\nHere `value` can either be `twue` (equivalent to `true` in C++) or `fawse` (equivalent to `false` in C++).\n\nVariables of a specific type can also be assigned values of other types, meaning that the new value overwrites the old one including the data type:\n```\nuwu var := 1     {: This is a number variable :}\nvar := \"string\"  {: This operation is still valid but 'var' is no longer of type number :}\n```\n\n\n## Comments\n**UwU** currently only supports multi-line comments.\nA comment in **UwU** starts with `{:` and ends with `:}` and anything inside will be entirely ignored.\nExample:\n```\n{: This is a comment and it will be ignored during compilation :}\n```\n\n\n## Binary/Unary operators\n- Addition `+`\n- Subtraction `-`\n- Multiplication `*`\n- Division `/`\n- Concatenation `+` (can be used with both characters and strings)\n- Not `!`\n- Negation `-`\n- Comparison `=`, `!=`, `\u003c`, `\u003c=`, `\u003e`, `\u003e=` (Strings and Chars can be compared using the operators `=` and `!=` too)\n- Logical Operators `awnd`, `ow`\n\n\n## Variable Scope\n**UwU** supports both **local** scope and **global** scope. A local scope/block is a set of statements put within a block.\nA block is a region enclosed by `[:` and `:]`.\nSimilar to other programming languages like C or C++, variables declared within a block can only be accessed within that block, and are called local variables,\nin contrast with global variables that can be accessed anywhere in the program.\n\n\n## If statements\nThe syntax for an if-statement in **UwU** is:\n```\n?w? condition\n[:\n\t{: code :}\n:]\n```\n**UwU** also supports `if..else` statements:\n```\n?w? condition\n[:\n\t{: executes if 'condition' is true :}\n:]\newe\n[:\n\t{: executes otherwise :}\n:]\n```\nNote that any non-zero value corresponds to `twue` while `0` corresponds to `fawse`.\n\n\n## Loops\nLoops in **UwU** are different than `while` loops in C/C++ in that the code within the following block executes until a certain condition is met.  \nThe syntax for `untiw` loops is:\n```\nuntiw condition\n[:\n\t{: executes until 'contidion' is true :}\n:]\n```\n\n\n## Printing expressions\nThe syntax for printing an expression is:\n```\nouo expression \u003e\u003e\n```\n`expression` can be any valid expression in **UwU**.  \nTo print multiple expressions:\n```\nouo expression1, expression2, ... \u003e\u003e\n```\nTo print a new line:\n```\nouo ~n \u003e\u003e\n```\nTo print a tab:\n```\nouo ~t \u003e\u003e\n```\n\n\n## Reading input\nReading input is different for each data type. The syntax is:\n```\niwi type variable_name \u003c\u003c\n```\n`type` can be `-s`, `-d`, or `-c`.  \n- `-s` if for strings;  \n- `-d` is for numbers;  \n- `-c` is for characters.  \nExample:\n```\niwi-s string_var \u003c\u003c {: Reads a string from input to 'string_var' :}\n```\n\n\n## Functions\n**UwU** supports both recursive and non-recursive functions.  \nTo define a function:\n```\nfwun function_name(parameter1, parameter2, ...) [:\n\t{: function body :}\n:]\n```\nWhereas function parameters are optional.\nAnd to call a function, simply\n```\nfunction_name(argument1, argument2, ...)\n```\nFor functions that have return values:\n```\nfwun function_name(parameter1, parameter2, ...) [:\n\t{: function body :}\n\t\n\tout return_value \u003e\u003e\n:]\n```\n\n\n## Built-in functions\n- `powew(base, exponent)`: equivalent to `pow(base, exponent)` in **C**;\n- `floow(x)`: equivalent to `floor(x)` in **C**;\n- `abs(x)`: returns the absolute value of `x`;\n- `sqwt(x)`: returns the square root of `x`.\n\n\n# Supported operations\n- Using binary operator ```+``` on strings/characters:  \n\t`` \"string\" + `a` `` evaluates to `\"stringa\"`  \n\t`` `a` + \"string\" `` evaluates to `\"astring\"`  \n\t`` `a` + `b` ``      evaluates to `\"ab\"`  \n- Using equality operators on non-numbers always evaluates to `fawse`;\n- Assigning a value of a specific type to a variable of a different data type, that includes reading from input;\n- Using non-boolean expressions as if-statement or loop condition.\n\n\n\n# UwU program examples\n**UwU** \"Hello World!\" program:\n```\nouo \"Hewwo Wowwd!\" \u003e\u003e\n```\n\n**UwU** program to check if the entered number is positive or negative:\n```\nuwu number\n\nouo \"Enter a number: \" \u003e\u003e\niwi-d number \u003c\u003c\n\n?w? number \u003c= 0 [:\n\t?w? number = 0 [:\n\t\touo ~n + \"You entered a null number.\" \u003e\u003e\n\t:] ewe [:\n\t\touo ~n + \"You entered a negative number.\" \u003e\u003e\n\t:]\n:] ewe [:\n\touo ~n, \"You entered a positive number.\" \u003e\u003e\n:]\n```\n\n**UwU** program to print Fibonacci Sequence:\n```\nuwu t1 := 0\nuwu t2 := 1\nuwu nextTerm := t1 + t2\n\nuwu n\n\nouo \"Enter the number of terms: \" \u003e\u003e\niwi-d n \u003c\u003c\n\nouo \"Fibonacci Series: \" + ~n \u003e\u003e\nouo t1, \", \" \u003e\u003e\nouo t2, \", \" \u003e\u003e\n\nuwu i := 3\nuntiw i \u003e n [:\n\touo nextTerm, \", \" \u003e\u003e\n\tt1 := t2\n\tt2 := nextTerm\n\tnextTerm := t1 + t2\n\ti := i + 1\n:]\n```\n\n**UwU** program to calculate the power of a number:\n```\nfwun power(b, e) [:\n\tuwu r := 1\n\tuntiw e = 0 [:\n\t\tr := r * b\n\t\te := e - 1\n\t:]\n\n\tout r \u003e\u003e\n:]\n\nuwu base\nuwu exp\nuwu result\n\nouo \"Enter a base number: \" \u003e\u003e\niwi-d base \u003c\u003c\nouo \"Enter an exponent: \" \u003e\u003e\niwi-d exp \u003c\u003c\n\nresult := power(base, exp)\n\nouo \"Answer = \", result \u003e\u003e\n```\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhoenXHO%2FUwU","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPhoenXHO%2FUwU","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhoenXHO%2FUwU/lists"}