https://github.com/loderunner/pocklang
https://github.com/loderunner/pocklang
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/loderunner/pocklang
- Owner: loderunner
- Created: 2024-08-30T13:18:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-06T20:27:31.000Z (over 1 year ago)
- Last Synced: 2025-03-31T23:40:00.134Z (12 months ago)
- Language: Go
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Pock is a small language to perform simple calculations and comparisons. I named
it "Pock" because it reminded me of the small expressions I would type in my
dad's [Pocket computer](https://en.wikipedia.org/wiki/Pocket_computer) back in
the 80s.

# Getting Started
To run Pock, type:
```shell
go install github.com/loderunner/pocklang/cmd/pock
pock
```
## Loading state
You can load a JSON file as an immutable state for the interpreter, and refer to
the values of the state in your pock expressions.
```json
{
"hello": "world",
"THX": 1138,
"foo": {
"bar": {
"baz": true
}
}
}
```
```
❯ pock --state state.json
Pock v0.0.0
> hello
"world"
> THX
1138
> foo.bar.baz
true
```