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

How can nodejs v5 make us of ES6 modules?

I'm writing some Javascript which runs on node, and makes use of modules in node_modules. Some of these happen to be in ES6. Unfortunately I've learned that my JS will be deployed on node v5. So I transpiled it to ES5 with a quick babel src-dir…
ukosteopath
  • 443
  • 7
  • 14
0
votes
1 answer

How do I get tanh in jsweet?

I am using JSweet to transpile Java into Javascript and I need to use Math.tanh() but it's not available in the jsweet.lang.Math object, but I see it in the…
Kristopher Ives
  • 5,838
  • 7
  • 42
  • 67
0
votes
0 answers

TypeScript output file doesn't get updated after transpilation

I downloaded this seed for an Angular & TypeScript project. I updated the ts files and then transpiled it with no errors, but the output file doesn't get updated. tsconfig: { "compilerOptions": { "module": "commonjs", "target":…
Alon
  • 10,381
  • 23
  • 88
  • 152
0
votes
1 answer

Angular code difference between source code and debugger code

I have an angular 2 service in which I have this line : transformedObjects.push(new MyObject(myObject.x, myObject._id)); When I use debugger in Chrome Dev tool and follow the process I see this line transformedObjects.push(new…
0
votes
1 answer

Babel failing to compile es6 angular factory

I'm pretty new at es6, but I've been doing angular for a while now. I do not understand why the below code doesn't transpile by Babel. Test it yourself by pasting into https://babeljs.io/. The error is that it expects a ( at the start of the const…
Brian
  • 435
  • 1
  • 5
  • 10
0
votes
2 answers

Is there any feature of ES 6 which can not be converted into ES 5 equivalent by any transpiler like Babel?

Various transpilers are offering utilities to convert your ES6 code to ES5. Though ES6 involves lot of sugar coating features over ES5 but is there any feature of ES6 which can not be transpiled to ES5?
Ashutosh
  • 69
  • 1
  • 6
0
votes
1 answer

babel-node gives import error when only when writing to file

The purpose of this whole exercise is to run ES2015 javascript in the browser. I have a test setup like this: foo.js: export class Foo {} main.js: import {Foo} from './foo'; console.log('ready') Finally I have also a .babelrc file: { …
Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
0
votes
1 answer

Creating libraries that can be imported and used in Groovy

Currently, I am working on a project to transpile from my company's in house scripting language, which is Object Orientated and takes quite a few features from other languages, into Groovy, which has many similar features. To keep code as close to…
rhysvo
  • 38
  • 6
0
votes
1 answer

Ionic 2 in pure JS (No Transpile. No TS. No more waiting for debug)

I'm a Ionic v1 developer and since the launch of Ionic 2 I've started to be excited with the features and performance. But the TS approach is not my side. I decided to learn Angular 2 following the ES methods and everything ok. But trying to move…
0
votes
1 answer

Transpiling to C vs C++ : range of CPU instructions

I am considering the question of transpiling a language (home-grown DSL) to C vs to C++. I haven't done any 'native' programming for over 15 years, so I want to check my assumptions. Am I right into assuming that transpiling to the newest C++…
Sebastien Diot
  • 7,183
  • 6
  • 43
  • 85
0
votes
1 answer

Typescript project setup (first time)

First off, I didn't see a clear answer after hours of googling, sorry if I overlooked something. Quick version With Typescript how can I move node_modules to outDir or am I going about things the wrong way? Long version I'm trying to get started…
Steven Bayer
  • 1,847
  • 4
  • 15
  • 16
0
votes
2 answers

Parsing Hack code into Abstract Syntax Tree

I would like my Hack code to be broken down to Abstract Syntax Tree. Please advise me on available tools/libraries/github repositories which will help me to parse Hack code into AST. I have found "h2tp" (hack to php transpiler written by Facebook),…
0
votes
0 answers

Using array.prototype.includes in angular 2 template

I'm using angular cli. I don't really understand whether I can use array.prototype.includes in my angular html template code. If I try using array.prototype.includes in my .ts code, the typescript compiler throw an error message Property 'includes'…
David
  • 33,444
  • 11
  • 80
  • 118
0
votes
0 answers

Can't transpile es6; import declaration error

I've ready many questions and articles on the subject, but nothing seems to work. My error is this: SyntaxError: import declarations may only appear at top level of a module It's a result of me being unable to properly transpile es6 code. Here's my…
0
votes
1 answer

Is this statement about functional programming languages correct?

I was reading a book on Compiler Design and there's a part in it which says, The main difference in the compilers of different languages is concerned with the code generated by them. In general, it can be said that the compilers for imperative and…