{"id":13680985,"url":"https://github.com/ffwff/hana","last_synced_at":"2025-04-30T02:33:45.154Z","repository":{"id":62439985,"uuid":"167359692","full_name":"ffwff/hana","owner":"ffwff","description":"🌸 a simple scripting language (alpha) 🌸","archived":true,"fork":false,"pushed_at":"2019-06-24T03:14:34.000Z","size":1134,"stargazers_count":138,"open_issues_count":9,"forks_count":6,"subscribers_count":5,"default_branch":"haru","last_synced_at":"2025-04-15T08:48:43.391Z","etag":null,"topics":["bytecode-interpreter","programming-language","scripting-language"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ffwff.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}},"created_at":"2019-01-24T11:53:17.000Z","updated_at":"2025-04-02T13:49:57.000Z","dependencies_parsed_at":"2022-11-01T23:33:20.719Z","dependency_job_id":null,"html_url":"https://github.com/ffwff/hana","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/ffwff%2Fhana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffwff%2Fhana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffwff%2Fhana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffwff%2Fhana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ffwff","download_url":"https://codeload.github.com/ffwff/hana/tar.gz/refs/heads/haru","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251629573,"owners_count":21618201,"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":["bytecode-interpreter","programming-language","scripting-language"],"created_at":"2024-08-02T13:01:24.605Z","updated_at":"2025-04-30T02:33:44.711Z","avatar_url":"https://github.com/ffwff.png","language":"Rust","readme":"# 🌸 hana\n\n[![travis](https://travis-ci.org/ffwff/hana.svg?branch=haru)](https://travis-ci.org/ffwff/hana)\n[![codecov](https://codecov.io/gh/ffwff/hana/branch/haru/graph/badge.svg)](https://codecov.io/gh/ffwff/hana)\n[![Gitter](https://badges.gitter.im/flowers-of-spring/community.svg)](https://gitter.im/flowers-of-spring/community)\n\n**hana** is a small dynamically-typed scripting language written in Rust/C\nand is inspired by Pascal, Ruby and Javascript. It primarily supports prototype-based\nobject orientation, dynamic arrays, first-class functions (with closure support). The interpreter\ncomes useful features such as a simple mark-and-sweep garbage collector, exception handling\nand an import system.\n\n**haru**, the Rust parser/runtime generates bytecode that runs on an optimised\nvirtual machine written in C (about as fast as Python and Ruby!)\n\n## Installation\n\nYou'll need to have the cargo package manager and rust installed. You can then do:\n\n```\ncargo install haru\n```\n\nThe interpreter called `haru` will be installed into your PATH.\n\n### Additional features\n\nAdditional features can be enabled by passing their names into\ncargo's `--features` flag:\n\n* `jemalloc`: use the jemalloc memory allocator\n* `cffi`: enables the stdlib's C foreign interface *(wip)*\n\n## Running\n\nOnce built or installed, you can write hana code into a source file, then invoke the interpreter like this:\n\n```\nharu program.hana\n```\n\nAlternatively you could invoke a REPL for easier prototyping:\n\n```\nharu\n```\n\nFor usage, pass the `-h` command:\n\n```\nusage: haru [options] [-c cmd | file | -]\noptions:\n -c cmd : execute program passed in as string\n -d/--dump-vmcode: dumps vm bytecode to stdout\n                   (only works in interpreter mode)\n -b/--bytecode: runs file as bytecode\n -a/--print-ast: prints ast and without run\n -v/--version: version\n```\n\n## Examples\n\n*see [/examples](https://github.com/ffwff/hana/tree/haru/examples) for more*\n\n### Hello World\n\n```\nprint(\"Hello World\\n\")\n```\n\n### Variables\n\n```\nname = \"Alice\"\nage = 20\nprint(name, \" is \", age, \" years old.\\n\")\n```\n\n### Fibonacci numbers\n\n```\n// Regular recursive\nfib(n) = n \u003c= 1 ? 1 : fib(n-1) + fib(n-2)\nprint(fib(30), \"\\n\")\n\n// Faster recursive (with tail-call optimization!)\nfibrec(n, prev, curr) = n \u003c= 0 ? curr : fibrec(n-1, prev+curr, prev)\nfib(n) = fibrec(n+1, 1, 0)\nprint(fib(50), \"\\n\")\n```\n\n## Documentation\n\n*see [DOCUMENTATION.md](https://github.com/ffwff/hana/blob/haru/DOCUMENTATION.md)*\n\n## Building\n\n(building was tested by using rust-nightly and gcc-4.8 on an x64 with Linux, mileage\nmay vary on other architectures)\n\nJust do:\n\n```\ncargo build --release\n```\n\n## License\n\nGPLv3 License\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffwff%2Fhana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fffwff%2Fhana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffwff%2Fhana/lists"}