r/Compilers • u/imVynor • 6d ago
I'm making a programming language, need criticism
I've been trying to make a programming language for a while. I'm trying to make it in Rust. I made the basic language. The intended problem it is solving is making a simple language like Python but can run code really fast. The program itself will have native tensors. Will have CUDA/GPU backend. I made a clone of numpy embedded in the language. Now I'm developing a pytorch clone for the language. So, I would like to know what other problems you want me to solve in the language. The semantics are not finalised yet. So, I am definitely open to take some opinions.
1
u/shrimpster00 6d ago
if you're writing an interpreter, it's not going to be faster than python + numpy (or a cuda equivalent, I guess), and its api is already about as ergonomic as gets. even if you are writing an actual compiler, it's not the driver code that's taking the bulk of your performance: it's either gpu compute or shuffling data back & forth. if speed and built-in tensors are your design goals, your project doesn't bring much utility to this space. sorry.
if you're doing this as a learning exercise, go for it! but don't use ai! if you manage to write a compiler for programs that run cuda kernels, we would love to see it! but using ai to create "cupy but worse" is a waste of your time and mine.
there is one interesting advantage that you didn't mention, though: you can run native binaries on systems that don't have python or cupy or whatever else installed. running a program on a cluster is kind of a pain when you have to manage the right versions of all sorts of different dependencies.
1
u/TantraMantraYantra 6d ago
Simple like python in syntax, beats rust at safety, beats assembly at speed, C in binary size.
Design for that. Aim higher.
1
u/tiajuanat 6d ago
You should probably include a link to the spec and maybe a repo if you want feedback
8
u/Inconstant_Moo 6d ago
You're not the first person to think of that. Is there more to the idea?