{"id":17119061,"url":"https://github.com/chyroc/anbko","last_synced_at":"2025-03-24T02:19:09.183Z","repository":{"id":57633430,"uuid":"414305050","full_name":"chyroc/anbko","owner":"chyroc","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-07T14:11:55.000Z","size":2242,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T08:23:29.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/chyroc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"mattn","patreon":"mattn","open_collective":"mattn","ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2021-10-06T17:17:52.000Z","updated_at":"2022-10-21T00:10:28.000Z","dependencies_parsed_at":"2022-08-31T13:20:19.001Z","dependency_job_id":null,"html_url":"https://github.com/chyroc/anbko","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fanbko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fanbko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fanbko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fanbko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chyroc","download_url":"https://codeload.github.com/chyroc/anbko/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245195962,"owners_count":20575938,"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":[],"created_at":"2024-10-14T17:56:11.982Z","updated_at":"2025-03-24T02:19:09.163Z","avatar_url":"https://github.com/chyroc.png","language":"Go","funding_links":["https://github.com/sponsors/mattn","https://patreon.com/mattn","https://opencollective.com/mattn","https://opencollective.com/mattn-anko","https://opencollective.com/mattn-anko/contribute","https://opencollective.com/mattn-anko/organization/0/website","https://opencollective.com/mattn-anko/organization/1/website","https://opencollective.com/mattn-anko/organization/2/website","https://opencollective.com/mattn-anko/organization/3/website","https://opencollective.com/mattn-anko/organization/4/website","https://opencollective.com/mattn-anko/organization/5/website","https://opencollective.com/mattn-anko/organization/6/website","https://opencollective.com/mattn-anko/organization/7/website","https://opencollective.com/mattn-anko/organization/8/website","https://opencollective.com/mattn-anko/organization/9/website"],"categories":[],"sub_categories":[],"readme":"# Anko\n\n[![GoDoc Reference](https://godoc.org/github.com/chyroc/anbko/vm?status.svg)](http://godoc.org/github.com/chyroc/anbko/vm)\n[![Build Status](https://travis-ci.org/chyroc/anbko.svg?branch=master)](https://travis-ci.org/chyroc/anbko)\n[![Financial Contributors on Open Collective](https://opencollective.com/mattn-anko/all/badge.svg?label=financial+contributors)](https://opencollective.com/mattn-anko) [![Coverage](https://codecov.io/gh/chyroc/anbko/branch/master/graph/badge.svg)](https://codecov.io/gh/chyroc/anbko)\n[![Go Report Card](https://goreportcard.com/badge/github.com/chyroc/anbko)](https://goreportcard.com/report/github.com/chyroc/anbko)\n\nAnko is a scriptable interpreter written in Go.\n\n![](https://raw.githubusercontent.com/chyroc/anbko/master/anko.png)\n\n(Picture licensed under CC BY-SA 3.0, photo by Ocdp)\n\n\n## Usage Example - Embedded\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/chyroc/anbko/env\"\n\t\"github.com/chyroc/anbko/vm\"\n)\n\nfunc main() {\n\te := env.NewEnv()\n\n\terr := e.Define(\"println\", fmt.Println)\n\tif err != nil {\n\t\tlog.Fatalf(\"Define error: %v\\n\", err)\n\t}\n\n\tscript := `\nprintln(\"Hello World :)\")\n`\n\n\t_, err = vm.Execute(e, nil, script)\n\tif err != nil {\n\t\tlog.Fatalf(\"Execute error: %v\\n\", err)\n\t}\n\n\t// output: Hello World :)\n}\n```\n\nMore examples are located in the GoDoc:\n\nhttps://godoc.org/github.com/chyroc/anbko/vm\n\n\n## Usage Example - Command Line\n\n### Building\n```\ngo get github.com/chyroc/anbko\ngo install github.com/chyroc/anbko\n```\n\n### Running an Anko script file named script.ank\n```\n./anko script.ank\n```\n\n## Anko Script Quick Start\n```\n// declare variables\nx = 1\ny = x + 1\n\n// print using outside the script defined println function\nprintln(x + y) // 3\n\n// if else statement\nif x \u003c 1 || y \u003c 1 {\n\tprintln(x)\n} else if x \u003c 1 \u0026\u0026 y \u003c 1 {\n\tprintln(y)\n} else {\n\tprintln(x + y)\n}\n\n// slice\na = []interface{1, 2, 3}\nprintln(a) // [1 2 3]\nprintln(a[0]) // 1\n\n// map\na = map[interface]interface{\"x\": 1}\nprintln(a) // map[x:1]\na.b = 2\na[\"c\"] = 3\nprintln(a[\"b\"]) // 2\nprintln(a.c) // 3\n\n// struct\na = make(struct {\n\tA int64,\n\tB float64\n})\na.A = 4\na.B = 5.5\nprintln(a.A) // 4\nprintln(a.B) // 5.5\n\n// function\nfunc a (x) {\n\tprintln(x + 1)\n}\na(5) // 6\n```\n\n\n## Please note that the master branch is not stable\n\nThe master branch language and API may change at any time.\n\nTo mitigate breaking changes, please use tagged branches. New tagged branches will be created for breaking changes.\n\n\n## Author\n\nYasuhiro Matsumoto (a.k.a mattn)\n\n## Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/chyroc/anbko/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/mattn-anko/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/mattn-anko\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/mattn-anko/contribute)]\n\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/1/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/2/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/3/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/4/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/5/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/6/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/7/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/8/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/mattn-anko/organization/9/website\"\u003e\u003cimg src=\"https://opencollective.com/mattn-anko/organization/9/avatar.svg\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchyroc%2Fanbko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchyroc%2Fanbko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchyroc%2Fanbko/lists"}