{"id":13412705,"url":"https://github.com/mattn/anko","last_synced_at":"2025-05-13T22:08:05.897Z","repository":{"id":41812307,"uuid":"18204375","full_name":"mattn/anko","owner":"mattn","description":"Scriptable interpreter written in golang","archived":false,"fork":false,"pushed_at":"2025-04-03T15:04:12.000Z","size":2271,"stargazers_count":1508,"open_issues_count":25,"forks_count":121,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-04-30T15:18:17.234Z","etag":null,"topics":["go","programming-language"],"latest_commit_sha":null,"homepage":"http://play-anko.appspot.com/","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/mattn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"mattn","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2014-03-28T07:29:40.000Z","updated_at":"2025-04-29T18:47:19.000Z","dependencies_parsed_at":"2025-04-13T14:06:55.774Z","dependency_job_id":"d09edc95-d5b9-48f9-acc0-69def7c98288","html_url":"https://github.com/mattn/anko","commit_stats":{"total_commits":912,"total_committers":22,"mean_commits":41.45454545454545,"dds":0.4923245614035088,"last_synced_commit":"478d45b778b5700bb9af1cfb59eb28ecdd9001c0"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fanko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fanko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fanko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fanko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattn","download_url":"https://codeload.github.com/mattn/anko/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036826,"owners_count":22003654,"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":["go","programming-language"],"created_at":"2024-07-30T20:01:28.102Z","updated_at":"2025-05-13T22:08:00.873Z","avatar_url":"https://github.com/mattn.png","language":"Go","funding_links":["https://github.com/sponsors/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":["Embeddable Scripting Languages","开源类库","Go","Open source library","脚本语言与嵌入式编程","Relational Databases","Repositories","嵌入式腳本語言","可嵌入的脚本语言","嵌入式脚本语言","\u003cspan id=\"嵌入式脚本语言-embeddable-scripting-languages\"\u003e嵌入式脚本语言 Embeddable Scripting Languages\u003c/span\u003e","脚本语言与嵌入式编程`在你的go代码中嵌入其他脚本语言`"],"sub_categories":["Search and Analytic Databases","解释器","Advanced Console UIs","Interpreter","SQL 查询语句构建库","高級控制台界面","检索及分析资料库","高级控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# Anko\n\n[![GoDoc Reference](https://godoc.org/github.com/mattn/anko/vm?status.svg)](http://godoc.org/github.com/mattn/anko/vm)\n[![Build Status](https://travis-ci.org/mattn/anko.svg?branch=master)](https://travis-ci.org/mattn/anko)\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/mattn/anko/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/anko)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/anko)](https://goreportcard.com/report/github.com/mattn/anko)\n\nAnko is a scriptable interpreter written in Go.\n\n![](https://raw.githubusercontent.com/mattn/anko/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/mattn/anko/env\"\n\t\"github.com/mattn/anko/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/mattn/anko/vm\n\n\n## Usage Example - Command Line\n\n### Building\n```\ngo get github.com/mattn/anko\ngo install github.com/mattn/anko\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/mattn/anko/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%2Fmattn%2Fanko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattn%2Fanko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattn%2Fanko/lists"}