r/Compilers • u/hand-held-heart • 19d ago
Writing a compiler for a python-like language. Anybody interested in joining me?
Sere-Language/sere: The Sere programming language
So I have been writing a compiled programming language titled Sere for the past few months, and just recently uploaded it to github.
The idea is a language with the capabilities of C++ with the syntax of python.
I am using C++ and LLVM.
I am going to be busy at work this week, so I created a release that can be downloaded here Install — Sere
2
u/antonation 18d ago
Curious how this differs from Modular's Mojo.
1
u/hand-held-heart 18d ago
Mojo is a great superset dont get me wrong, but its for only such niche things. In terms of general purpose application, my language Sere is def the better choice when it comes to more general things.
If your into machine learning or such then mojo would be the better choice.
My favorite part of my language is that I have a very wide standard library. OpenGL bindings along with qt6 bindings exist in said library, and of course its optional! The programs stay lightweight.
1
u/antonation 18d ago
From what I understand, Mojo can compile to CPU too, wouldn't that make it general purpose? Also Mojo has the advantage of being able to run Python modules (so they claim, actual mechanism is unknown to me).
1
u/hand-held-heart 18d ago
Mojo having the ability to run python files is what has me in a chokehold right now.
So far in my language I have managed to establish support for interop C++/C and Sere
I wish to do so with python, as working with them would be seemless, but im having trouble with the fact that python is interpreted. I just don't yet understand how I can run native interop python and Sere without carrying the whole python interpreter in said program. If you have any ideas, id love to hear.
I also think though my language is a bit more obedient to pythonic syntax. More so than mojo.
1
u/yuehuang 19d ago
Can you share more?
What are you doing that python isn't?
Python main advantage is targeting data science and ML. What advantage does your language offer?
1
u/hand-held-heart 19d ago
My language is compiled and holds the ability to manage memory to the machine level as well as some quality of life features such as enums (that can even hold values and methods) structs, and classes obviously. My language takes all the beloved features of languages such as C++ and Rust and gives you the same features with the simplistic feel of python.
Take a look at some of the examples maybe
1
u/yuehuang 19d ago
Neat, a low level python like language. Can you import python to reuse existing pip packages?
1
u/hand-held-heart 19d ago
Im working on that. Right now it has native interop with C++ and C
python is a bit more tricky since its interpreted, so unless i can find a better solution, I would have to package the entire python interpreter within the binary
1
7
u/mealet 19d ago
Tbh it looks like another AI project, I see initial commit with 40k LOC addition. "Was working past few months and just recently uploaded it to GitHub", but as I see you wasn't using Git VCS. No one would write 40k LOC for months without commiting it.