Pallas is a systems programming language that combines low-level control with a safer, modern language design. This is a personal project inspired by my friend Lily's programming language, ADAN and many ideas inspired by languages like C/C++, Go, Rust and Zig.
What Pallas gives you:
- Explicit behavior
- Manual memory management
- Structs and classes
- Pattern matching
- Familiar syntax
Pallas is a personal project - Though I'd appreciate any contributions and feedback.
-
Personal Discord: @kauht or @yuhbayn
-
Discord: Server
-
GitHub: kauht/Pallas
| General | Language Reference |
|---|---|
- CMake
- A C++17 compatible compiler
- LLVM v14+
cmake -S . -B build
cmake --build buildbuild/palc --helpPallas uses explicitly-sized types. No implicit numeric conversions.
| Type | Description |
|---|---|
i8, i16, i32, i64, i128 |
Signed |
u8, u16, u32, u64, i128 |
Unsigned |
f32, f64 |
Floating point |
bool |
Boolean |
char |
Character |
string |
String |
void |
No Type |
Type aliases:
| Alias | Equals |
|---|---|
int |
i64 |
uint |
u64 |
float |
f32 |
double |
f64 |
Pointers and Arrays:
T*- pointer to TT**- pointer to pointerT[n]- array of n size
x: i32 = 42;
const PI: f32 = 3.14159;
square(n: i32): i32 {
return n * n;
}
Structs only support data. Classes support methods, constructors, and destructors.
struct Vector3 {
x: f32;
y: f32;
z: f32;
}
class Person {
public:
name: string;
age: i32;
Person(n: string, a: i32) {
name = n;
age = a;
}
~Person() {
// destructor
}
greet(): void {
println("Hello, ${name}, you are ${age} years old!");
}
private:
ssn: string;
}
if (x > 10) {
println("large");
} else {
println("small");
}
for (i: i32 = 0; i < 10; i++) {
println("${i}");
}
counter: i32 = 0;
while (counter < n) {
counter++;
}
match (x) {
0 => { println("zero"); }
1 => { println("one"); }
42 => { println("rahh"); }
_ => { println("something else"); }
}
Manual memory management with new and delete.
x: i32 = 5;
p: i32* = &x;
*p = 10;
arr: i32* = new i32[10];
arr[0] = 1;
delete arr;
No implicit conversions, besides when using literals.
x: i32 = 5; // OK
y: f32 = 5; // OK
z: f32 = (f32)x; // OK
a: f32 = x; // ERROR
add(a: i32, b: i32): i32 {
return a + b;
}
main(): void {
p: Person* = new Person("Sammy", 17);
p.greet();
delete p;
}
Goals:
- Finish language spec
- Complete Scanner(pretty much done)
- Complete Parser
- Complete Semantic
- Integrate LLVM
- Complete IR
- Complete Codegen
- Add tests for parser, semantics, and codegen
- Write LSP and formatter (VSCode/Zed/Neovim)
Contributions are always welcome, check out CONTRIBUTING.md for more information.
Pallas uses MIT licensed - see LICENSE.
Pallas is heavily inspired by the following projects