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
10
votes
3 answers

Is there a fully functional paradigm language that transpiles to JavaScript?

Is there a language which transpiles to JavaScript (like TypeScript, CoffeScript etc.) and is almost purely functional (like Haskell, Erlang, F#)? I know there are libraries which helps maintain immutability (Underscore), and there are a lot of…
godzsa
  • 2,105
  • 4
  • 34
  • 56
9
votes
3 answers

Neural Networks For Generating New Programming Language Grammars

I have recently had the need to create an ANTLR language grammar for the purpose of a transpiler (Converting one scripting language to another). It occurs to me that Google Translate does a pretty good job translating natural language. We have all…
9
votes
1 answer

Which version of JavaScript should I compile to?

Let's say I'm writing a NodeJS project with a language that compiles to JavaScript, like TypeScript for example. With TypeScript (or other things that use Babel) I have the option to compile my code to any version of JavaScript, be it ES3, ES5, ES6,…
Griffort
  • 1,174
  • 1
  • 10
  • 26
9
votes
1 answer

SyntaxError: Unexpected token export

I'm working on a npm package called foobar, locally, to allow me to make changes or modifications in real time without having to publish/unpublish to improve development time and sanity. In projectTest, I have linked foobar by using the command npm…
punkbit
  • 7,347
  • 10
  • 55
  • 89
8
votes
1 answer

How does jest allow mutation of modules?

In this question that I asked here: Why does mutating a module update the reference if calling that module from another module, but not if calling from itself? I'm asking about the nature of module mutation. However as it it turns out, ES6 modules…
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
8
votes
1 answer

gulp-babel don't produce any output file or doesn't work properly

I'm working on a JS library and I want to transpile all javascript code written in ES6 to ES5 standard to get more support in current browsers. The thing is I want to use Babel with the Gulp tasks, so I've installed all this NPM packages…
Yulio Aleman Jimenez
  • 1,642
  • 3
  • 17
  • 33
8
votes
2 answers

Using babel, how can I append some code to the top of every file?

My goal is to fake out getting some requirejs code working via babel. I've found that if I add the following: if (typeof define !== "function") { var define = require("amdefine")(module); } to the top of every file while running in nodejs things…
Parris
  • 17,833
  • 17
  • 90
  • 133
7
votes
3 answers

How to transpile python Compare ast nodes to c?

Let's start by considering python3.8.5's grammar, in this case I'm interested to figure out how to transpile python Comparisons to c. For the sake of simplicity, let's assume we're dealing with a very little python trivial subset and we just want to…
BPL
  • 9,632
  • 9
  • 59
  • 117
7
votes
1 answer

How does mocha / babel transpile my test code on the fly?

My question is not about why something is not working, but rather why it is. Yes. I have a small nodeJS command line tool, which contains features that nodeJS does not yet support out of the box, most notably: import statements…
Frank N
  • 9,625
  • 4
  • 80
  • 110
7
votes
0 answers

Javascript View Original (Non-sourced mapped) Source Files?

I have a JavaScript application which uses source mapping. i.e., there are .map files serving for each of the .js files. (It's probably not relevant but specifically I transpile .jsx and ES6 to ES5 via Babel). In Chrome Dev Tools the source maps…
Chris W.
  • 37,583
  • 36
  • 99
  • 136
7
votes
1 answer

Typescript Compiler - Bundling external libraries

I've being trying to bundle my TypeScript "application" into a single javascript file. I'm not using any bundler but TSC ( using TypeScript 2.2 ). Aside of my own ts files, my application also uses external modules such immutablejs. I read every…
7
votes
1 answer

Transpiling ES6 to ES5 online with Babel

As you can see here I want to transpile following code from ES6 to ES5 and use as presets "es2015": let myString = "Whatever"; let myStringArray = Array.from (myString); console.log (myStringArray); As you know there is no "Array.from" method in…
user3025289
7
votes
2 answers

Type Error - Is Not a Constructor

Wanted to instantiate a module within ES6 javascript and transpile to ES5. I am setting up a new class in my project which is es6 / webpack. I have 2 files: track.js which has the following -- export default class Track { constructor() { …
Yasir
  • 879
  • 5
  • 13
  • 31
7
votes
2 answers

import / export in ES6 Transpilers

This is not a duplicate of below questions which is dealing with browser specific questions. I'm expecting an answer whether import / export will work in Client side or not. ECMA 6 Not working although experimental js is enabled how export…
Venkat.R
  • 7,420
  • 5
  • 42
  • 63
7
votes
2 answers

Java to C cross compilation

Does anyone know of a good Java to C cross compiler? Do they work well?
Martin Damrau
  • 87
  • 1
  • 1
  • 2
1 2
3
28 29