웹어셈블리

웹에서 기계어를 컴파일하기 위한 포터블 효율 바이트코드 포맷

웹어셈블리(WebAssembly, 간단히 Wasm)는 실행 프로그램 및 그와 일치하는 텍스트 어셈블리어, 그리고 이러한 프로그램과 호스트 환경 간 통신을 용이케하는 인터페이스를 위한 이식 가능한 이진 코드 포맷을 정의하는 개방형 표준이다.[1][2][3][4] 웹어셈블리의 주 목적은 웹 페이지에서 고성능의 애플리케이션을 가능케 하는 것이지만 포맷은 다른 환경에서도 실행 및 연동되도록 설계되어 있다.[5][6]

웹어셈블리
패러다임명령형, 구조적, 식 지향
설계자W3C
개발자
발표일2017년 3월(7년 전)(2017-03)
자료형 체계정적
라이선스아파치 라이선스
파일 확장자
  • .wat
  • .wasm
웹사이트webassembly.org
영향을 받은 언어

Wasm은 자바스크립트를 대체하지는 않는다. 브라우저에서 Wasm을 사용하려면 사용자는 Emscripten SDK를 사용하여 C++(또는 D 또는 러스트 등의 기타 LLVM 지원 언어) 소스 코드를 이진 파일로 컴파일한 다음 동일한 샌드박스에서 일반 자바스크립트 코드로 실행할 수 있다.[note 1] Emscripten은 WebGL 등 흔히 사용되는 여러 환경 인터페이스들의 바인딩을 제공한다. 확장 가능한 메모리와 수많은 스케일러 값에만 접근이 가능하다. 문서 객체 모델(DOM) 직접 접근은 하지 않으나 이를 위한 프록시 함수를 만들 수 있다. (예를 들면 stdweb,[11] web_sys,[12], js_sys을 통해)[13]

W3C모질라, 마이크로소프트, 구글, 애플의 기여와 함께 표준을 관리하고 있다.[14]

2019년 6월 Technische Universität Braunschweig의 연구에 따르면 알렉사 최상위 100만 개의 웹사이트에서의 웹어셈블리 사용률 분석 결과 가장 현저하게 사용되고 있는 부분은 악성 가상 화폐 채굴이었음이 드러났다.[15][16][17]

역사 편집

웹어셈블리는 2015년 처음 발표되었으며,[18] 첫 시연은 유니티의 앵그리 봇(Angry Bots)을 모질라 파이어폭스[19] 구글 크롬,[20] 마이크로소프트 엣지에서 실행하는 것이었다.[21] 선도자격 기술은 모질라, 구글 네이티브 클라이언트Asm.js이었으며[22][23] 최초 구현체는 asm.js의 기능 집합에 기반을 두었다.[24]

참고 문헌 편집

내용주 편집

  1. According to official documentation the Emscripten SDK may be used to create .wasm files which then may be executed in web browser.[7][8][9] Emscripten이 클랭 사용 시 다양한 언어를 사용할 수 있으나 일부 문제가 발생할 수 있다.[10]

각주 편집

  1. “Introduction — WebAssembly 1.0”. 《webassembly.github.io》. 2019년 6월 18일에 확인함. WebAssembly is an open standard... 
  2. “Introduction — WebAssembly 1.0”. 《webassembly.github.io》. 2019년 6월 18일에 확인함. WebAssembly is a ... code format 
  3. “Conventions — WebAssembly 1.0”. 《webassembly.github.io》. 2019년 5월 17일에 확인함. WebAssembly is a programming language that has multiple concrete representations (its binary format and the text format). Both map to a common structure. 
  4. “Introduction — WebAssembly 1.0”. 《webassembly.github.io》. 2019년 6월 18일에 확인함. ... this specification is complemented by additional documents defining interfaces to specific embedding environments such as the Web. These will each define a WebAssembly application programming interface (API) suitable for a given environment. 
  5. “WebAssembly Specification Release 1.0 (Draft, last updated Apr 16, 2019): Introduction”. 《webassembly.org》. 2019년 5월 6일에 확인함. Its main goal is to enable high performance applications on the Web, but it does not make any Web-specific assumptions or provide Web-specific features, so it can be employed in other environments as well. 
  6. Haas, Andreas; Rossberg, Andreas; Schuff, Derek L.; Titzer, Ben L.; Holman, Michael; Gohman, Dan; Wagner, Luke; Zakai, Alon; Bastien, JF (2017년 6월 14일). “Bringing the Web Up to Speed with WebAssembly”. 《SIGPLAN Notices》 52 (6): 185–200. doi:10.1145/3140587.3062363. ISSN 0362-1340. While the Web is the primary motivation for WebAssembly, nothing in its design depends on the Web or a JavaScript environment. It is an open standard specifically designed for embedding in multiple contexts, and we expect that stand-alone implementations will become available in the future. 
  7. “Developer’s Guide - WebAssembly”. 《webassembly.org》. 2019년 6월 10일에 확인함. 
  8. “Compiling a New C/C++ Module to WebAssembly”. 《MDN Web Docs》 (영어). 2019년 6월 10일에 확인함. 
  9. “Building to WebAssembly — Emscripten 1.38.33 documentation”. 《emscripten.org》. 2019년 6월 10일에 확인함. 
  10. “Emscripting a C library to Wasm | Web”. 《Google Developers》 (영어). 2019년 6월 10일에 확인함. 
  11. “stdweb - Rust”. 《docs.rs》. 2019년 6월 5일에 확인함. The goal of this crate is to provide Rust bindings to the Web APIs and to allow a high degree of interoperability between Rust and JavaScript. 
  12. “web_sys - Rust”. 《docs.rs》. 2019년 6월 5일에 확인함. Raw API bindings for Web APIs. This is a procedurally generated crate from browser WebIDL which provides a binding to all APIs that browser provide on the web. 
  13. “js_sys - Rust”. 《docs.rs》. 2019년 6월 5일에 확인함. Bindings to JavaScript's standard, built-in objects, including their methods and properties. 
  14. Bright, Peter (2015년 6월 18일). “The Web is getting its bytecode: WebAssembly”. 《Ars Technica》. Condé Nast. 
  15. “Recent Study Estimates That 50% of Websites Using WebAssembly Apply It for Malicious Purposes”. 《InfoQ》. 2019년 11월 3일에 확인함. 
  16. “보관된 사본” (PDF). 2019년 10월 21일에 원본 문서 (PDF)에서 보존된 문서. 2019년 11월 9일에 확인함. 
  17. “보관된 사본” (PDF). 2019년 11월 3일에 원본 문서 (PDF)에서 보존된 문서. 2019년 11월 9일에 확인함. 
  18. “Launch bug”. 《GitHub / WebAssembly / design》. 2015년 6월 11일. 
  19. Wagner, Luke (2016년 3월 14일). “A WebAssembly Milestone: Experimental Support in Multiple Browsers”. 《Mozilla Hacks》. 
  20. Thompson, Seth (2016년 3월 15일). “Experimental support for WebAssembly in V8”. 《V8 Blog》. 
  21. Zhu, Limin (2016년 3월 15일). “Previewing WebAssembly experiments in Microsoft Edge”. 《Microsoft Edge dev blog》. 
  22. Lardinois, Frederic (2015년 6월 17일). “Google, Microsoft, Mozilla And Others Team Up To Launch WebAssembly, A New Binary Format For The Web”. 《TechCrunch》 (영어). 2017년 12월 24일에 확인함. 
  23. Avram, Abel (2017년 5월 31일). “Google Is to Remove Support for PNaCl”. 《InfoQ》. 2017년 12월 22일에 확인함. 
  24. “WebAssembly: a binary format for the web”. 《②ality – JavaScript and more》. 2015년 6월 18일. 

데모 편집

외부 링크 편집