Experimenting with a Compiled Language

3 points by JhonPork | 6 comments
I’ve been experimenting with a compiled language design and wanted feedback from people who’ve worked on compilers or systems code.

The core idea is allowing multiple execution profiles to coexist in a single source file:

- userland (default): indentation-based, Python-like syntax, safety by default - kernel: brace-based syntax, strict rules, no heap or runtime - baremetal: brace-based syntax, raw pointers, no safety net

At build time, a single profile is selected and all other code is erased at compile time — no runtime checks or overhead.

The compiler pipeline is lexer → parser → typed IR → LLVM backend, with profile rules enforced during IR validation rather than at runtime.

Roughly ~90% of the core language and compiler are implemented; I plan to open-source the project once the remaining pieces are finished.

This is still an experiment. I’m mainly curious: - does this model make sense? - are there obvious design pitfalls? - has anyone seen similar approaches succeed or fail?

I’d appreciate critical feedback.

Loading...
Loading...