diff --git a/README.md b/README.md index e0e5b4f..36c0b09 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ [![GoDoc](https://godoc.org/github.com/d5/tengo?status.svg)](https://godoc.org/github.com/d5/tengo/script) [![Go Report Card](https://goreportcard.com/badge/github.com/d5/tengo)](https://goreportcard.com/report/github.com/d5/tengo) [![Build Status](https://travis-ci.org/d5/tengo.svg?branch=master)](https://travis-ci.org/d5/tengo) -[![](https://img.shields.io/badge/Support%20Tengo-%241-brightgreen.svg)](https://www.patreon.com/tengolang) **Tengo is a small, dynamic, fast, secure script language for Go.** @@ -16,6 +15,8 @@ Tengo is **[fast](#benchmark)** and secure because it's compiled/executed as byt ```golang /* The Tengo Language */ +fmt := import("fmt") + each := func(seq, fn) { for x in seq { fn(x) } } @@ -25,11 +26,11 @@ sum := func(init, seq) { return init } -n := sum(0, [1, 2, 3]) // == 6 -s := sum("", [1, 2, 3]) // == "123" +fmt.println(sum(0, [1, 2, 3])) // "6" +fmt.println(sum("", [1, 2, 3])) // "123" ``` -> Run this code in the [Playground](https://tengolang.com/?s=d01cf9ed81daba939e26618530eb171f7397d9c9) +> Run this code in the [Playground](https://tengolang.com/?s=0c8d5d0d88f2795a7093d7f35ae12c3afa17bea3) ## Features @@ -41,6 +42,7 @@ s := sum("", [1, 2, 3]) // == "123" - [Securely Embeddable](https://github.com/d5/tengo/blob/master/docs/interoperability.md) and [Extensible](https://github.com/d5/tengo/blob/master/docs/objects.md) - Compiler/runtime written in native Go _(no external deps or cgo)_ - Executable as a [standalone](https://github.com/d5/tengo/blob/master/docs/tengo-cli.md) language / REPL +- Use cases: rules engine, [state machine](https://github.com/d5/go-fsm), [gaming](https://github.com/d5/pbr), data pipeline, [transpiler](https://github.com/d5/tengo2lua) ## Benchmark