Hacker News new | past | comments | ask | show | jobs | submit login

I'm using a lot of them in production right now, thanks to transpilers. Unfortunately not everything can work without the aid of a run-time, which is how Traceur works. At the moment i'm limiting myself to the features that don't require such a run-time.



Off the top of my head, features that are entirely syntactical transformations and don't need a runtime:

- Classes (except inheritance requires a tiny shim function)

- Destructuring (except destructuring iterators)

- Rest parameters

- Arrow functions

- Shorthand object literals

- Computed properties

- Template strings (although tagged template strings require a non-trivial amount of shimming to mimic)

- let and const (check correctness before transpiling, then compile to var. Transformation is non-trivial when inside loops, etc.)

- Modules

Features that do require a runtime / library:

- Iterators and generators

- Promises

- Symbols

- New ES6 methods on Object, Number, String, etc. (like Number.isNaN)


I think to use the more advanced features of modules, ie default exports, you do need a run-time.


Then why not use something like https://6to5.org/ ? Most syntax features can be transpiled without a runtime (generators being an exception) and everything else can simply use polyfills.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: