2
$\begingroup$

What do I need to read in in order to :

  1. understand the specs of an already made programming language
  2. Design a programming language
  3. Design a compiler and assembler for that language
  4. make an architecture of a processor
$\endgroup$

closed as too broad by David Richerby, Luke Mathieson, Juho, Hoopje, Rick Decker Dec 29 '14 at 15:42

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ This is much too broad for a single question. The fourth point, in particular, is rather separate from the first three but even the first three should probably be separate questions. $\endgroup$ – David Richerby Dec 28 '14 at 22:18
  • $\begingroup$ @DavidRicherby The question is very meta-instructive. $\endgroup$ – babou Dec 28 '14 at 23:04
  • $\begingroup$ This escaped me on first reading: I read interpreter for assembler. Assembler has little to do with what is usually known as programming language. It allows you to write in so-called assembly language, which is binary machines instructio*ns with a thin layer of symbolic varnish to make it easier to use. You do not make assemblers for programming languages. You make compilers and interpreters, or a mix of both. You may want to make an assembler for an assembly language designed for the instruction set of a specific processor, though I read that some designers directly produce a C compiler. $\endgroup$ – babou Dec 28 '14 at 23:15
1
$\begingroup$

I know you mean, it is not an easy task, yet you can do it.

For point 1: You can do that by:

  1. Quick reading the documentation of the programming language you want to learn.
  2. Practice on the topics you want to get the maximum benefits of.
  3. Mainly all of the programming languages have a lot of common specs, you can map the language you want to learn to a language you already learned.
  4. From my experience, each programming language has its own uniqueness, the thing it is adding. I think you should focus on that spec of the language. Like C and pointers, Ruby on Rails and Meta Programming, ... etc

For point 2: Designing a programming language is not an easy task, you need to consider what your programming language will add, are what it adds already there in another programming language? Why people will use it? What is the problem your programming language will solve?.
If you answered all of the above questions, then let's move on to see wow are you going to make it.
There are a lot of online courses about programming language design.

  1. First of all the structure; will it use compiler or interpreter, will it have a virtual machine or it will will run natively on the OS, what will be the steps of building and running the code

  2. Does the programming language will be high level or low level or middle?

  3. Does it will be OOP or Structural programming, or a good mux like Scala?
  4. What will be the syntax like? How to terminate the line?
  5. Handling call by reference and call by value
  6. A lot of aspects remaining, honestly I don't know all of them...

For point 3: If you want to design a compiler, then there is a whole life out there, this science already settled, you will have to make the grammar tree and the dependency. You studied Assembler before, there is another course for compiler, it is basicly the same concept but it is harder because you will have grammar here.
Many many courses are out there specially for the purpose you want, just search with keyword compilers.

For point 4: This point is out of the above scope, it is on the other side, if you are concerned about creating a new programming language, then you shouldn't worry about the processor architecture unless your language is a low level programming language. Mainly, it is another track if you want to design your own architecture, there are many steps to design a processor's architecture:

  1. Thinking about the design itself, is it will be dual or single core, down this processes based on pipeline, ...etc.
  2. Drawing the design.
  3. Writing the design with one of hardware describing language like VHDL, Verilog.
  4. Synthes the design and make sure it will work
  5. Simulation phase
  6. Deploy the design on FPGA (There may be other boards...) This will allow you to test your design on hardware too not only software tests.
  7. You are done and you can start making the specific hardware for your design
  8. There are courses for this matter, you should first study architecture courses, then studying VLSI, people are pursuing master degree in the VLSI and how to design the architecture

I am not an expert in all of that, but I answered it from my humbled experiences, I hope I benefits you, if I have anything more, I will edit the answer to add it isA.
Please feel free to discuss anything with me.

$\endgroup$
1
$\begingroup$

I do not understand what is your intended meaning in "understand the specs of an already made programming language". There are always many things to be understood in a complex entity, and any understanding must be related to a purpose.

If your purpose is just to understand how to program with this language, understanding how it is implemented is not, and should not be your problem. Certainly not at first. What you have to understand is the high level concepts used in the language, and that may depend very much on the language. You need to understand the style of programming the language is promoting. All that comes to some extent with the manuals and tutorials. But some concepts may require advanced knowledge, some of which may be general, and some which may be very specific. What you should learn will be clear from the manuals and tutorials.

If you want general knowledge on language architecture, on the role of syntax and semantics, on the main techniques useful to write compilers and interpreters, you should get a book on compiler writing. Many will do. The most popular is probably the Dragon Book in one of its successive edition.

To design a programming language, there is no specific study, other than a good understanding of the structure and concepts used generally in programming languages (see above). A good knowledge of logic and mathematical style cannot hurt. Knowing many programming languages with preferably very different styles is probably a prerequisite. The hard part is knowing why you want to do it, and what for. A language is a vehicle for communication. Hence, if you are alone using it you are wasting your time (unless it is a proof of concept, which is usually related to some advanced theoretical work). You have to have a purpose for your language, and an idea that it is better for that purpose than other languages that may already exist. If you still have to read what is useful for designing it (other than general knowledge - see above), you are not ripe for designing one. The needed knowledge must precede the intent to design a language. It must be the expression of a need, before it becomes a will. Actually this is often true of creative activity.

Languages are not necessarily general purpose languages. They may be very useful without having Turing power. A language must be thought to express some concepts in a given domain of discourse. For example, languages like HTML, or TeX. are intended to express textual layout of documents. They can be very sophisticated, but not intended to write graph algorithms or matrix processing. Other languages may appear like weak algorithmic languages because they have been designed to posses specific properties that more general languages will not have, such as automatic analysis of their computational characteristics. Some languages may use specific kinds of parallel processing that are easier to analyze and optimize.`Some of these specific languages, or some features of more general languages require high mathematical sophistication in specific domains. Naming them here would just be name dropping.

Regarding processor architecture, I cannot help you. It is largely a different topic, though it does matter for some aspects of compiling, and I am not competent.

If you want to see an interpreter written in half a page, that implement a general purpose programming language that was actually used a lot (in more sophisticated versions, to be honest), look for the Lisp 1.5 interpreter. It is somewhere in this old book.

$\endgroup$
  • $\begingroup$ what is the prerequisites of reading this book .. i mean what books should i read first before reading this book ... starting from calculus and discrete structures .. do i need Automata and complexity .. formal languages etc ? what do i need ? $\endgroup$ – Eng_Boody Dec 28 '14 at 7:17
  • $\begingroup$ As I recall, the Dragon Book is pretty much self-contained (it is big). Some good experience in programming is probably a prerequisite. Some knowledge of elementary automata theory and basic algorithmics probably helps. It depends on your level of readings. Chapters on program optimization will require more knowledge of algorithms and graph theory. $\endgroup$ – babou Dec 28 '14 at 11:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.