JA1. Programming Languages¶
Statement¶
The Learning Journal is a tool for self-reflection on the learning process. In addition to completing directed tasks, you should use the Learning Journal to document your activities, record problems you may have encountered and to draft answers for Discussion Forums and Assignments. The Learning Journal should be updated regularly (on a weekly basis), as the learning journals will be assessed by your instructor as part of your Final Grade.
1. Describe what you did, You need to describe what you did and how you did it¶
As usual, I started the week by trying some of the self quizzes which gave me an insight about what to expect. I then read the reading assignments, answered the discussions questions and here I am writing the learning journal. The topic of this week was about the first step of creating a programming language, which is by defining its rules and preparing its compiler.
The compiler part can not be separated from the language itself as without a compiler we would not be able to generate executable from the source code, thus the language can not be run and thus, we don’t have a programming language. The compiler is the one that translates the source code into machine code that can be executed by the machine.
2. Describe your reactions to what you did¶
I enjoyed the reading assignments as it was very informative but very long also, and the video lectures took for ever to finish. I have to admit that the language of the chapter is pretty complicated but I was able to understand the main ideas and apply them correctly in the discussion questions.
3. Describe any feedback you received or any specific interactions you had. Discuss how they were helpful¶
I did not receive any feedback yet, but I am looking forward to it.
4. Describe your feelings and attitudes¶
The compiler was always a scary topic for me, and I was always thinking that its complexity is beyond my understanding and that I will never be able to understand it. But after reading the chapter and watching the video lectures, I realized that it is not that complicated and that I can understand it if I put some effort into it. The complication actually originates from the high number of possibilities to conform with the rules of the language.
5. Describe what you learned¶
I learned about Backus-Naur Form (BNF) which is a notation technique for context-free grammars, and it is used to describe the syntax of programming languages. I also learned about the compiler and its different phases, and how it translates the source code into machine code. We also talked about the BNF components in depth: Terminal, Non-terminal symbols, Production rules, Start symbol.
We also learn about the difference between compliers and interpreters and the various steps that both compiler and interpreter use to convert source code into machine code: Lexical Analysis, Syntax Analysis, Semantic Analysis, Intermediate Code Generation, Code Optimization, Code Generation. Some compiler skip the intermediate code generation and code optimization steps.
We also learned about type checking, the different characteristics of type systems: dynamic vs static, strong vs weak, and the definition and types of virtual machine models. We also learned about the different components of programming language environments: editor, compiler, linker, loader, debugger, testing tools, configuration management tools, and other tools.
6. What surprised me or caused me to wonder?¶
I was surprised how simple it is to translate a single simple statement into machine code, but then as soon as the program grows up a little bit, the complexity of the compiler increases exponentially. I was also surprised by the number of tools that are used in the programming language environment, and how they are all connected together to produce the final executable.
7. What happened that felt particularly challenging? Why was it challenging to me?¶
The most challenging part was interpreting complex BNF rules, to detect their meaning and what statements do conform with them. I also found it challenging to understand the different types of Virtual machines and their relationships to the compiler and programming language as a whole.
8. What skills and knowledge do I recognize that I am gaining?¶
I am gaining the understanding of how programming languages work and why they behave a certain way. My favorite language -which is the one that I’m using in my job- is JavaScript (NodeJs), so I looked up the EBNF of Javascript and read a little bit about it and saw some source code of small compiler projects written in Javascript.
9. What am I realizing about myself as a learner?¶
I am realizing that I am enjoying the topic, and this week has helped me to understand the topics of last week better. I also changed the way that I take notes as it was very slow last week and I will try it for one more week to see if it is better or not.
10. In what ways am I able to apply the ideas and concepts gained to my own experience?¶
I hope that I will be able to apply the knowledge about static/dynamic and strong/weak type systems to my work, as I am working with a dynamically typed language (JavaScript) and its superset (Typescript) which was always confused me as the TypeScript compiler never emits any code that relates to typing, and I was always wondering how it works.
11. Describe one important thing that you are thinking about in relation to the activity¶
I am thinking of building an open source little language and compiler for my own training and to help others to understand the topic better. I hope that I will find the time to do it.