{"id":21721964,"url":"https://github.com/nakernarolino/mountain_sakura","last_synced_at":"2025-03-20T21:45:53.334Z","repository":{"id":255345624,"uuid":"849001679","full_name":"NaKeRNarolino/mountain_sakura","owner":"NaKeRNarolino","description":"A language that actually makes sense","archived":false,"fork":false,"pushed_at":"2025-03-13T17:12:18.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T18:29:17.924Z","etag":null,"topics":["interpreter-language","programming-language","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/NaKeRNarolino.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":"2024-08-28T19:47:48.000Z","updated_at":"2025-03-13T17:12:22.000Z","dependencies_parsed_at":"2024-12-08T15:21:37.274Z","dependency_job_id":"be8d0c4d-6423-4f59-9864-f6aa51890803","html_url":"https://github.com/NaKeRNarolino/mountain_sakura","commit_stats":null,"previous_names":["nakernarolino/mountain_sakura"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaKeRNarolino%2Fmountain_sakura","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaKeRNarolino%2Fmountain_sakura/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaKeRNarolino%2Fmountain_sakura/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaKeRNarolino%2Fmountain_sakura/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaKeRNarolino","download_url":"https://codeload.github.com/NaKeRNarolino/mountain_sakura/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244694360,"owners_count":20494629,"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":["interpreter-language","programming-language","rust","rust-lang"],"created_at":"2024-11-26T02:19:49.655Z","updated_at":"2025-03-20T21:45:53.329Z","avatar_url":"https://github.com/NaKeRNarolino.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mountain Sakura - *a language that actually makes sense.*\n\nMoSa is a work-in-progress interpreted programming languages, that's really easy to integrate with Rust.\nIt's `use native` allows to make calling rust code as easy as just calling a function.\n\n```mosa\nuse native fn printLn # \"mosa-native~\u003eprintLn\";\n\nprintLn(\"Hello, world!\");\n```\nAnd on the Rust side of things\n```rust\nscope.add_native_function(String::from(\"mosa-native~\u003eprintLn\"), Arc::new(|args| {\n    println!(\"{}\", \u0026args[0]);\n    RuntimeValue::Null\n}));\n```\n---\n\nHere's a small example of MoSa code.\n```mosa\n// Calculate a power of 2\n\nfn power_of_two -\u003e\u003e Num -\u003e Num { // define a function using DAS. (You can use a regular function too)\n    let buf = 1; // create a variable `buf` and assign 1\n    // argument in a DAS function is always called `it`\n    (:=buf * 2)?:it; // use the repeat `?:` operator to repeat the expression with the self-assign `:=` operator\n    buf // return the variable buf\n}\n\nfn power_of_two(power: Num) -\u003e Num {\n// here's an example of creating a regular function. \n// MoSa's DAS function definition is a syntactic sugar,\n// the interpreter see's them both as regular functions,\n// and a regular function can be called with the `-\u003e\u003e` operator,\n// and a DAS function can be called with `()`\n    let buf = 1;\n    (:=buf * 2)?:power;\n    buf\n}\n\nimmut let power = 8; // MoSa has no constants in their regular form, so we use `immut let` to create a variable that cannot be modified in the future\nlet res = power -\u003e\u003e power_of_two; // using DAS to pass `power` as an argument to `power_of_two`\nres // returning `res`; 256 is the result\n```\n\nYou can check the docs at the wiki: https://github.com/NaKeRNarolino/mountain_sakura/wiki","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakernarolino%2Fmountain_sakura","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnakernarolino%2Fmountain_sakura","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakernarolino%2Fmountain_sakura/lists"}