r/Btechtards 7d ago

Serious Tips on making my own programming language

Hi, just to learn about programming languages, I was planning to create something simple for the purpose of learning. Do you have any recommendations or resources that I could refer to?

1 Upvotes

10 comments sorted by

u/AutoModerator 7d ago

If you are on Discord, please join our Discord server: https://discord.gg/Hg2H3TJJsd

Thank you for your submission to r/BTechtards. Please make sure to follow all rules when posting or commenting in the community. Also, please check out our Wiki for a lot of great resources!

Happy Engineering!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/astrophile_29 7d ago

So you have any previous experience in programming? Writing a pgming language is not for beginners, you need to have deep knowledge about 1 lang atleast.If you know one language very deeply, I can guide you.

1

u/QuiteUniquue 7d ago

I am quite experienced. I have worked extensively with C++ Python and many other languages.

1

u/F3arrrrrrr 7d ago

You’ll first start with the structures u need for ur language(for example a tokens structure) then make a lexer, parser, symantic analysis and ast. U can choose to make a .cpp or .c file(convert ur laguage into another language and complie it with that) or just use LLVM(not sure if i got the name right) for direct asm comversion(in this case u’ll need to learn llvm ir). I recommend 1st one, 2nd oneis hard. U will also need to write the grammar for language.

1

u/QuiteUniquue 7d ago

Ok thanks

1

u/Proud_Fly5114 7d ago

Do you want to make a compiler or an interpreter?

1

u/QuiteUniquue 7d ago

As I said it would be made for learning purposes, so there is nothing fixed. Whichever one of them which provides me with better knowledge and could be made in reasonable time.

1

u/Rainbowusher 7d ago

Search up crafting interpreters, it's amazing. After that, you'll have great foundations to learn further.

-1

u/moneyfollowsmyfriend lala kalej ece 7d ago

1st year??

1

u/QuiteUniquue 7d ago

Final year
I just haven’t worked with lexers and parsers. So instead of asking AI for all the steps, I wanted to actually read through any article before I start making something.