Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattn/anko
Scriptable interpreter written in golang
https://github.com/mattn/anko
go programming-language
Last synced: about 2 months ago
JSON representation
Scriptable interpreter written in golang
- Host: GitHub
- URL: https://github.com/mattn/anko
- Owner: mattn
- License: mit
- Created: 2014-03-28T07:29:40.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-12T09:38:59.000Z (6 months ago)
- Last Synced: 2024-02-21T00:33:11.971Z (4 months ago)
- Topics: go, programming-language
- Language: Go
- Homepage: http://play-anko.appspot.com/
- Size: 2.16 MB
- Stars: 1,419
- Watchers: 45
- Forks: 127
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Lists
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-go-extra - anko - 03-28T07:29:40Z|2022-02-06T11:43:43Z| (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- go-awesome - Anko
- awesome-go - anko - Scriptable interpreter written in Go. Stars:`1.4K`. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-repositories - mattn/anko - Scriptable interpreter written in golang (Go)
- awesome-repositories - mattn/anko - Scriptable interpreter written in golang (Go)
- awesome-golang-repositories - anko
- awesome-go-cn - anko
- fucking-awesome-go - :octocat: anko - Scriptable interpreter written in Go :star: 267 :fork_and_knife: 24 (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go-projects - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Standard CLI)
- awesome-go - anko - | - | - | (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-projects - anko - Scriptable interpreter written in golang (Go)
- awesome-go - anko - Scriptable interpreter written in Go (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go-with-framework - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-go-cn - anko
- awesome-go - anko - Scriptable interpreter written in Go (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - 用Go编写的脚本化的解释器。 (<span id="嵌入式脚本语言-embeddable-scripting-languages">嵌入式脚本语言 Embeddable Scripting Languages</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go. - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go-cn - anko - Go 语言编写的解释器 (嵌入式脚本语言 / 高级控制台界面)
- awesome-go-with-stars - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- go-awesome - Anko
- repo-1316-awesome-go-cn - anko
- repo-1211-awesome-go-cn - anko
- awesome-Char - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-reader - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- Go-awesome - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- go-awesome-cn-star - anko
- awesome-go - anko - Scriptable interpreter written in Go (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go-cn - anko
- my-awesome - mattn/anko - language pushed_at:2023-12 star:1.4k fork:0.1k Scriptable interpreter written in golang (Go)
- awesome-go-handwritten - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Go 語言編寫的解釋器 (嵌入式腳本語言 / 高級控制台界面)
- awesome-go - anko - Scriptable interpreter written in golang - ★ 777 (Embeddable Scripting Languages)
- go-awesome - Anko
- awesome-go2 - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-go - anko - Scriptable interpreter written in Go (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Advanced Console UIs)
- awesome-go-cn - anko
- awesome-go-zh - anko
- awesome-go-stars - anko(stars: 1432) - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-go-cn - anko
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
- awesome-go - anko - Scriptable interpreter written in Go. (Embeddable Scripting Languages / Search and Analytic Databases)
README
# Anko
[![GoDoc Reference](https://godoc.org/github.com/mattn/anko/vm?status.svg)](http://godoc.org/github.com/mattn/anko/vm)
[![Build Status](https://travis-ci.org/mattn/anko.svg?branch=master)](https://travis-ci.org/mattn/anko)
[![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)
[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/anko)](https://goreportcard.com/report/github.com/mattn/anko)Anko is a scriptable interpreter written in Go.
![](https://raw.githubusercontent.com/mattn/anko/master/anko.png)
(Picture licensed under CC BY-SA 3.0, photo by Ocdp)
## Usage Example - Embedded
```go
package mainimport (
"fmt"
"log""github.com/mattn/anko/env"
"github.com/mattn/anko/vm"
)func main() {
e := env.NewEnv()err := e.Define("println", fmt.Println)
if err != nil {
log.Fatalf("Define error: %v\n", err)
}script := `
println("Hello World :)")
`_, err = vm.Execute(e, nil, script)
if err != nil {
log.Fatalf("Execute error: %v\n", err)
}// output: Hello World :)
}
```More examples are located in the GoDoc:
https://godoc.org/github.com/mattn/anko/vm
## Usage Example - Command Line
### Building
```
go get github.com/mattn/anko
go install github.com/mattn/anko
```### Running an Anko script file named script.ank
```
./anko script.ank
```## Anko Script Quick Start
```
// declare variables
x = 1
y = x + 1// print using outside the script defined println function
println(x + y) // 3// if else statement
if x < 1 || y < 1 {
println(x)
} else if x < 1 && y < 1 {
println(y)
} else {
println(x + y)
}// slice
a = []interface{1, 2, 3}
println(a) // [1 2 3]
println(a[0]) // 1// map
a = map[interface]interface{"x": 1}
println(a) // map[x:1]
a.b = 2
a["c"] = 3
println(a["b"]) // 2
println(a.c) // 3// struct
a = make(struct {
A int64,
B float64
})
a.A = 4
a.B = 5.5
println(a.A) // 4
println(a.B) // 5.5// function
func a (x) {
println(x + 1)
}
a(5) // 6
```## Please note that the master branch is not stable
The master branch language and API may change at any time.
To mitigate breaking changes, please use tagged branches. New tagged branches will be created for breaking changes.
## Author
Yasuhiro Matsumoto (a.k.a mattn)
## Contributors
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
### Financial Contributors
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/mattn-anko/contribute)]
#### Individuals
#### Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/mattn-anko/contribute)]