After months of coding, I finally put my language Forge out into the world. It’s an interpreted language I built from scratch in C++, and the part I’m most proud of is a feature called (@expect)
(@expect) lets you write symbolic assertions that don’t just crash when something goes wrong, they actually explain what happened, suggest fixes, and can even recover automatically (still working out kinks).
Here’s an example:
```
let x = 3
let y = 10
@expect(x > 5 && y < 5, "x and y must be in range") else: {
println("Recovering: adjusting x and y")
x = 6
y = 4
}
```
If that fails, Forge prints a full analysis of what went wrong (it even breaks down composite conditions like && or ||), shows the deltas, and can run a recovery block. It also logs a summary at the end of your program.
I wanted debugging to feel less like punishment and more like a conversation, something that helps you understand why a condition failed and how to recover from it.
I’d love feedback, ideas, or even wild feature suggestions. Right now it supports boolean expectations, recovery blocks, and composite condition analysis.
I know it’s still small, but this project has been pretty fun. I’d really appreciate any feedback, code reviews, stars, or just opinions.
ForgeLang•2h ago
After months of coding, I finally put my language Forge out into the world. It’s an interpreted language I built from scratch in C++, and the part I’m most proud of is a feature called (@expect)
(@expect) lets you write symbolic assertions that don’t just crash when something goes wrong, they actually explain what happened, suggest fixes, and can even recover automatically (still working out kinks). Here’s an example: ``` let x = 3 let y = 10
@expect(x > 5 && y < 5, "x and y must be in range") else: { println("Recovering: adjusting x and y") x = 6 y = 4 } ``` If that fails, Forge prints a full analysis of what went wrong (it even breaks down composite conditions like && or ||), shows the deltas, and can run a recovery block. It also logs a summary at the end of your program.
I wanted debugging to feel less like punishment and more like a conversation, something that helps you understand why a condition failed and how to recover from it.
It’s open source, and you can check it out here: https://github.com/FrostByte232/ForgeLang
I’d love feedback, ideas, or even wild feature suggestions. Right now it supports boolean expectations, recovery blocks, and composite condition analysis.
I know it’s still small, but this project has been pretty fun. I’d really appreciate any feedback, code reviews, stars, or just opinions.
Thanks for reading!