{"id":26430473,"url":"https://github.com/fus3n/dusl","last_synced_at":"2026-02-16T02:41:05.596Z","repository":{"id":214704401,"uuid":"737161165","full_name":"Fus3n/dusl","owner":"Fus3n","description":"DUSL = Dynamic Utility And Scripting Language","archived":false,"fork":false,"pushed_at":"2024-12-19T12:15:46.000Z","size":8941,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T07:09:47.017Z","etag":null,"topics":["cpp","interpreter","programming-language","scripting-language","tree-walk-interpreter","utility"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fus3n.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-12-30T02:54:41.000Z","updated_at":"2025-05-06T18:34:46.000Z","dependencies_parsed_at":"2024-12-19T12:34:12.863Z","dependency_job_id":"d33f12c4-894e-49ec-800d-16ed34742159","html_url":"https://github.com/Fus3n/dusl","commit_stats":null,"previous_names":["fus3n/flang"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Fus3n/dusl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fus3n%2Fdusl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fus3n%2Fdusl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fus3n%2Fdusl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fus3n%2Fdusl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fus3n","download_url":"https://codeload.github.com/Fus3n/dusl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fus3n%2Fdusl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29498810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T02:07:14.481Z","status":"online","status_checked_at":"2026-02-16T02:03:22.852Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","interpreter","programming-language","scripting-language","tree-walk-interpreter","utility"],"created_at":"2025-03-18T05:31:27.045Z","updated_at":"2026-02-16T02:41:05.569Z","avatar_url":"https://github.com/Fus3n.png","language":"C++","readme":"# DUSL\nDUSL = **D**ynamic **U**tility And **S**cripting **L**anguage\n\n**(WIP)** A simple scripting interpreted language written in C++, meant for utility scripts and other similar scripting needs, not meant for performance critical tasks.\n\n### Printing\n```python\nprintln(\"Hello World\")\nprint(\"Hello World\\n\")\n```\n### Input\n```python\nprint(\"Enter your name: \")\nname = readLine()\n```\n\n### Data types and variable definition\n```python\na = \"Hello, world\" #string\nb = 123 #int64\nc = 1342.292 #float64\nd = [1, 2, 3, \"A\", \"B\"] # list\ne = {\"Key1\": \"value1\", \"key2\": \"value2\", 35: 3+5, \"sub\": {\"sub\": 1}} # dictionary\n\n# accessing values\nlist_item = d[0] # gets first item\ndict_item = e.key1 # or just e[\"key1\"]\nstr_val = a[0] # gets first character\n```\n\n### Functions\n```py\nfn add(a, b) {\n    return a + b\n}\n\n# Closures\nsub = fn(a, b) {\n    return a - b\n}\n# Closures can also have names\nsub2 = fn withName() {\n   return \"Hello\" \n}\n\n# Note: All functions return the last element by default same for closures\n```\n\n\n###  Using for-loop\n```py\n# we have range its syntax is 0..100 this means 0 to 100\n# we can use range for for-loop, like:\n\nfor item from 0..10 {\n    println(item)\n}\n\n# or use an iterable object like string and list\nvalue = \"Hello world\"\nfor c from value {\n# loops over each charcer\n    println(\"Character\", c)\n}\n\n#list\nval_list = [3, 4, 5, 6]\nresult = 0\nfor item from list {\n    result = result + item\n}\n\nprintln(\"result\", result)\n# note \"break\" also exist for for-loop and while loop\n```\n\n### C++ Extensions (Experimental)\nExtensions lets you add functions to DUSL and let DUSL import call C++ functions. Examples will be added soon\n\n\n### Examples\n```python\n# bubble sort\nfn bubbleSort(list) {\n    n = list.size\n    swapped = true\n    while swapped {\n        swapped = false\n        i = 0\n        while i \u003c n - 1 {\n            if (list[i] \u003e list[i + 1]) {\n                temp = list[i]\n                list[i] = list[i + 1]\n                list[i + 1] =  temp\n                swapped = true\n            }\n            i = i + 1\n        }\n    }\n}\n\n# binary search implementation\n# expects a sorted list\nfn binarySearch(list, target) {\n    low = 0\n    high = list.size - 1\n    while low \u003c= high {\n        mid = floor((low + high) / 2)\n        if (list[mid] == target) {\n            return mid\n        }\n        elseif (list[mid] \u003c target) {\n            low = mid + 1\n        }\n        else {\n            high = mid - 1\n        }\n    }\n    \n    return -1\n}\n```\n\n\n_**More on examples directory**_\n\n## Build\n```bash\nmkdir build\ncmake -DCMAKE_BUILD_TYPE=Release -S . -B build\ncmake --build build --config Release\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffus3n%2Fdusl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffus3n%2Fdusl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffus3n%2Fdusl/lists"}