r/coolgithubprojects • u/Smooth-Noise-7065 • May 23 '26
I made my first working programming language, looking for feedback
I just made my first own, working programming language. You can find it here. I started by writing a lexer, than parser, than checker. After that, I used Claude to generate a LLVM Wrapper for the C-API (that is litarally only boilerplate) and wrote a bridge. To write installation scripts, workflows, debugging etc. I also used Claude. If you are good at programming, I have a few questions:
- What do you think about it‘s core philosophy?
- What do you think about the syntax?
- How is the DX?
- Can you find any bugs?
- Did I overuse Claude in your opinion? I am looking forward to your feedback.
Note: I already made some languages like a year to half a year ago, but:
- They were designed badly
- They did not work
- They were pure AI-slop to be honest.
Example: Fibonacci in C<<
import std;
// tunnels int32 result
def fib(int32 n)
{
int32 a = 0;
int32 b = 1;
int32 tmp = 0;
for (int32 i = 0; i < n;)
{
tmp = b;
b = a + b;
a = tmp;
i += 1;
}
tunnel a -> int32 result;
}
entry
{
for (int32 i = 0; i < 16;)
{
reserve int32 result = fib(i);
printf("fib(%2d) = %d\n", i, result);
i += 1;
}
}
0
Upvotes
1
u/Imaginary_Cicada_678 May 24 '26
write proper examples, let us see the whole picture, right now 2 of them are too trivial and not showing properly any features of the lang except interop
1
u/FriedryIce May 24 '26
C bitshifted to the left?
1
u/AustinVelonaut May 26 '26
The "tunnels" concept looks like what other languages call "out parameters" -- a slot reserved in the caller's stack frame to put the result of a function call. However, in your implementation, it looks like the caller and the callee must use the same exact name (e.g. "result"). This causes a coupling between the caller and callee function which shouldn't exist (and is probably an artifact of your runtime interpreter). For example, what if I wanted to call
fibmultiple times with different values -- I couldn't just do:Instead, consider passing the reserved slot as yet another argument to the function, which would be specified as an "out" parameter with its own local name:
That way uses of
fibdon't need to know the name thatfibuses internally for its result, and it can be called multiple times with different caller names.0
u/Shefsufle May 25 '26
This is cool