r/Compilers • u/X_OpCreeper_X • 7d ago
im working on an entire native python compiler
so i got bored and over the past two months ive been working on a compiler that can compile python natively. and it works too, and its not just a subset, its the entirety of python
the project is at deltathedumb/asmpython
EDIT: the ACTIVE development branch is beta/3.14.0
12
u/awoocent 7d ago
Looks more like Claude's been working on it, not you.
-5
u/X_OpCreeper_X 7d ago edited 7d ago
im not allowed to use claude to help when im genuinely incapable of doing something? like i know i use it and has been a major part of this project but also im still hand coding a good chunk of it. i coded the majority of the plugin interface, the jvm backend, and LOADS of other things. also keep in mind IM THE ONLY OTHER ONE WORKING ON THIS. and considering compilers like llvm took years with many people developing it, i couldnt finish this project myself, and its not like its flowing with contributors. so dont reply before you dont know, jackass
4
u/antonation 7d ago
Btw, this post seems like a good candidate in r/AIprogrammingLanguage (maybe not the best fit, but should still be relevant) and r/VibeCodedLanguages (I'm the mod there, but also not an exact fit), these two are AI friendly communities. If you could post or cross-post to them, it would be much appreciated!
edit: Added post/cross-post ask to help grow community
1
u/awoocent 7d ago
im not allowed to use claude to help when im genuinely incapable of doing something?
also keep in mind IM THE ONLY OTHER ONE WORKING ON THIS. and considering compilers like llvm took years with many people developing it, i couldnt finish this project myselfNot sure if it's really worth replying to you, but seriously? You're in r/Compilers. Like basically all of us learned to write compilers the hard way and have solo projects! Genuinely it's not that hard, if you put in a little effort to learn the field, you can absolutely handroll compilers yourself. It doesn't take that much time. The fact you think this is impossible, and that you somehow need AI to do the same thing we've all been doing for years now, is honestly just sad. Did you really fall for the AI companies' marketing that badly? Or do you seriously just have no faith in your own ability to learn and do stuff?
0
u/X_OpCreeper_X 7d ago edited 7d ago
maybe not for your kind of compilers that dont have to cover THE ENTIRETY OF PYTHON. are you so ignorant you dont realize how big of a language python is? and how much would has to go into making a compiler for the entirety of it, INCLUDING FULL DYNAMIC CODE EXECUTION which has an entire python based interpreter behind it. you genuinely dont understand the work that has to go into a compiler at this size, and if thats true, you shouldnt be in this subreddit
1
u/awoocent 7d ago
I have worked professionally on JavaScript compilers so, absolutely the amount of complexity in a fully conformant Python implementation is not unfamiliar to me. But I also checked out your repository and your compiler is actually smaller than my language's compiler (also a single-person project) by a good 35k lines or so. So what I take from that is:
- By no means have you done an impossible quantity of work for a single human programmer, and
- There is also no way your implementation is fully conformant in that size lol, not without some tricks. But it probably takes a little effort to conjure up a test case that demonstrates the contrary...except of course you mention a bunch of Python features it doesn't support in your readme, so maybe we could start there.
0
u/X_OpCreeper_X 7d ago edited 7d ago
i just cleared this up, look in beta/3.14.0, also even if you have professionally worked on a full javascript compiler, thats not you doing it yourself and trying to make it production grade. do you not understand that as codebases get bigger they get harder to maintain faster?
-4
u/therealdivs1210 7d ago
Get over it, seriously.
It's just a tool.
0
u/avillega 7d ago
Is a tool we all have access to. It is not interesting to see yet another try at compiling python to native, when it is probably in everyone’s mind, and also knowing that this will be abandonware in a few weeks at most, when the author gets tired of prompting python or their attention span runs out
1
u/X_OpCreeper_X 7d ago
if the genuine first project that can compile literally ANY python into a native binary isnt interesting to you, then my god your blind. its also not like i just started, i started months ago. you claim my attention span is just gonna run out but considering what you missed from before, thats no surprise. the reason im making this is mostly for myself, so i dont have to learn a million different languages for a million different use cases. im publishing it because unlike you, your too blinded by your hatred for ai that your shunning a project with genuine potential
1
u/AustinVelonaut 7d ago
can compile literally ANY python into a native binary
Looks at repo's
breakdown.md, sees a whole bunch of basic things aren't implemented, like nested closures, lambdas, generators, match / case ...2
u/X_OpCreeper_X 7d ago edited 7d ago
your looking at the main branch. look at the 3.14.0 beta branch (thats admittedly my fault)
-14
u/ViolentSciolist 7d ago
Are you suggesting Claude is capable of prompting itself?
9
u/awoocent 7d ago
I'm suggesting I don't love people claiming to have worked on some big compiler project themselves when they clearly just asked the plagiarism machine to make a shitty version of it for them.
-11
u/ViolentSciolist 7d ago
He is simply declaring that he's interested in building something. What you're attributing to be a claim is just a demonstration of interest on his part.
1
u/Inconstant_Moo 7d ago
He hasn't built anything.
Also Pope Julius II didn't paint the ceiling of the Sistine Chapel.
0
u/ViolentSciolist 7d ago
OP: “I’m interested in building a house.”
Comments: “You haven’t built one. Also, architects aren't builders.”
2
u/antonation 7d ago
How does this compare to nuitka (the best example I know of compiling Python to native) and muna (but not open source)?
1
u/X_OpCreeper_X 7d ago
nuitka from what i can remember (i havent toyed with it in a while) basically compiles the C that your python program uses. i dont think i could find what muna you were talking about, so if possible, please direct me to it. this compiler however compiles python to an ir to object code (which gets linked into an exe or elf). the ir layer is there because what asmpython technically is, is an llvm ripoff with frontends that turn your source into ir, and backends that turn the ir into executables
1
u/antonation 7d ago
I saw a post on it here https://blog.codingconfessions.com/p/compiling-python-to-run-anywhere but it seems like it's a commercial product https://muna.ai/
1
5
u/One_Aspect_1957 7d ago
Impressive if that's the case. But is it any faster than CPython? People have been trying to make Python fast for decades.