https://github.com/matcool/tack-lang
toy language
https://github.com/matcool/tack-lang
Last synced: about 2 months ago
JSON representation
toy language
- Host: GitHub
- URL: https://github.com/matcool/tack-lang
- Owner: matcool
- License: mit
- Created: 2022-05-22T20:29:22.000Z (about 3 years ago)
- Default Branch: rewrite
- Last Pushed: 2025-03-05T15:11:26.000Z (3 months ago)
- Last Synced: 2025-03-24T10:37:47.647Z (2 months ago)
- Language: Rust
- Size: 417 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tack
very silly toy language
```rs
fn main(): i32 {
return 42;
}
```## Roadmap
- [X] functions
- [X] variables
- [ ] floats
- [X] if statements
- [X] else statements
- [X] else if
- [X] while statements
- [ ] for loops
- [X] string
- [X] structs
- [X] structs as function args
- [X] pointers
- [X] import
- [X] arrays
- [X] struct literals
```rs
struct Point {
x: i32;
y: i32;
}
fn main(): i32 {
let point: Point = Point { x: 10, y: 20 };
return point.x;
}
```
- [ ] struct methods
```rs
struct Point {
x: i32;
y: i32;fn dist_squared(self): i32 {
return self.x * self.x + self.y * self.y;
}
}fn main(): i32 {
let point: Point = Point { x: 10, y: 20 };
return point.dist_squared();
}
```
- [ ] standard library
- [ ] error handling (Result?, `try expr`?)
- [ ] block expressions, yield statements
- [ ] basic generics
```rs
// not sure on syntax still
fn add(a: T, b: T): T {
return a + b;
}
fn main(): i32 {
// also not sure
return add(1, 2);
}
```