{"id":16104074,"url":"https://github.com/imkiva/fluorine-rs","last_synced_at":"2025-03-18T08:31:30.902Z","repository":{"id":93494114,"uuid":"251569739","full_name":"imkiva/fluorine-rs","owner":"imkiva","description":"STLC with generics, ADTs, pattern matching, and Rust FFI","archived":false,"fork":false,"pushed_at":"2021-02-28T05:46:16.000Z","size":2045,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T08:19:50.705Z","etag":null,"topics":["ffi-macros","lambda-calculus","programming-language","rust"],"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/imkiva.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":"2020-03-31T10:24:37.000Z","updated_at":"2022-06-04T06:25:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9658c56-90a0-4941-88f3-2407ff5a7d96","html_url":"https://github.com/imkiva/fluorine-rs","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/imkiva%2Ffluorine-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imkiva%2Ffluorine-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imkiva%2Ffluorine-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imkiva%2Ffluorine-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imkiva","download_url":"https://codeload.github.com/imkiva/fluorine-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910750,"owners_count":20367545,"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":["ffi-macros","lambda-calculus","programming-language","rust"],"created_at":"2024-10-09T18:59:35.719Z","updated_at":"2025-03-18T08:31:30.896Z","avatar_url":"https://github.com/imkiva.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](logo/fluorine-logo.png)\n![Rust](https://github.com/imkiva/fluorine-rs/workflows/Rust/badge.svg)\n\nfluorine-rs\n============\n\nA functional programming language with my personal preference.\n\n## Features\n- Trait-based OO\n- Generic Types\n- Pattern matching\n- Rust-like enums\n- Optional type hints\n- Operator overloading via traits\n- Easy-to-use FFI macros\n\n## Examples\n- Pattern matching\n```fluorine\nenum Expr {\n    Add(Expr, Expr),\n    Sub(Expr, Expr),\n    Mul(Expr, Expr),\n    Div(Expr, Expr),\n    Lit(Number),\n}\n\nlet eval = { expr -\u003e\n    match expr {\n        Add(l, r) =\u003e eval(l) + eval(r),\n        Sub(l, r) =\u003e eval(l) - eval(r),\n        Mul(l, r) =\u003e eval(l) * eval(r),\n        Div(l, r) =\u003e eval(l) / eval(r),\n        Lit(n)    =\u003e n,\n    }\n}\n\n// (1 + 8) * 10\nlet tree = Mul(Add(Lit(1), Lit(8)), Lit(10))\n\n// 90\nprintln(eval(tree))\n```\n\n- Traits and Impl\n```fluorine\nenum Data {\n    EmptyData,\n}\n\ntrait Greet {\n    let greeting: (self, name: String) -\u003e Unit\n}\n\ntrait Call {\n    let call: (self, unit: Unit) -\u003e Unit\n}\n\nimpl Greet for Data {\n    let greeting = { self, name -\u003e println(\"hello \" + name) }\n}\n\nimpl\u003cT: Greet\u003e Call for T {\n    let call = { self, _ -\u003e self.greeting(\"fluorine\") }\n}\n\nlet data = EmptyData();\n// hello fluorine\ndata.call(());\n```\n\n- FFI macros\n```rust\n#[fluorine(Prelude)]\nmod prelude_ffi {\n    use crate::ffi::*;\n    \n    #[fluorine]\n    fn hello(name: String) {\n        println!(\"hello {}\", name);\n    }\n}\n```\n\nand in fluorine, just do:\n```fluorine\nFs\u003e hello(\"jobs\")\nhello jobs\n```\n\n## Acknowledge\n\nWe would like to thank [JetBrains](https://www.jetbrains.com/?from=mozart++) for sharing free\nopen-source licences of amazing tools such as [CLion](https://www.jetbrains.com/idea/?from=mozart++).\n\n[\u003cimg src=\"logo/jetbrains.png\" width=\"200\"/\u003e](https://www.jetbrains.com/?from=mozart++)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimkiva%2Ffluorine-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimkiva%2Ffluorine-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimkiva%2Ffluorine-rs/lists"}