Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lujjjh/gates
An embedded language for Go.
https://github.com/lujjjh/gates
embedded-language go golang language scripting-language vm
Last synced: 7 days ago
JSON representation
An embedded language for Go.
- Host: GitHub
- URL: https://github.com/lujjjh/gates
- Owner: lujjjh
- License: mit
- Created: 2018-10-26T17:04:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-12T08:33:16.000Z (almost 4 years ago)
- Last Synced: 2024-08-01T13:30:44.123Z (3 months ago)
- Topics: embedded-language, go, golang, language, scripting-language, vm
- Language: Go
- Homepage:
- Size: 152 KB
- Stars: 83
- Watchers: 6
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - lujjjh/gates - An embedded language for Go. (Go)
README
# Gates
![](https://github.com/lujjjh/gates/workflows/Test/badge.svg)
> An embedded language for Go.
## Features
- Easily embedded in Go.
- JavaScript-like syntax with native int64 support.
- First class functions.
- Execution time limit.## Comparision
| | Gates | Lua 5.3+ | JavaScript |
|-----------------------|:-----:|:---------------------------------------------:|:----------:|
| Int64 support | Y | Y | N |
| Compatible with JSON | Y | N (hard to distinguish between `[]` and `{}`) | Y |
| Easily embedded in Go | Y | N | N |## Try Gates in Command Line
```sh
$ go get -u github.com/lujjjh/gates/cmd/gates
$ echo '[1, 2, 3] | map(x => x * x)' | gates
# 1,4,9
```## Data Types
- number (int64 / float64)
- string
- bool
- map
- array
- function## Examples
[View Examples](/examples/)
## Credits
- https://github.com/dop251/goja/
- https://golang.org/pkg/go/