{"id":152,"date":"2022-05-10T18:08:49","date_gmt":"2022-05-10T17:08:49","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/?page_id=152"},"modified":"2024-06-20T11:09:13","modified_gmt":"2024-06-20T10:09:13","slug":"translators","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/translators\/","title":{"rendered":"Translators"},"content":{"rendered":"<h2 style=\"color: red\"><b><span data-contrast=\"none\">Machine Code<\/span><\/b><\/h2>\n<p><span data-contrast=\"none\">Machine code is an example of a low level language.\u00a0 Machine code is the computer\u2019s own language it just consists of 1\u2019s and 0\u2019s.\u00a0<\/span><\/p>\n<h2 style=\"color: red\"><b><span data-contrast=\"none\">High Level Language<\/span><\/b><\/h2>\n<p><span data-contrast=\"none\">Python and Java are examples of high level languages. Each high level language has been designed for a purpose<\/span><\/p>\n<p><span data-contrast=\"none\">Programs written in a high level language are easier to read, write and understand since they use commands which are closer to English<\/span><\/p>\n<p><span data-contrast=\"none\">Programs written in a high level language are very portable because they can be easily changed so that they can work on different types of computers<\/span><\/p>\n<h2 style=\"color: red\"><b><span data-contrast=\"none\">Comparisons<\/span><\/b><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-156\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10181521\/Screenshot-2022-05-10-181443-300x127.png\" alt=\"\" width=\"600\" height=\"254\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10181521\/Screenshot-2022-05-10-181443-300x127.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10181521\/Screenshot-2022-05-10-181443-1024x433.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10181521\/Screenshot-2022-05-10-181443-768x324.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10181521\/Screenshot-2022-05-10-181443-624x264.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10181521\/Screenshot-2022-05-10-181443.png 1212w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"color: red\">Translators<\/h2>\n<p><span data-contrast=\"none\">Humans understand high level languages and computers understand low level languages.<\/span><\/p>\n<p><strong>A translator converts high level language commands into Binary.<\/strong><\/p>\n<p><span data-contrast=\"none\">There are two types of translators:<\/span><\/p>\n<ul>\n<li><span data-contrast=\"none\">Interpreters<\/span><\/li>\n<li><span data-contrast=\"none\">Compilers<\/span><\/li>\n<\/ul>\n<h2 style=\"color: red\">An Interpreter<\/h2>\n<p><span class=\"TextRun SCXO111088066 BCX8\" lang=\"EN-GB\" xml:lang=\"EN-GB\" data-contrast=\"none\"><span class=\"NormalTextRun SCXO111088066 BCX8\">As the program is running, the interpreter takes one line of code at a time and translate it into a low level code.<\/span><\/span><span class=\"EOP SCXO111088066 BCX8\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-162\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182058\/Screenshot-2022-05-10-182012-300x191.png\" alt=\"\" width=\"799\" height=\"509\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182058\/Screenshot-2022-05-10-182012-300x191.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182058\/Screenshot-2022-05-10-182012-768x490.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182058\/Screenshot-2022-05-10-182012-624x398.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182058\/Screenshot-2022-05-10-182012.png 1000w\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" \/><\/p>\n<p><b><span data-contrast=\"none\">Advantages of using an interpreter are:<\/span><\/b><\/p>\n<ul style=\"font-weight: 400\">\n<li data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"none\">Don\u2019t have to leave the editing environment when implementing a solution<\/span><\/li>\n<li data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">Position of errors in code identified during test run<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"none\">Disadvantages of using an interpreter are:<\/span><\/b><\/p>\n<ul style=\"font-weight: 400\">\n<li data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"none\">Increased processing is required since each program instruction needs to be translated every time it is run (so program will run more slowly)<\/span><\/li>\n<li data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"none\">Loops are translated multiple times<\/span><\/li>\n<li data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"none\">Additional RAM is required (since the interpreter needs to be in RAM)\u00a0<\/span><\/li>\n<\/ul>\n<h2 style=\"color: red\">A <span data-contrast=\"none\">Compiler<\/span><\/h2>\n<p><span class=\"TextRun SCXO178286815 BCX8\" lang=\"EN-GB\" xml:lang=\"EN-GB\" data-contrast=\"none\"><span class=\"NormalTextRun SCXO178286815 BCX8\">A compiler works by converting the program source code and converting it into object code before the program is run.<\/span><\/span><span class=\"EOP SCXO178286815 BCX8\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-163\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182352\/Screenshot-2022-05-10-182319-300x173.png\" alt=\"\" width=\"727\" height=\"419\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182352\/Screenshot-2022-05-10-182319-300x173.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182352\/Screenshot-2022-05-10-182319-1024x589.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182352\/Screenshot-2022-05-10-182319-768x442.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182352\/Screenshot-2022-05-10-182319-624x359.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182352\/Screenshot-2022-05-10-182319.png 1046w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/p>\n<ul style=\"font-weight: 400\">\n<li data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"none\">Source Code \u2013 is the original high level language program<\/span><\/li>\n<li data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">Object code \u2013 is the machine code program that has been translated<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"none\">Advantages of using a compiler are:<\/span><\/b><\/p>\n<ul style=\"font-weight: 400\">\n<li data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"none\">the compiled code runs faster (since it is already in machine code)\u00a0<\/span><\/li>\n<li data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"none\">code is only translated once<\/span><\/li>\n<li data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"none\">compiled code cannot be edited<\/span><\/li>\n<li data-aria-posinset=\"6\" data-aria-level=\"1\"><span data-contrast=\"none\">compiled code requires less memory to execute<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"none\">A disadvantage of using a compiler is:<\/span><\/b><\/p>\n<ul style=\"font-weight: 400\">\n<li data-aria-posinset=\"7\" data-aria-level=\"1\"><span data-contrast=\"none\">that when you type in the program code, you don\u2019t know if you have made a mistake until you compile it at the end<\/span><\/li>\n<\/ul>\n<h2 style=\"color: red\">Comparisons<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-164\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182720\/Screenshot-2022-05-10-182656-300x159.png\" alt=\"\" width=\"843\" height=\"447\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182720\/Screenshot-2022-05-10-182656-300x159.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182720\/Screenshot-2022-05-10-182656-1024x542.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182720\/Screenshot-2022-05-10-182656-768x407.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182720\/Screenshot-2022-05-10-182656-624x331.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/10182720\/Screenshot-2022-05-10-182656.png 1210w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Machine Code Machine code is an example of a low level language.\u00a0 Machine code is the computer\u2019s own language it just consists of 1\u2019s and 0\u2019s.\u00a0 High Level Language Python and Java are examples of high level languages. Each high level language has been designed for a purpose Programs written in a high level language [&hellip;]<\/p>\n","protected":false},"author":79984,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-152","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/users\/79984"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/comments?post=152"}],"version-history":[{"count":10,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/152\/revisions"}],"predecessor-version":[{"id":598,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/152\/revisions\/598"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/media?parent=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}