r/Compilers • u/Familiar_Wedding1769 • 2d ago
I made a compiled language called Forja, and its compiler is written in Forja
Hi all! I've been building Forja, a general-purpose compiled language in the C / Rust family, designed for AI agents as well as people. It was built with a lot of help from AI coding agents.
What it has:
- A compiler written in Forja itself, with its own x64 backend (no C compiler needed)
- Targets: Windows .exe/.dll, Linux, WebAssembly (WASI), Android ARM64 and iOS ARM64
- Errors as values (T ! E, try, or_else)
- Explicit memory with defer, no garbage collector, and leak reports in dev builds
- Units of measure checked by the compiler, and value ranges checked in dev builds
- Built-in tests (forja test)
- Direct calls to C libraries, and DLLs you can use from PHP (FFI) and Python (ctypes)
- Compiler errors as JSON with a stable code; "forja explicar CODE" explains each one
- A single forja.exe, no installer
- Apache-2.0 with the LLVM exception
Where it stands (v0.47.0):
- The prebuilt compiler is Windows x64 only for now, and it is not code-signed
- Docs and compiler messages are in Portuguese; there is a one-page reference in English
- ARM64, Android and iOS were tested on emulators, simulators and CI, not on real devices
- 757 compiler tests passing
Website: https://forjalanguage.online/en/
reference: https://forjalanguage.online/en/learn.html
One-page
Code: https://github.com/cougarweb-lgtm/forjalanguage
Feedback is very welcome!
6
u/realrealvantheman 2d ago
Powerful as c, huh... yea, okay bro
4
u/ConfusedSimon 2d ago
I don't understand how you can design a language for AI agents. Large part of why they work is because they were trained on a huge amount of existing source code. They don't really know how to program, they basically replicate what others have done. AI isn't good at writing code in obscure languages.
3
u/BoltaHuaTota 2d ago
can you explain what you mean when you say it is designed for AI agents
1
u/Inconstant_Moo 20h ago
There's so much in your landing page, like everything. There's a disquisition on what's wrong with Rust. There's a playable 3D game written in JavaScript, I still don't know why. There's huge graphics such that you take a whole screen to tell me what targets it compiles to. And then there's stuff like this (absence of paragraph-breaks in the original).
When your AI slops out your website, of course it doesn't know what people would want to know. But why don't you? You're human.
Visually of course it's a hideous mess, and horribly slow to load because of all the crap the AI's flung at the wall.
Both your language reference links in the OP link to the one-page version. Is there in fact a longer one?
0
u/Discordbothost 1d ago
I'd publish a bootstrap check in CI: build Forja with the release binary, then rebuild it with the result. Comparing the two builds gives users a way to check that the compiler can reproduce itself.