{"id":16157904,"url":"https://github.com/mrxiaozhuox/dioscript","last_synced_at":"2025-03-18T20:31:00.177Z","repository":{"id":163283546,"uuid":"638717476","full_name":"mrxiaozhuox/dioscript","owner":"mrxiaozhuox","description":"A programming language made by Rust","archived":false,"fork":false,"pushed_at":"2024-09-19T08:18:43.000Z","size":23873,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T22:12:36.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrxiaozhuox.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":"2023-05-10T00:41:33.000Z","updated_at":"2024-10-28T03:10:26.000Z","dependencies_parsed_at":"2024-10-27T19:26:45.378Z","dependency_job_id":null,"html_url":"https://github.com/mrxiaozhuox/dioscript","commit_stats":null,"previous_names":["mrxiaozhuox/dioscript"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrxiaozhuox%2Fdioscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrxiaozhuox%2Fdioscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrxiaozhuox%2Fdioscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrxiaozhuox%2Fdioscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrxiaozhuox","download_url":"https://codeload.github.com/mrxiaozhuox/dioscript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244301315,"owners_count":20430920,"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":[],"created_at":"2024-10-10T01:51:12.204Z","updated_at":"2025-03-18T20:30:56.830Z","avatar_url":"https://github.com/mrxiaozhuox.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003eDioScript\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003e Dioscript is a script language use for generate web elements.\n\n```dioscript\nusername = \"YuKun Liu\";\nlogin = false;\n\ndisplay_navbar = true;\nif display_navbar == false {\n    return \"unavailable navbar.\";\n}\n\nreturn div {\n    class: \"navbar\",\n    h1 { username },\n    if login {\n        return h2 { \"Hello User!\" };\n    } else {\n        return h2 { \"Hello Guest! };\n    }\n};\n\n```\n\n\n\n## Function Bind\n\nCurrently, You can bind **Rust** function to dioscript-runtime, and call it in dioscript code.\n\n```rust\nfn element_to_html(args: Vec\u003cValue\u003e) -\u003e Value {\n    let v = args.get(0).unwrap();\n    if let Value::Element(e) = v {\n        return Value::String(e.to_html());\n    }\n    Value::None\n}\n\n// import function\nruntime.bind_module(\"html\", {\n    let mut module = ModuleGenerator::new();\n    module.insert_rusty_function(\"to_html\", element_to_html, 1);\n    module\n});\n\n```\n\n```dioscript\ne = div {\n    class: \"main\",\n    p { \"Hello Dioscropt\" }\n};\n\nreturn html::to_html(e);\n\n// result\n// \u003cdiv class=\"main\"\u003e\u003cp\u003eHello Dioscript\u003c/p\u003e\u003c/div\u003e\n\n```\n\n\n\n## Runtime\n\nDioscript includes a very simple runtime, it will work for `conditional statements`, `variable scope`, `element internal statements`, and `value calculate`.\n\n## Usage\n\nCurrently, I am working on a library that can convert `Dioxscript` to `Dioxus` components, and that can help Dioxus Web to dynamically generate \u0026 display page components.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrxiaozhuox%2Fdioscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrxiaozhuox%2Fdioscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrxiaozhuox%2Fdioscript/lists"}