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
17
votes
1 answer

Prolog systems in Javascript

Javascript seems to become popular as an implementation language for other programming languages. The article Lightweight compilation of (C)LP to JavaScript. ICLP 2012 drew my attention on this. There are a lot of proof-of-concept prototypes for…
false
  • 10,264
  • 13
  • 101
  • 209
16
votes
1 answer

How can I publish an NPM module with both commonjs and es6 versions?

I have a module I want to publish to npm. I have found some "solutions" that are 4+ years old, examples using babel 5.x, and other problems that made the examples not work as shown. Ideally I want to write my code using es6 and build/transpile with…
Sir Robert
  • 4,686
  • 7
  • 41
  • 57
16
votes
0 answers

Type safe RPC call example from GHCJS client to Yesod/Snap/Servant

I have two, related questions about RPC call to Yesod/Snap/Servant: Say I have a function on the server, written in Haskell, compiled by GHC: add x y = x+y+42 How can: I call this function from the client (the client is also written in Haskell,…
jhegedus
  • 20,244
  • 16
  • 99
  • 167
15
votes
3 answers

Running Mocha 6 ES6 tests with Babel 7, how to set up?

For a library written in ES6/7, I want to compile (to ES5) the library to a dist/ folder. I also want to run the tests (written in ES6/7) for this lib. My dev dependencies look like this (package.json): "devDependencies": { "@babel/cli":…
miphe
  • 1,763
  • 1
  • 20
  • 33
15
votes
4 answers

What is the difference between preprocessor and transpiler?

What is the difference between preprocessors and transpilers (or transcompilers)? I already found the difference between compiler and transpiler, when searching for the answer. For example CSS preprocessors (Sass, Less) and JS transpilers…
Chris
  • 151
  • 2
  • 4
15
votes
2 answers

TypeScript via tsc command: Output to single file without concatenation

Is there a way of compiling single .ts file to different directory? The only way from the manual command of compilation to different directory is via --out command, but it also does concatenation of dependent files, which I don't want: --out…
Vojtěch
  • 11,312
  • 31
  • 103
  • 173
13
votes
2 answers

Babel creates output directory but doesn't transpile any files

I am trying to transpile a project that uses ES6 syntax and TypeScript. I have a directory structure like this: ├── .babelrc ├── src    ├── index.ts    └── pitching    ├── pitching.test.ts    └── pitching.ts I would like to compile…
elethan
  • 16,408
  • 8
  • 64
  • 87
13
votes
3 answers

How do I type check a snippet of TypeScript code in memory?

I'm implementing TypeScript support into my application Data-Forge Notebook. I need to compile, type check and evaluate snippets of TypeScript code. Compilation appears to be no problem, I'm using transpileModule as shown below to convert a snippet…
12
votes
1 answer

How to use Babel without Webpack

I'm making an electron.js using React. I'm using JSX so need to use Babel to transpile. Many tutorials out there all suggests using Webpack. Currently, I'm using Webpack 4. Here is my webpack.config.js const path = require('path') module.exports =…
onmyway133
  • 45,645
  • 31
  • 257
  • 263
11
votes
1 answer

Compile webassembly to native executable

Are there any tools (yet) which can compile a wasm module to a native executable (eg. an ELF or .exe file)? Something like emscripten but in reverse. Failing that, is there any other way to run webassembly outside of a browser?
Shum
  • 1,236
  • 9
  • 22
11
votes
1 answer

Can I make TypeScript include node_modules for transpilation?

OK so I have an interesting situation in setting up my Node.js TypeScript project. I want to be able to refer to my local modules using a non-relative require reference. The way TypeScript and Node.js look up modules is to look for a node_modules…
Jez
  • 27,951
  • 32
  • 136
  • 233
11
votes
2 answers

Using Webpack To Transpile ES6 as separate files

Is it possible to configure webpack to do the equivalent of: babel src --watch --out-dir lib So that a directory structure that looks like this: - src - alpha - beta.js - charlie - delta.js - echo.js - foxtrot - golf …
Undistraction
  • 42,754
  • 56
  • 195
  • 331
11
votes
4 answers

Swift to JavaScript transpiler - possible?

As an iOS developer coding in Swift, I find it increasingly annoying to have to coordinate the same code written in Swift with front-end developers coding in JavaScript. It would be much neater to implement common functionality in one place and then…
stuffy
  • 113
  • 1
  • 1
  • 4
11
votes
2 answers

looking for transpiler: php to javascript

i wonder, if there's any transpiler available, which converts (simple) php code to javascript? what i am not looking for is ajax stuff or javascript libraries imitating php functionality, but i am looking for a translater, which is able to generate…
aurora
  • 9,607
  • 7
  • 36
  • 54
10
votes
3 answers

React saids Minified React error even it is development mode

I'm using browserify and babel to transpile & bundle my script. The problem is when I'm using React 16, it gives me this error message: Uncaught Error: Minified React error #200; visit…
modernator
  • 4,341
  • 12
  • 47
  • 76
1
2
3
28 29