Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agentcooper/eye
Eye is a statically typed compiled language implemented using LLVM, with a syntax inspired by TypeScript
https://github.com/agentcooper/eye
compiler llvm programming-language typescript
Last synced: 2 months ago
JSON representation
Eye is a statically typed compiled language implemented using LLVM, with a syntax inspired by TypeScript
- Host: GitHub
- URL: https://github.com/agentcooper/eye
- Owner: agentcooper
- Created: 2023-10-30T12:40:40.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-28T20:09:20.000Z (12 months ago)
- Last Synced: 2024-01-28T21:24:50.500Z (12 months ago)
- Topics: compiler, llvm, programming-language, typescript
- Language: C++
- Homepage:
- Size: 354 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Eye
**🚧 Work in progress 🚧**
Eye is a statically typed compiled language implemented using LLVM, with a syntax inspired by TypeScript.
```typescript
interface Counter {
inc: () => i64,
reset: () => void
}function makeCounter(initialValue: i64): Counter {
let counter = initialValue;
let inc = (): i64 => {
counter = counter + 1;
return counter;
};
let reset = (): void => {
counter = 0;
};
return { inc: inc, reset: reset };
}function main(): i64 {
let counter = makeCounter(10);
let inc = counter.inc;
let reset = counter.reset;
print(inc());
print(inc());
reset();
print(inc());
print(inc());
return 0;
}
```Roadmap is available in [`TODO.md`](TODO.md).
## Build
```bash
make all
```Make sure you have LLVM installed.
On macOS 13, I have LLVM installed through [Brew](https://formulae.brew.sh/formula/llvm), with following environment variables set:
```bash
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export SDKROOT="$(xcrun --show-sdk-path)"
export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
```## Run example programs
```bash
# compile and run
make program SOURCE_FILE=snapshots/closure.eye && ./program# compile and run (debug)
DEBUG=1 make program SOURCE_FILE=snapshots/closure.eye && ./program
```## Tests
Testing is done by checking the expected change in snapshots.
```bash
make snapshot
```## Name
The name "Eye" is inspired by the [IJ bay in Amsterdam](https://en.wikipedia.org/wiki/IJ_(Amsterdam)).