Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/threeaccents/digolang
https://github.com/threeaccents/digolang
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/threeaccents/digolang
- Owner: threeaccents
- Created: 2020-06-07T21:26:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-11T22:53:10.000Z (over 4 years ago)
- Last Synced: 2023-03-21T21:38:53.840Z (almost 2 years ago)
- Language: Go
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DigoLang
Toy programming language based of the Thorsten Ball's incredible book, [Writing an Interpeter in Go](https://interpreterbook.com).
```
let greeter = fn(name) {
return "hello" + " " + name
}let msg = greeter("world")
println(msg)
let a = "hello"
let b;
if (isNull(b)) {
println("b IS NULL!")
} else {
println("b NOT NULL", "it's", b)
}if (isNull(a)) {
println("a IS NULL!")
} else {
println("a NOT NULL", "it's", a)
}let add = fn(x) {
return fn(y) {
x + y;
}
}let adder = add(2)
let four = adder(2)
println(four)
let howLong = "how long is this string?"
println(howLong, len(howLong))
let myarr = [1,2,3]
println(myarr[0])
let myhash = {"awesome": true}
println(myhash["awesome"])
```