{"id":17799349,"url":"https://github.com/danue1/danube","last_synced_at":"2025-03-17T05:32:35.883Z","repository":{"id":98588132,"uuid":"281452521","full_name":"Danue1/danube","owner":"Danue1","description":"The Danube Programming Language","archived":false,"fork":false,"pushed_at":"2025-03-05T10:57:58.000Z","size":842,"stargazers_count":37,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-16T08:41:21.242Z","etag":null,"topics":["compiler","danube","interpreter","language","programming"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Danue1.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":"2020-07-21T16:44:26.000Z","updated_at":"2025-03-05T10:58:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"231c0022-cb35-4790-9d33-ec296fb3437f","html_url":"https://github.com/Danue1/danube","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/Danue1%2Fdanube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danue1%2Fdanube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danue1%2Fdanube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danue1%2Fdanube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Danue1","download_url":"https://codeload.github.com/Danue1/danube/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243981530,"owners_count":20378588,"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","danube","interpreter","language","programming"],"created_at":"2024-10-27T12:06:48.780Z","updated_at":"2025-03-17T05:32:35.868Z","avatar_url":"https://github.com/Danue1.png","language":"Rust","readme":"# Danube Programming Language\n\nDanube: For A New Era Language Standard.\n\nIt supports the basic features that are refined with reference to the trial and failure of existing languages.\n\n## Hello, World!\n\n```danube\nfn main() {\n  println(\"Hello, World!\");\n}\n```\n\n## Syntax\n\n### Variables\n\n```danube\nlet x = 10;\nlet mut name = \"Danube\";\n```\n\n### Conditions\n\n```danube\nif x \u003e 5 {\n  println(\"Hello, Danube!\");\n} else {\n  println(\"Hello, World!\");\n}\n```\n\n### Loops\n\n```danube\nfor i in 1..5 {\n  println(\"For! {i}\");\n}\n\nwhile condition {\n  println(\"While!\");\n}\n\nloop {\n  println(\"Loops!\");\n}\n```\n\n### Function Declarations and Calling\n\n```danube\nfn add(a: u8, b: u8) -\u003e u8 {\n  a + b\n}\n\nadd(1, 2); // 3\n```\n\n### Struct Declarations and Instantiation\n\n```danube\nstruct User {\n  name: String,\n}\n\nimpl User {\n  fn name(self) -\u003e str {\n    self.name\n  }\n}\n\nlet user = User {\n  name: \"Danuel\",\n}\n\nprintln(user.name());\n```\n\n### Module System\n\n```danube\n// math.dnb\npub fn add(a: u8, b: u8) -\u003e u8 {\n  a + b\n}\n\n// main.dnb\nuse math::add;\n\nadd(1, 2); // 3\nmath::add(1, 2); // 3\n```\n\n### Context Parameters\n\n```danube\nfn say(|f: mut Debug|, user: User) {\n  f.debug(\"Hello, {user.name}!\");\n}\n\nimpl User {\n  pub fn say(self, |f: mut Debug|) {\n    f.debug(\"Hello, {self.name}\");\n  }\n}\n\nimpl\u003cT1\u003e T1 {\n  fn with\u003cU\u003e(self, f: (|T1|) -\u003e U) -\u003e U {\n    f(|self|)\n  }\n}\n\n// Formatter has a Debug trait.\nFormatter::new().with(fn (|formatter|) {\n  let user = User::new(\"Danuel\");\n\n  // 1 will be same as 2\n  say(user); // 1\n  say(|formatter|, user); // 2\n})\n```\n\n### Traits\n\n```danube\ntrait Identity {\n  fn identity(self) -\u003e Id;\n}\n\nstruct User {\n  id: Id,\n}\n\nimpl Identity for User {\n  fn identity(self) -\u003e Id {\n    self.id\n  }\n}\n```\n\n### Effect System\n\n```danube\ntrait ^DivByZero {\n  fn on_div_by_zero() -\u003e u8;\n}\n\nfn div(a: u8, b: u8): ^DivByZero -\u003e u8 {\n  if b == 0 {\n    ^DivByZero::on_div_by_zero()\n  } else {\n    a / b\n  }\n}\n```\n\n## Special Thanks\n\nThis language was named Danube by [@thehighestend](https://github.com/thehighestend)!\n\n## License\n\nThis project is licensed under the MIT license. Please see the LICENSE file for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanue1%2Fdanube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanue1%2Fdanube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanue1%2Fdanube/lists"}