Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating programming languages and compiler designing. Are they related?

Alright, I guess this question has been asked a lot of times here.

I want to create a programming language, not necessarily starting today, but over a span of 2-3 yrs. I'm not a very good programmer, but I'm improving. What I wanted to ask is how closely creating a language and writing a compiler related?

Since, a compiler translates a language from one form into another, I guess it's all about writing a compiler for a particular piece of text. SO if I learn compiler design, will I be able to write my own programming language?

like image 720
Naruto Uzumaki Avatar asked Sep 11 '10 11:09

Naruto Uzumaki


People also ask

Is compiler related to programming?

A compiler is a special program that translates a programming language's source code into machine code, bytecode or another programming language. The source code is typically written in a high-level, human-readable language such as Java or C++.

What is programming language in compiler design?

This is known as Language Processing System. The high-level language is converted into binary language in various phases. A compiler is a program that converts high-level language to assembly language. Similarly, an assembler is a program that converts the assembly language to machine-level language.

Which programming languages use compiler?

Programming languages like JavaScript, Python, Ruby use interpreters. Programming languages like C, C++, Java use compilers.

Who creates a programming language?

The first computer programming language was created in 1883, when a woman named Ada Lovelace worked with Charles Babbage on his very early mechanical computer, the Analytical Engine.


1 Answers

You can design a programming language without knowing anything about implementing compilers, and vice versa. The language designer can write a specification for the language, and a compiler implementor can then take that and create the compiler.

However, if this is a personal project, then you will probably have to learn how to do both. A programming language for which there is no compiler is purely theoretical, and it is difficult to figure out how good a programming language is without writing and executing real programs with it. Even if you do find someone willing to implement the compiler for you, you might not want to have to wait for that person every time you have a new idea to try, so you will want to know how to do it yourself.

Implementing a compiler is a pretty advanced programming project, so if you are just getting started as a programmer, you have a steep learning curve ahead of you. You might want to start by looking at the tutorials and examples for LLVM, although that might not actually be a suitable compiler infrastructure for your language.

like image 108
Kristopher Johnson Avatar answered Oct 01 '22 16:10

Kristopher Johnson