GithubHelp home page GithubHelp logo

rcoh / swc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swc-project/swc

0.0 2.0 0.0 1.63 MB

Super-fast alternative for babel written in rust

Home Page: https://swc-project.github.io/rustdoc/swc/

License: Apache License 2.0

Rust 34.98% Shell 0.04% JavaScript 64.98%

swc's Introduction

speedy web compiler

Build Status codecov


Make the web (development) faster.

swc is rust port of babel and closure compiler.

Installation

Currently this requires nightly version of rust.

npm i -D swc

or

yarn add --dev swc

Features

Transforms

New generation javascript to old-days javascript.

  • es3

    • member-expression-literals
    • property-literals
    • reserved-words
  • es5

    • property-mutators
  • es2015

    • arrow-functions
    • block-scoped-functions
    • block-scoping
      • Note: this might be buggy (at this time)
    • classes
    • computed-properties
    • destructuring
    • duplicate-keys
    • for-of
    • function-name
    • instanceof
    • literals
    • new-target
    • object-super
    • parameters
    • shorthand-properties
    • spread
    • sticky regex (y flag)
    • template-literals
      • invalid escape sequences inside tagged template literals. (aka es2018)
    • typeof-symbol
    • unicode-regex
  • es2016

    • exponentiation-operator
  • es2017

    • async-to-generator
  • es2018

    • async-generator-functions
    • dotall-regex
    • object-rest-spread
    • optional-catch-binding
    • unicode-property-regex

Performance

The benchmarks were run on Macbook pro, dual core, 2.3GHz Intel Core i5, 16 GB ram

performance
swc (ffi) 1,086 ops/sec ±0.77% (84 runs sampled)
swc-optimize (ffi) 1,060 ops/sec ±0.63% (87 runs sampled)
swc (ffi, simd) 1,295 ops/sec ±0.87% (89 runs sampled)
swc-optimize (ffi, simd) 1,270 ops/sec ±0.24% (89 runs sampled)
babel 65.72 ops/sec ±6.45% (62 runs sampled)

Contributing

See CONTRIBUTING.md. You may also find the architecture documentation useful (ARCHITECTURE.md).

License

swc is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

swc's People

Contributors

bors[bot] avatar kdy1 avatar viktor-ku avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.