Giter VIP home page Giter VIP logo

Comments (1)

sbyeol3 avatar sbyeol3 commented on August 23, 2024

SWC와 웹 개발의 미래

강동윤님, Vercel

  • ECMAScript6 + Babel의 영향으로 웹 프로젝트 빌드의 개념이 강해짐
  • React, JSX의 등장 > 브라우저가 이해할 수 있는 코드로 바꾸어주어야 함 (트랜스파일링)
  • 빌드라는 작업은 CPU를 많이 쓰는 작업, Nodejs는 이벤트 루프 기반이므로 CPU를 많이 쓰는 작업ㅇ 맞지 않음
  • 성능은 컴파일러가 어떻게 얼마나 최적화하는지가 중요
  • Babel은 JS로 만들어졌기 때문에 JS의 제약도 그래도 적용 > 1개의 CPU 코어만 사용
    • 트랜스파일링하는 동안 자바스크립트 스레드는 다른 일들을 할 수 없음

언어를 바꾸자

SWC (Speedy Web Compiler)

  • Rust로 작성됨, 여러 웹 빌드 툴을 대체하는 것이 목적
  • 왜 Rust인가? 제일 중요한 성능! 성능에 영향을 끼치는 건 언어설정, 병렬처리를 위한 Rust는 FFI 편의성이 좋음, 여러 언어가 섞이는 경우 GC가 없는 것이 오히려 편해짐. 제너릭이 있고 proc macro(코드 유틸리티)가 있음

SWC 기능

transform

  • babel과 비슷하지만 자바스크립트 코드와 다른 스레드에서 돌아감
  • stage3 이상의 기능은 다 포팅
  • 타입스크립트, 데코레이터, JSX 지원

minify

  • terser와 비슷한 압축률로 성능이 좋음

from articles.

Related Issues (20)

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.