New Programming Language in sinhala(srilanka) language

Can i create a new programming language based on my mother language(sinhala-srilanka).if can please help me to create my new programming languge.please tell me how should i do it.

This is an interesting and hard question to solve, but i will try to answer.

  1. What is a programming language?

The first thing you have to do is to search “programming language” in a search engine and probably the first result will be wikipedia: https://en.wikipedia.org/wiki/Programming_language. This will give you a “basic” explanation of what is it.

  1. Learn a programming language!

Several languages are implemented on C or C++ and others are bootstrapped. A lot of compilers are written in C because that’s what a lot of people know best, but that doesn’t mean the all compilers must be written C or assembler. Using a higher-level language will probably make the task a lot easier. So you have to choose one and become a masterfull developer of it. 

  1. Rules, Compiler and Interpreter

Writing a language basically means defining a set of rules for your language, or describing the specifications for your language. To let the computer understand this rules you need to create a interpreter or a compiler for your language. A compiler (even the interpreter) is just another program. It reads in a bunch of text and emits either another text file or a binary file of machine code. The difference between this two is: an interpreter runs the program as it’s translating, a compiler just translates the code without executing it. The big parts of the compiler are:

  • A lexer, which breaks your source text into tokens (literals, identifiers, punctuators, etc.);
  • A parser, which takes those tokens and matches them to the language grammar;
  • A code generator, which emits the target code based on results from the parser.

I will not go into too much detail.

This book probably explain better then me the question: Language Implementation Patterns or How to create pragmatic, lightweight languages.

Or you can follow this “little” guide on this github repository: ftomassetti/LangSandbox.

Hope this help

-Gabriele-

References:

3 Likes

great advice.thank you so much sir.

1 Like