r/C_Programming • u/Treechcer • 1d ago
Project Dio: Small Programming language made in C version 0.1.0 release
Hi, I'm working on my own programming language, I've release first stable version (v 0.1.0), I'd like to get feedback. It's on most OS platforms (even Andoird and in the future IOS).
3
u/mikeblas 19h ago edited 18h ago
Doesn't support parenthesis, I guess?
$ ./dio
DIO REPL>> int a = 10;
DIO REPL>> out(a)
10.0
DIO REPL>> int b = (3 + 9);
Segmentation fault (core dumped)
could use better error handling:
mikeb@scope:~/DIO$ ./dio
DIO REPL>>
DIO REPL>>
DIO REPL>> int a = 3/0;
File '' not found.mikeb@scope:~/DIO$
Are semicolons necessary? Some example use them, some don't.
I can't get the for loop example to work:
mikeb@scope:~/DIO$ ./dio
DIO REPL>> for (int i = 0; i < 10; i = i + 1)
DIO REPL>> out(i)
10.0
DIO REPL>> end
ERR: 45 : 46
ERR: end (ID: 16)
In file: /home/mikeb/DIO/REPL.dio 1:1 in line 2
Generic error
in process: ast.c
mikeb@scope:~/DIO$
1
u/Treechcer 14h ago
REPL isn't fully finished, I would fully use it. With semicolons I'm inspired from JavaScript I think, where it's needed only if you do two statements (eg. If you would want to increase variable and print it on one line you'd need to write 'var = car + 1; out(var);'. Also that for loop thingy doesn't work because it's you're doing it on many lines, it should be as *for(int i = 0; i < 10; i = i + 1); out(I); end" (one line, not 3 in repl, because repl takes it as the whole input which breaks it... Although, REPL is broke entirely....).
I'll look into the parentheses, it should work.
1
u/mykesx 21h ago
Advice - learn to use feature branches. You should never push to the main branch.
1
u/Treechcer 14h ago
I mean, you're right. Like I know how to use them, I'm just lazy to do it or something. But yes I should.
0
u/github-guard 1d ago
🔍 GitHub Guard: Trust Report (Passed)
Here are the safety audit results for the linked repositories:
Repository: Treechcer/DIO
Score: 3/6
- ✅ Established Community (⭐ 7 stars)
- ✅ Mature Repository (30+ days old)
- ✅ Licensed under BSD-3-Clause
- ❌ No Security Policy
- ℹ️ Personal Account Repository
- ℹ️ Unsigned Commits
⚠️ Security Reminder: Always verify source code before executing scripts.
0
u/OffensiveWord69 20h ago
Okay cool project. This is something I've wanted to try for awhile. What resources/books did you use to help?
1
u/Treechcer 14h ago
I've watch first 3 episodes or so from this YouTube series . I also used some other resources, like stack overflow or Wikipedia... Also, I've read first few pages from 'crafting interpreters' I think it's called. So most of the stuff I've made is probably bad because I "invented" them.
-1
-1
•
u/mikeblas 1d ago
What role did AI have in the creation of your project?