How To Create My Own Programming Language And A Compiler For It

Comments · 329 Views

I am proficient in programming and have come across languages ​​such as BASIC, FORTRAN, COBOL, LISP, LOGO, Java, C ++, C, MATLAB, Mathematica, Python, Ruby, Perl, JavaScript, Assembly and so on.

 I don't understand how people create programming languages ​​and design compilers for it. I also couldn't understand how people create OS like Windows, Mac, UNIX, DOS etc and Professional Resume Writing Services . The other thing that is mysterious to me is the way people create libraries like OpenGL, OpenCL, OpenCV, Cocoa, MFC and so on. The last thing I can't figure out is how scientists design an assembly language and assembler for a microprocessor. I would really love to learn all of these things and I am 15 years old. I

I've read Aho's Compiler Design and Tanenbaum OS Concept Book before and they all only talk about concepts and code at a high level. They don't go into the details and nuances of how to design a compiler or an operating system. I want a concrete understanding so that I can create one myself and not just an understanding of what a thread, semaphore, process, or analysis is. I asked my brother all of this. He's an SB student in EECS at MIT and doesn't have a clue how to actually create all of these things in the real world. All he knows is just an understanding of the design of the compiler and the operating system. concepts like the ones you mentioned (i.e. like threading, synchronization, concurrency and buy argumentative essays online.




Basically your question is "how are computer chips, instruction sets, operating systems, languages, libraries, and applications designed and implemented?" It is a multi-billion dollar global industry that employs millions of people, many of whom are specialists. You may want to focus your question a bit more.

Having said that, I can try to:

I don't understand how people create programming languages ​​and design compilers for it.

It's surprising to me, but a lot of people think of programming languages ​​as magic. When I meet people at parties or whatever, if they ask me what I'm doing, I tell them that I design programming languages ​​and implement compilers and tools, and it's surprising how many times - professional programmers, you think - say "wow, I never thought of it, but yeah, someone has to design these things". It's as if they think languages ​​are just popping up fully formed with a tool infrastructure around them already.

They don't just appear. Languages ​​are designed like any other product: by carefully making a series of compromises between competing possibilities. Compilers and tools are built like any other professional software: breaking down the problem, writing one line of code at a time, and then testing the heck of the resulting program.

Language design is a huge topic. If you are interested in designing a language, a good place to start is to think about the shortcomings of a language you already know. Design decisions often arise from examining a design flaw in another product.

You can also consider an area that interests you, and then design a domain-specific language (DSL) that specifies solutions to problems in that area. You mentioned LOGO; this is a great example of DSL for the "line art" domain. Regular expressions are a DSL for the "find pattern in string" domain. LINQ in C # / VB is a DSL for the "filter, join, sort and project data" domain. HTML is a DSL for the domain "describe the layout of text on a page", etc. There are many areas that lend themselves to language-based solutions. One of my favorites is Inform7, which is a DSL for the "text-based adventure game" domain; vs' is probably the highest level serious programming language I have ever seen. Pick an area that you know something about and think about how to use language to describe problems and solutions in that area.

Once you've sketched out what you want your language to look like, try writing down precisely what the rules are for determining what a legal and illegal program is and buy thesis online. Typically, you'll want to do this at three levels:

  1. lexical : what are the rules for words in the language, which characters are legal, what the numbers look like, etc.
  2. syntactic : how do the words of the language combine into larger units? In C #, larger units contain expressions, statements, methods, classes, etc.
  3. semantics : given a syntactically legal program, how do you determine what the program does ?

Write down these rules as precisely as possible . If you do a good job, you can use it as a basis for writing a compiler or an interpreter. Take a look at the C # specification or the ECMAScript specification to see what I mean; they're full of very specific rules that describe what makes a legal program and how to understand what you're doing.

One of the best ways to start writing a compiler is to write a high level language compiler to a high level language and essay writing. Write a compiler that takes strings in your language and spits out strings in C # or JavaScript or whatever language you know; let the compiler for that language take care of the heavy task of turning it into executable code.

Resume Writing World

 

Comments