{"id":16245926,"url":"https://github.com/miroiu/dw-lang","last_synced_at":"2025-03-19T19:30:31.457Z","repository":{"id":108466665,"uuid":"224649114","full_name":"miroiu/dw-lang","owner":"miroiu","description":"[Educational] A small interpreted language made from scratch.","archived":false,"fork":false,"pushed_at":"2020-02-04T15:54:41.000Z","size":132,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T20:34:42.829Z","etag":null,"topics":["bigmath","editor","expression-viewer","interpreter","lexer","netcore3","parser","programming-language","repl","wpf"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miroiu.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-28T12:31:11.000Z","updated_at":"2024-10-19T22:16:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ad95867-1c81-4e46-8a26-df1aed2533eb","html_url":"https://github.com/miroiu/dw-lang","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miroiu%2Fdw-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miroiu%2Fdw-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miroiu%2Fdw-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miroiu%2Fdw-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miroiu","download_url":"https://codeload.github.com/miroiu/dw-lang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244492703,"owners_count":20461552,"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":["bigmath","editor","expression-viewer","interpreter","lexer","netcore3","parser","programming-language","repl","wpf"],"created_at":"2024-10-10T14:28:41.259Z","updated_at":"2025-03-19T19:30:31.450Z","avatar_url":"https://github.com/miroiu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DwLang Editor\n![alt text](https://i.imgur.com/Hnd2nvG.png \"DwLang Editor\")\n\n# DwLang\nAn educational interpreted programming language that works with big numbers.\n\n## Usage from the command line\ndwlang -?\n\n## Specifications:\n  - interpreted language\n  - execution is single threaded and sequential, all statements are executed in the order they are encountered\n  \nLanguage rules: \n  - statements are delimited by a semicolon (i.e. \";\")\n  - the decimal separator is comma (i.e. \",\")\n  - empty statements are permitted and ignored during evaluation\n  - a statement can be written on a single or multiple lines\n  - spaces between an operator and its operands are optional\n\nData types:\n  - a numeric type (BigDecimal)\n\nVariables:\n  - variable declarations consists of the 'var' keyword followed by the variable's name\n  - variables name consist exclusively of letters and/or underscore\n  - variables declaration and initialization can be optionally compound in a single statement (e.g. var a; a = 5; or var a = 5;)\n  - reserved words of the language can't be used as variable names\n  - reserved words are: var, sqr, pow, x, prm, avg, med, pwd, set, precision, print, cls\n\nBinary operators:\n  - \\+ -\u003e addition (e.g 2 + 3 = 5)\n  - \\- -\u003e subtraction (e.g 2 - 1 = 1)\n  - : -\u003e division (e.g 6 : 2 = 3)\n  - x -\u003e multiplication (e.g 3 x 2 = 6)\n  - pow -\u003e power (e.g 2 pow 3 = 8)\n  - prm (permutations without repetitions where n is the number of things to choose\nfrom and we choose r of them, no repetitions, order matters. \"n prm r\" should evaluate to n!/(n − r)! )\n  - pwd (number of possible passwords of maximum n characters, made on an alphabet of t\ncharacters. How many passwords of maximum 8 characters can I make using exclusively English letters: that is \"52 pwd 8\" -\u003e which should be equal to 52 pow 8 + 52 pow 7 + ..... + 52 pow 1)\n\nUnary operators:\n  - sqr -\u003e square root (e.g sqr 81 = 9)\n  - ! -\u003e factorial (e.g 4! = 24)\n  - \\- (for negative numbers, e.g. -1)\n\nCommands:\n  - print (prints to the output stream, e.g. print 2 x 3)\n  - cls (clears the output stream)\n\nVar args operators:\n  - avg -\u003e average (e.g. avg 2 3 7 = 4)\n  - med -\u003e median (e.g. med 2 4 7 8 9 = 7)\n\nOperations grouping:\n  - parentheses with unlimited nesting depth\n\nDirectives:\n  - set precision \u003cn\u003e (e.g. \u003cn\u003e can be variable or integer: \"set precision 4; print 7:6;\" should print 1,1667) can be set multiple times in the same program\n\nErrors:\n  - syntax errors and evaluation errors are printed to the console with their respective line and column numbers\n  - if an operation has a non-deterministic result, the program should crash (e.g. a non-terminated decimal\nexpansion)\n  - attempting to use a variable that was not assigned any value should throw an evaluation error\n  - evaluation and syntax errors are not fail-fast, meaning that the code will execute until an error is found\n\nComments:\n  - anything sourounded by /* and *\\ is ignored during evaluation \n  - if enclosing markers are not balanced, the most outer ones are considered (e.g. \"/* some comment *\\ print 5; *\\ print 3;\" should only print 3.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiroiu%2Fdw-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiroiu%2Fdw-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiroiu%2Fdw-lang/lists"}