DEV Community

Cover image for Designing A Programming Language
Eli
Eli

Posted on

Designing A Programming Language

Hello

I recently created a post about how a lexer and parser works... this is a continuation of that post.

Starting

When writing a programming language, you want to establish the grammar first. It is the most important part of the language. You might be thinking: "But what about the code?? That is the most hardest part of the programming language!!"
At a time, I did think that too. But I realized, once I started coding it right away, without establishing the full grammar, I got lost and didn't know what to do. That is why you establish the grammar first.

What will the grammar be like?? Will it be like ruby and rust? Julia and Haskell? What do you think? What is something you really want in programming? Take that, and put it in your language. Do you want a built in file-encrypt function? Will the print be a macro or function? These are all questions you have to ask yourself before actually creating a programming language.

The biggest part: The design Goal. The design goal is a goal that you want your programming language to achieve. Will it target machine learning or Data Science? Will it target something unique that you made up?
The design goal really is the biggest part. It determines what kinda of people you are targeting. It determines whether the language is useful or not. I mean, sometimes it is fun to make a language for general purposes, but you will lose interest(coming from the experience)

:)

I hope you use this information well, and happy coding.

Top comments (0)