r/Compilers • • 1h ago

EasyC, C made easy

I'm working on EasyC, a mostly statically typed, garbage-collected, interpreted programming language with familiar C-style syntax. The idea is to retain the things people like about C while removing some of its biggest pain points: no manual memory management, no pointer arithmetic, garbage collection, bounds-checked slices, static typing by default, checked conversions instead of undefined behavior. Another major goal is making it embeddable in applications through a C-friendly API, somewhat like Lua.

struct Point {
    float x;
    float y;
}

fn float Point::length(const self) {
    return std::sqrt(self.x * self.x + self.y * self.y);
}

fn int main() {
    let Point p = Point{ .x = 3.0, .y = 4.0 };
    std::print(convert!(string, p.length()));
    return 0;
}

It's still in early development, and the interpreter isn't functional yet. I'm currently interested in getting feedback on the language syntax. I'd love to hear what you think, especially from people experienced with language design and compiler development.

0 Upvotes

2 comments sorted by

3

u/NYU_VM 1h ago

It looks like an amalgamation of Zig, C3 and Rust. In fact it is exactly that

1

u/sadesaapuu 26m ago

I don't see the Cee in it? "fn" and "let" give Rust vibes. "::" is Rust and C++. "convert!" is probably some macro thing, again Rust.

So, I'd probably change the name, or the syntax.