Questions tagged [transpiler]

A transpiler is a compiler that translates the source code of one high-level programming language to the source code of another high-level programming language.

Transpilers are also known as compilers.

429 questions
213
votes
8 answers

Compiling vs Transpiling

While searching about the difference, I came across these definitions: Compiling is the general term for taking source code written in one language and transforming into another. Transpiling is a specific term for taking source code written in one…
Nishi Mahto
  • 2,261
  • 2
  • 10
  • 6
140
votes
14 answers

Extending Error in Javascript with ES6 syntax & Babel

I am trying to extend Error with ES6 and Babel. It isn't working out. class MyError extends Error { constructor(m) { super(m); } } var error = new Error("ll"); var myerror = new MyError("ll"); console.log(error.message) //shows up…
Karel Bílek
  • 36,467
  • 31
  • 94
  • 149
133
votes
3 answers

What is target in tsconfig.json for?

What does target in tsconfig.json signify? { "compilerOptions": { "sourceMap": true, "target": "es5", "module": "commonjs", "jsx": "react", "moduleResolution": "classic", "lib": [ "es2015", "dom", "es2017" ] } }
Ankit Raonka
  • 6,429
  • 10
  • 35
  • 54
110
votes
9 answers

Maintain src/ folder structure when building to dist/ folder with TypeScript 3

I have a TypeScript nodejs server with this structure: tsconfig.json package.json src/ middleware/ utils/ index.ts dist/ middleware/ utils/ index.js When using TypeScript 2, I was able to transpile my project from the src/…
nfadili
  • 1,232
  • 2
  • 8
  • 9
65
votes
7 answers

Compiler vs Interpreter vs Transpiler

During a ReactJS session that I was attending, the presenter used a term transpiler for some code conversion/porting happening. In the past, I have heard the terms compiler and interpreter. I've used in the context of converting a user written…
RBT
  • 24,161
  • 21
  • 159
  • 240
30
votes
2 answers

What is the main difference between a Compiler and a Transpiler?

What are the main differences between a Compiler and a Transpiler? Please could you provide some examples of both?
Dawlatzai Ghousi
  • 3,780
  • 2
  • 20
  • 26
30
votes
3 answers

Webpack with babel-loader not recognizing import keyword

I have this webpack.config.js: module.exports = { entry: './src/admin/client/index.jsx', output: { filename: './src/admin/client/static/js/app.js' }, loaders: [ { test: /\.jsx?$/, loader: 'babel', exclude:…
Jacob
  • 77,566
  • 24
  • 149
  • 228
29
votes
3 answers

Do I really need Babel or other transpilers to use ES6 with React?

Do I really need Babel or other transpilers to use ES6 in React? I was looking at the chart https://kangax.github.io/compat-table/es6/ Seems like my current browser Chrome (latest stable version) supports almost all the ES6 features... If I can use…
user3463521
  • 572
  • 2
  • 7
  • 16
27
votes
1 answer

Running a python function in BigQuery

Would it be possible to run a python function in BigQuery? It seems like C can be compiled to WebAssembly and run in BQ, per this blog post from Felipe. And of course Python can be compiled to C or C++ using cython or some other tools (or it could…
David542
  • 104,438
  • 178
  • 489
  • 842
25
votes
3 answers

How do I use ES6 (ES2015) in a ruby on rails app?

I have a 4.2 rails app and am considering slowly converting the JS to ES6. Right now I'm using the standard rails manifest file from the asset pipeline to pre-process my js. I'm not sure how to go about starting to use ES6 (adding a transpile step)…
pixelearth
  • 13,674
  • 10
  • 62
  • 110
19
votes
1 answer

Typescript tsconfig to exclude some source files

I am trying to get Typescript to exclude certain files when compiling. However it doesn't seem to want to exclude them. Here is my tsconfig.json { "ref": "master", "path": "typings", "compilerOptions": { "module": "amd", "target":…
Nicholas Mordecai
  • 859
  • 2
  • 12
  • 33
19
votes
2 answers

What will Typescript transpile when targeting ES5 / ES3?

I'm trying to understand when the Typescript compiler will transpile code to make it compatible with my specified target ECMAScript version (ES5 or ES3). For example, TSC will transpile for(var int of intArray) fine, but it doesn't transpile…
JoshMB
  • 990
  • 1
  • 8
  • 14
18
votes
2 answers

How to write a Typescript plugin?

Are there any docs / examples of writing a Typescript plugin? For the last time I am very inspired with the idea of bringing Typescript into my projects. However, currently I see this is not possible because of my failed attempts to find any docs…
James Akwuh
  • 2,169
  • 1
  • 23
  • 25
17
votes
6 answers

prolog to SQL converter

Without thinking to much, it seems to me that a large set of Prolog's functionality could be implemented as relational calculus (a.k.a. SQL). Has anyone heard of any tools to automatically convert Prolog to SQL?
BCS
  • 75,627
  • 68
  • 187
  • 294
17
votes
6 answers

Converting Python Code to PHP

Is there a software converter out there that can automatically convert this python code to PHP? #!/usr/bin/python import math def calcNumEntropyBits(s): if len(s) <= 0: return 0.0 symCount = {} for c in s: if…
Kirk Ouimet
  • 27,280
  • 43
  • 127
  • 177
1
2 3
28 29