{"id":16092720,"url":"https://github.com/jvmakine/shine","last_synced_at":"2026-01-21T02:09:03.686Z","repository":{"id":72373605,"uuid":"243403235","full_name":"jvmakine/shine","owner":"jvmakine","description":"LLVM frontend for Shine","archived":false,"fork":false,"pushed_at":"2022-01-05T10:03:15.000Z","size":782,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T16:50:36.201Z","etag":null,"topics":["compiler","functional-programming","golang","llvm"],"latest_commit_sha":null,"homepage":null,"language":"LLVM","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/jvmakine.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-02-27T01:27:20.000Z","updated_at":"2021-12-28T03:59:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"31871355-3f98-41e6-8476-72cb1768ab86","html_url":"https://github.com/jvmakine/shine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jvmakine/shine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvmakine%2Fshine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvmakine%2Fshine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvmakine%2Fshine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvmakine%2Fshine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jvmakine","download_url":"https://codeload.github.com/jvmakine/shine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvmakine%2Fshine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28622473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"online","status_checked_at":"2026-01-21T02:00:08.227Z","response_time":86,"last_error":null,"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":["compiler","functional-programming","golang","llvm"],"created_at":"2024-10-09T16:10:04.060Z","updated_at":"2026-01-21T02:09:03.672Z","avatar_url":"https://github.com/jvmakine.png","language":"LLVM","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shine frontend for LLVM\n\nAn LLVM frontend for a simple language\n\n## Pre-requirements\n\nLLVM 9 needs to be installed to compile or interpret the IR generated by this compiler.\n\n## Building the runtime\n\nTo build the runtime for the language, call\n\n```\nmake\n```\n\n## Usage\n\nInterpret\n\u003e ./run.sh examples/fibonacci.shi\n\nCompile into executable and run it\n\u003e ./compile.sh examples/fibonacci.shi fibonacci\n\n\u003e ./fibonacci\n\n## Language\n\nEvery script needs to end in an expression. The value of this expression is printed as the output of the program.\n\nExample script:\n```\nfibonacci = (n) =\u003e if (n \u003c= 2) 1 else fibonacci(n-2) + fibonacci(n-1)\n\nfibonacci(40)\n```\nThis prints out `102334155`\n\n### Types\n\nThe language supports full type inference. Explicitly declaring the types is completely optional.\n\n#### Primitive types\n\nThe primitive types supported are\n\ninteger values supporting arithmetic operations\n```\na: int = 1 + 2\n```\n\nreal numbers supporting arithmetic operations\n```\na: real = 1.0 + 2.0\n```\n\nboolean values that can be used as conditions in if expressions. Supports and and or operations\n```\na: bool = true || false\nif (a) 1 else 2\n```\n\nstrings can be used as output values\n```\na: string = \"Hello \" + \"world!\"\na\n```\n\n#### Functions\n\nFunctions are composed or parameter types and the return type. Functions can be used as values themselves, and can capture values from the point of definition in their closures.\n```\nc = 3\nf = (a, b) =\u003e a + b + c\nf(1, 2)\n```\nprints out 6\n\nFunctions don't need to be named and anonymous functions can be defined within an expression.\n\n```\nop = (a, b, f) =\u003e f(a, b)\nop(1, 2, (x, y) =\u003e { x + y })\n```\nprints out 3\n\nFunction parameters can be declared is several blocks to support currying.\n\n```\nf = (a) =\u003e (b) =\u003e a + b\nx = f(1)\nx(2)\n```\nprints out 3\n\n#### Structures\n\nStructures are used to combine several valuesinto a single value. These values can then be accessed with the dot operator. The structure is declared with type declaration operator \"::\" and consists of ordered list of fields and their types.\n\n```\nPerson :: (age: int, height: real, weight: real)\np = Person(38, 1.73, 60.0)\np.weight\n```\n\nprints out 60.0\n\nTo specify free types to be used in the structure, a type variables can be used\n```\nPair[A] :: (left: A, right: A)\n```\n\nExplicitly specifying that an expression is of a specific structure, the structure name can be used.\n```\ngetAge = (p: Person) =\u003e p.age\n```\nIf explicit structure is not defined, functions can take any structure as in input with required fields.\n```\nPerson :: (age: int, height: real)\nAnimal :: (age: int, weight: real)\n\ngetAge = (x) =\u003e x.age\n\ngetAge(Person(30, 1.70)) + getAge(Animal(5, 0.3))\n```\nprints out 35\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvmakine%2Fshine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjvmakine%2Fshine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvmakine%2Fshine/lists"}