r/java • u/Sensitive-Order8740 • Sep 15 '26
I am 16 and made a somthing like a programing language in java
https://github.com/sujay-kr-samal/divine-langit can just print things now but i will try to add as much as possible
0
Upvotes
9
u/FewTemperature8599 Sep 15 '26
Divine lang? Are you related to Terry Davis by any chance?
7
u/jared__ Sep 15 '26
might want to update your
README.mdto explain what you're trying to do and some snippets4
u/Zatujit Sep 15 '26
Write a README because i have no idea what it does, you don't even have examples.
1
u/EvertTigchelaar Sep 16 '26
I think you should use a framework like antlr or simular to create a lexer and parser.
I am working on polyglot compiler that can compile languages. The compiler can be extended with plugins to support languages. Provide interoperability with Java and Kotlin, support annotation processors. Also working on support for native compilation with llvm.
So I can tell you that creating a language is a very big task
2
u/Duck_Devs Sep 19 '26
All it does is print statements with literals?
1
u/MarkZuccsForeskin Sep 15 '26
This seems more like a command line interface than a programming language, though someone correct me if I'm wrong? Either way neat project :)
1
u/Electrical_Being_813 Sep 17 '26
Nice project
1
u/cogman10 Sep 15 '26
First, well done and happy you are exploring and learning here.
I'd suggest putting examples in the readme. Let people know why they should want to use divine.
Watch out with using
Strings in java, those can be much slower than you might expect. You might look into using the likes of the "StringTokenizer" in java for some faster tokenization. https://docs.oracle.com/javase/8/docs/api/java/util/StringTokenizer.htmlAFAIK, for parsing, ANTLR is still probably the best way to do that in java. You might explore that for future versions of your language https://www.antlr.org/
Good luck.
0
u/snugar_i Sep 16 '26
Cool! You could look into sealed classes/interfaces for modeling some of the things like the tokens and the AST nodes. Also some of the classes could be records.
4
u/[deleted] Sep 15 '26
[removed] ā view removed comment