Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hazbo/the-super-tiny-compiler
Like The Super Tiny Compiler, but in Go
https://github.com/hazbo/the-super-tiny-compiler
Last synced: 2 months ago
JSON representation
Like The Super Tiny Compiler, but in Go
- Host: GitHub
- URL: https://github.com/hazbo/the-super-tiny-compiler
- Owner: hazbo
- License: cc-by-4.0
- Created: 2016-04-14T12:54:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-02T14:27:59.000Z (over 2 years ago)
- Last Synced: 2024-01-27T19:44:54.651Z (5 months ago)
- Language: Go
- Size: 22.5 KB
- Stars: 530
- Watchers: 10
- Forks: 40
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- build-your-own-x - **Go**: _The Super Tiny Compiler_
- build-your-own-x - **Go**: _The Super Tiny Compiler_
README
You may have recently come across [The Super Tiny Compiler][1] project. I read
the code a handful of times back-to-back and decided to see if I could write a
compiler myself, in Go. This project essentially just a port of the original
one, which is written in JavaScript. With comments, it's around 1000 lines -
without, only around 250.### Usage
```
$ git clone [email protected]:hazbo/the-super-tiny-compiler.git
$ cd the-super-tiny-compiler && go build -o tiny
$ ./tiny
```Input: `(add 2 (subtract 10 5))`
Output: `add(2, subtract(10, 5));`
You can find the input towards the bottom of compiler.go.
### Tests
```
$ go test
```### Contributing
Feel free to issue a pull request if you feel there is something you could or
would like to add to this project.---
[![cc-by-4.0](https://licensebuttons.net/l/by/4.0/80x15.png)](http://creativecommons.org/licenses/by/4.0/)
[1]: https://github.com/thejameskyle/the-super-tiny-compiler