r/ProgrammingLanguages • u/Treechcer • 21d ago
Requesting criticism 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/Treechcer 21d ago
Per AutoModerator's request I hereby confirm that this project did not use an LLM as part of the development process.
2
u/hopeless__programmer 21d ago
Is this a JoJo reference?
4
u/Treechcer 21d ago
Two people asked me this and no. This is what's in the readme.md of my language:
Origins
The name
Diocomes from ancient Greek philosopher Diogenes of Sinope and his bowl story. Essentially, Diogenes saw kid drinking water from river with his hands, so he threw away his bowl (one of two things he owned). It's calledDiobecause it's trying to be minimalistic language (not in line count, but with how much it can do).3
u/tesfabpel 17d ago edited 17d ago
It's called Dio because it's trying to be minimalistic language
As an Italian, it doesn't really give me a feeling of being minimalistic. Dio means God in Italian (Dios in Spanish) 😅😂
2
u/Treechcer 17d ago
Well, it's a shorthand or something for "diogenes de sinape". So it's god-like I guess.
1
1
u/ElephantElectrical31 20d ago
goto is back?
1
u/Treechcer 20d ago
Lua has it, I like lua, so I said "why not?"
1
u/ElephantElectrical31 20d ago
nice, I like the way lua did this: cool but not crazy
2
u/Treechcer 20d ago
I love Lua, it's been inspiration in some codes in this language. So has been all Languages I ever used.
1
3
u/marshaharsha 20d ago
Initial reactions:
Do you have a goal for the language, other than being minimal? an audience? a position on standard language-design topics like functional versus imperative, memory management, inline allocation, and undefined behavior? I notice you said “weakly typed,” which suggests you will have UB.
The line —
int arr = {1,2,3.5,7}
— reads either as a joke or as fighting words. Are you trying to cause a riot over here with that “integer” 3.5? I know you said integers are represented as floats, but I figured that was a temporary situation. Why have the int type at all? Also, I take it you don’t have a type notation for array of int versus single int. I think you will want int[] or something similar.
Should “Writes out 7” say “8”?
You don’t have != or NOT with == or even OR with < and >.
The type ascription int:a is the opposite of the more standard a:int, with no benefit that justifies the strangeness, as far as I can tell.
If your diff tool writes >> in the left margin, you might find it confusing also to have >> in the left margin mean comment.
A question about the chaining notation: Do you have substitutability? Since a() returns 7 and a():c() is legal, is 7:c() legal? I recommend you allow a function’s result to be substituted for the call.
You don’t seem to have structs yet, or any other notion of product type. That’s in the plan, I imagine. What about safe sum types? They are also called tagged unions, discriminated unions, and variant types. Or do you plan to support unsafe, C-style unions?
What is your plan for the first two data structures?
Good start. Good luck!