Questions about programs that read code in one language (source language) and translate it into an equivalent program in another language (target language).

A compiler is a program that transforms source code written in a programming language (the source language) into another language (the target language).

Example: A C++ compiler transforms your C++ code into equivalent Assembly Language or Machine Code.

A rough sketch of working of compilers

Source Program (or Code) → Compiler → Target Program (or executable code)


Compilers are more generally used to translate high-level code (like C#, C++, Java) into low level or machine code.

history | excerpt history
{"cc_re__cc_re__cc_by_sa_3_0": ["<li class=\"-item\"><a href=\"https://www.facebook.com/officialstackoverflow/\" class=\"-link\">Facebook</a></li>\r\n                    <li class=\"-item\"><a href=\"https://twitter.com/stackoverflow\" class=\"-link\">Twitter</a></li>\r\n                    <li class=\"-item\"><a href=\"https://linkedin.com/company/stack-overflow\" class=\"-link\">LinkedIn</a></li>\r\n                </ul>\r\n\r\n                <p class=\"mt-auto mb24\">\r\nsite design / logo &#169; 2019 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a>\r\n                            with <a href=\"https://stackoverflow.blog/2009/06/25/attribution-required/\" rel=\"license\">attribution required</a>.\r\n                    <span id=\"svnrev\">rev&nbsp;2019.7.23.34400</span>\r\n                </p>\r\n            </div>\r\n        </div>\r\n\r\n            </footer>\r\n            <script>StackExchange.ready(function () { StackExchange.responsiveness.addSwitcher(); })</script>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Computer Science Stack"], "copyright__copyright__copyright": [" a program that transforms source code written in a programming language (the source language) into another language (the target language).\n\nExample: A C++ compiler transforms your C++ code into equivalent Assembly Language or Machine Code.\n\nA rough sketch of working of compilers\n\nSource Program (or Code) \u2192 Compiler \u2192 Target Program (or executable code)\n\n\nCompilers are more generally used to translate high-level code (like C#, C++, Java) into low level or machine code.\n\nhistory | excerpt history"]}