Open ProfStick opened 4 years ago
@HunterDJ03 issues I found in the first section comparing interpreted and compilation
interpreted code executes line by line from top to bottom, translating as it goes, reading the intro paragraph seemed like it was translating line by line then executing the code.
"Users must also have an interpreter installed, which uses resources i.e. memory." While this is true most modern languages come with an interpreter pre installed, like python. Compiled languages such as C require users to source their own C compilers, they still need compilers just as interpreted languages need interpreters.
"Because the code will be in machine language, the code will be machine specific, which means the program will need to be recompiled using a compiler for the specific processor or OS." This is true only for OS, if you compile for windows it will work on any windows machine, same for OSX machines. The processor only applies when you are comparing x86, 32bit, 64bit etc
In your point about lexical analysis you dont actually mention that it generates tokens. Lexical analysis takes everything it encounters and turns them into tokens that the parser will understand.
"(I'm not quite sure which, but either the source code or the tokens is what's being 'parsed', it makes sense that it’s the tokens though)" tokens are what are parsed
Pretty good just a couple things to change here and there, also might want to mention the synchronous vs asynchronous nature of compiled vs interpreted and the advantages associated.
@tynanmatthews this is so close, can we close it today
@HunterDJ03 this sentence isn't really lexical analysis. Syntax errors are picked up in syntactical analysis. "Error messages may be produced by a lexical analysis as a result of incorrect syntax, naming, undeclared identifiers etc. This is because they don’t conform with the specific programming language's syntax." The analogy would be an english essay. Lexical analysis would make sure all the words and punctuation marks were actual 'english' words and punctuation, syntactical analysis would in the right way.
https://github.com/AuroraCollegeSDD/12SDD_Course_Information_v2/wiki/9.2.3-Implementation-of-software-solution#the-need-for-translation-to-machine-code-from-source-code
Students learn about:
• translation methods in software solutions including: – compilation – interpretation • advantages and disadvantages of each method • steps in the translation process – lexical analysis including token generation – syntactical analysis including parsing – code generation
Students learn to:
• explain the use of tokens and the role of the parsing process during the translation of source code to machine code • recognise that machine code is the only code able to be executed by a computer • identify the most appropriate translation method for a given situation • use the features of both a compiler and an interpreter in the implementation of a software solution