r/Compilers 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.

0 Upvotes

11 comments sorted by

8

u/Inconstant_Moo 6d ago

The intended problem it is solving is making a simple language like Python but can run code really fast.

You're not the first person to think of that. Is there more to the idea?

1

u/imVynor 6d ago

i thought of using native tensor operations built inside the compiler. its like a programming language to design machine learning solutions and projects.

1

u/StrikingClub3866 5d ago

Literally just Mojo

2

u/Timzhy0 6d ago

you may be interested in checking out Mojo for ideas and inspiration

1

u/imVynor 5d ago

Yeah sureee. Thanks!

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/imVynor 6d ago

Really thanks for the feedback. i always thought that the language and api is the barrier to python's speed. This really helped. This is my first big project in compiler design. So, i am hoping i'll get a really good experience designing it

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/imVynor 6d ago

yeah suree

1

u/tiajuanat 6d ago

You should probably include a link to the spec and maybe a repo if you want feedback

1

u/imVynor 6d ago

Some features are still incomplete and under work. so the code is not public as of now. so i thought this is the right time to add more features that are really useful to the users and contributors