Source-to-source compilers

Source-to-source compiler

A source-to-source translator, source-to-source compiler (S2S compiler), transcompiler, or transpiler is a type of translator that takes the source code of a program written in a programming language as its input and produces an equivalent source code in the same or a different programming language. A source-to-source translator converts between programming languages that operate at approximately the same level of abstraction, while a traditional compiler translates from a higher level programming language to a lower level programming language. For example, a source-to-source translator may perform a translation of a program from Python to JavaScript, while a traditional compiler translates from a language like C to assembler or Java to bytecode. An automatic parallelizing compiler will frequently take in a high level language program as an input and then transform the code and annotate it with parallel code annotations (e.g., OpenMP) or language constructs (e.g. Fortran's forall statements). Another purpose of source-to-source-compiling is translating legacy code to use the next version of the underlying programming language or an API that breaks backward compatibility. It will perform automatic code refactoring which is useful when the programs to refactor are outside the control of the original implementer (for example, converting programs from Python 2 to Python 3, or converting programs from an old API to the new API) or when the size of the program makes it impractical or time-consuming to refactor it by hand. Transcompilers may either keep translated code structure as close to the source code as possible to ease development and debugging of the original source code or may change the structure of the original code so much that the translated code does not look like the source code. There are also debugging utilities that map the transcompiled source code back to the original code; for example, the JavaScript Source Map standard allows mapping of the JavaScript code executed by a web browser back to the original source when the JavaScript code was, for example, minified or produced by a transcompiled-to-JavaScript language. Examples include Closure Compiler, CoffeeScript, Dart, Haxe, , TypeScript and Emscripten. (Wikipedia).

Video thumbnail

Defining Target Machines — How to Create a Compiler part 5b/5 — Data oriented programming

In this tool-assisted education video series I create a compiler in C++ for a B-like programming language. In this episode we write code that defines the target platforms that the compiler is going to target. This is part of a multi-episode series. Become a member: https://youtube.com/Bi

From playlist Creating a Compiler

Video thumbnail

Compiler Design lecture 1-- Introduction and various phases of compiler

Click for free access to Educator's best classes: : https://www.unacademy.com/a/Best-Classes-of-all-time-by-Vishvadeep-Gothi-CS.html For regular updates follow : https://unacademy.com/community/Q3ZGJY/ To purchase please click : https://unacademy.onelink.me/081J/zv9co3u1

From playlist Compiler Design

Video thumbnail

Open Source vs. Closed Source Software

In this video, you’ll learn more about the differences between open-source software and closed-source software. Visit https://edu.gcfglobal.org/en/basic-computer-skills/ for more technology, software, and computer tips. We hope you enjoy!

From playlist Technology Trends

Video thumbnail

The Wolfram Compiler

The Wolfram Compiler converts Wolfram Language code into native machine instructions that run directly on the machine hardware. It offers a powerful way to speed up programs and provides many opportunities for innovative programming features such as building connections to external librari

From playlist Wolfram Technology Conference 2022

Video thumbnail

Optimizing Trees — How to Create a Compiler part 2/5 — Simple optimizations to a program in an AST

In this tool-assisted education video series I create a compiler in C++ for a B-like programming language. In this episode we deal with simple optimization techniques like constant folding and dead code elimination, and also look into ways to simplify the internal representation of the cod

From playlist Creating a Compiler

Video thumbnail

The Wolfram Compiler

The Wolfram Compiler is a long-term project for the compilation of Wolfram Language programs. It converts Wolfram Language into native machine code and provides a faster execution path as well as many opportunities for innovative programming features. It is used for an increasing amount of

From playlist Wolfram Technology Conference 2021

Video thumbnail

Overview of compiling a program

Compiling a program takes place over several stages. This video is an overview of the compilation process: scanner/lexer, parser, semantic analyzer, code generator, and optimizer. An introduction to token streams and abstract syntax trees.

From playlist Discrete Structures

Video thumbnail

Compilation - Part One: Overview of the Stages of Compilation

This is part one of a series of videos about compilation. As you will see when you watch this series, compilation involves a diverse range of themes in the field of computer science including high and low level programming paradigms, the definition of context free grammars, the application

From playlist Compilation

Video thumbnail

What Is CPython? | Introduction To CPython | CPython For Beginners | Learn CPython | Simplilearn

The video will introduce you to CPython and let you know whether Python is interpreted or compiled language. This tutorial will take you through the history of CPython and you will learn about the basics of the source code of CPython. Further, you will learn the working of CPython and why

From playlist 🔥Python | Python Tutorial For Beginners | Python Projects | Python Interview Questions And Answers | Updated Python Playlist 2023 | Simplilearn

Video thumbnail

the C language (part 5 of 5)

Introduction to the C programming language. Part of a larger series teaching programming. See http://codeschool.org

From playlist The C language

Video thumbnail

O'Reilly Webcast: Getting the iPhone Open Source Tool Chain

In this webcast, Jonathan A. Zdziarski, one of the original hackers of the iPhone and author of iPhone Open Application Development will demonstrate how you can use the iPhone open source tool chain to design third-party software that will run on this popular device. Jonathan will demonstr

From playlist iPhone - Hacking, Development, Forensics, Tool Chain

Video thumbnail

25c3: Vulnerability discovery in encrypted closed source PHP applications

Speaker: Stefan Esser Security audits of PHP applications are usually performed on a source code basis. However sometimes vendors protect their source code by encrypting their applications with runtime (bytecode-)encryptors. When these tools are used source code analysis is no longer poss

From playlist 25C3: Nothing to hide

Video thumbnail

Programming Languages - (part 2 of 7)

How source code becomes a running program, how languages are categorized, and a survey of important languages. Part of a larger series teaching programming. Visit http://codeschool.org

From playlist Programming Languages

Video thumbnail

Computer Basics 18: How Source Code works

http://FreeCodeCamp.com is a community of busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community. Follow us on twitter: https://twitter.com/intent/user?screen

From playlist Computer Science and Software Engineering Theory with Briana

Video thumbnail

Compilation - Part Two: Lexical Analysis

This is part two of a series of videos about compilation. Part two is about lexical analysis, also known as tokenization. It explains how the lexical analyser, otherwise known as the lexer, or the scanner, identifies the individual elements of a source program known as lexemes, which are

From playlist Compilation

Video thumbnail

Creating an Application in Scala - Scala for Beginners Tutorial

Learn how to create an application in Scala. For more free lessons, visit http://oreil.ly/2aZFvln. In this video, expert video trainer Daniel Hinojosa will teach you how to create an app in Scala. He also explains the difference between compiling and interpreting source code.

From playlist Scala

Video thumbnail

Compilation - Part Four: Intermediate Code

This is part four of a series of videos about compilation. Part four is about an intermediate representation of source programs that some compilers generate known as intermediate code. The video focuses on a form of intermediate code known as Three Address Code (TAC). You will see the g

From playlist Compilation

Video thumbnail

Three-Address Code — How to Create a Compiler part 3/5 — Converting AST into statement-based IR

In this tool-assisted education video series I create a compiler in C++ for a B-like programming language. In this episode the program code is converted from a tree structure into a list of statements — a tree-address code — much like assembler, but still a more abstract form. This is par

From playlist Creating a Compiler

Related pages

ECMAScript | Emscripten | Lua (programming language) | Eiffel (programming language) | Optimizing compiler | CoffeeScript | Clojure | Haxe | LLVM | Vala (programming language) | TypeScript | Dart (programming language) | HipHop for PHP