{{위키데이터 속성 추적}}
{{Infobox programming language
| title = 웹어셈블리
| logo = WebAssembly Logo.svg
| logo caption = 
| screenshot = <!-- (filename) -->
| screenshot caption = 
| paradigm = [[명령형 프로그래밍|명령형]], [[구조적 프로그래밍|구조적]], [[식 지향 프로그래밍 언어|식 지향]]
| family = 
| released = {{시작 날짜와 나이|2017|3}}
| designer = [[W3C|W3C]]
| developer = {{기호없는 목록|[[W3C|W3C]]|[[모질라]]|[[마이크로소프트]]|[[구글]]|[[애플|Apple]]}}
| latest release version = 
| latest release date = 
| typing = [[자료형 체계|정적]]
| scope = 
| implementations = 
| dialects = 
| influenced by = {{Hlist|[[Asm.js]]|[[구글 네이티브 클라이언트|PNaCl]]}}
| influenced = 
| programming language = 
| license = [[아파치 라이선스]]
| file extensions = {{기호없는 목록|.wat|.wasm}}
| file format = <!-- or: | file formats = -->
}}

'''웹어셈블리'''(WebAssembly, 간단히 '''Wasm''')는 [[실행 파일|실행 프로그램]] 및 그와 일치하는 텍스트 [[어셈블리어]], 그리고 이러한 프로그램과 호스트 환경 간 통신을 용이케하는 인터페이스를 위한 [[소프트웨어 이식|이식 가능한]] [[이진 코드]] 포맷을 정의하는 [[개방형 표준]]이다.<ref>{{웹 인용|url=https://webassembly.github.io/spec/core/intro/introduction.html|title=Introduction — WebAssembly 1.0|website=webassembly.github.io|access-date=2019-06-18|quote=WebAssembly is an open standard...}}</ref><ref>{{웹 인용|url=https://webassembly.github.io/spec/core/intro/introduction.html|title=Introduction — WebAssembly 1.0|website=webassembly.github.io|access-date=2019-06-18|quote=WebAssembly is a ... code format}}</ref><ref name=":0">{{웹 인용|url=https://webassembly.github.io/spec/core/syntax/conventions.html|title=Conventions — WebAssembly 1.0|website=webassembly.github.io|access-date=2019-05-17|quote=WebAssembly is a programming language that has multiple concrete representations (its binary format and the text format). Both map to a common structure.}}</ref><ref>{{웹 인용|url=https://webassembly.github.io/spec/core/intro/introduction.html|title=Introduction — WebAssembly 1.0|website=webassembly.github.io|access-date=2019-06-18|quote=... 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.}}</ref> 웹어셈블리의 주 목적은 [[웹 페이지]]에서 고성능의 애플리케이션을 가능케 하는 것이지만 포맷은 다른 환경에서도 실행 및 연동되도록 설계되어 있다.<ref>{{웹 인용|url=https://webassembly.github.io/spec/core/intro/introduction.html|title=WebAssembly Specification Release 1.0 (Draft, last updated Apr 16, 2019): Introduction|website=webassembly.org|access-date=2019-05-06|quote=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.}}</ref><ref>{{저널 인용|last=Haas|first=Andreas|last2=Rossberg|first2=Andreas|last3=Schuff|first3=Derek L.|last4=Titzer|first4=Ben L.|last5=Holman|first5=Michael|last6=Gohman|first6=Dan|last7=Wagner|first7=Luke|last8=Zakai|first8=Alon|last9=Bastien|first9=JF|date=2017-06-14|title=Bringing the Web Up to Speed with WebAssembly|url=https://doi.acm.org/10.1145/3140587.3062363|journal=SIGPLAN Notices|volume=52|issue=6|pages=185–200|doi=10.1145/3140587.3062363|issn=0362-1340|quote=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.|via=}}</ref>

Wasm은 [[자바스크립트]]를 대체하지는 않는다. 브라우저에서 Wasm을 사용하려면 사용자는 [[Emscripten|Emscripten SDK]]를 사용하여 C++(또는 [[D (프로그래밍 언어)|D]] 또는 [[러스트 (프로그래밍 언어)|러스트]] 등의 기타 [[LLVM]] 지원 언어) 소스 코드를 이진 파일로 컴파일한 다음 동일한 [[샌드박스]]에서 일반 자바스크립트 코드로 실행할 수 있다.{{Refn|group=note|According to official documentation the Emscripten SDK may be used to create <code>.wasm</code> files which then may be executed in web browser.<ref>{{웹 인용|url=https://webassembly.org/getting-started/developers-guide/|title=Developer’s Guide - WebAssembly|website=webassembly.org|access-date=2019-06-10}}</ref><ref>{{웹 인용|url=https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm|title=Compiling a New C/C++ Module to WebAssembly|website=MDN Web Docs|language=en|access-date=2019-06-10}}</ref><ref>{{웹 인용|url=https://emscripten.org/docs/compiling/WebAssembly.html|title=Building to WebAssembly — Emscripten 1.38.33 documentation|website=emscripten.org|access-date=2019-06-10}}</ref> Emscripten이 [[클랭]] 사용 시 다양한 언어를 사용할 수 있으나 일부 문제가 발생할 수 있다.<ref>{{웹 인용|url=https://developers.google.com/web/updates/2018/03/emscripting-a-c-library|title=Emscripting a C library to Wasm {{!}} Web|website=Google Developers|language=en|access-date=2019-06-10}}</ref>}} Emscripten은 [[WebGL]] 등 흔히 사용되는 여러 환경 인터페이스들의 바인딩을 제공한다. 확장 가능한 메모리와 수많은 스케일러 값에만 접근이 가능하다. [[문서 객체 모델]](DOM) 직접 접근은 하지 않으나 이를 위한 프록시 함수를 만들 수 있다. (예를 들면 stdweb,<ref>{{웹 인용|url=https://docs.rs/stdweb/*/stdweb/|title=stdweb - Rust|website=docs.rs|access-date=2019-06-05|quote=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.}}</ref> web_sys,<ref>{{웹 인용|url=https://docs.rs/web-sys/*/web_sys/|title=web_sys - Rust|website=docs.rs|access-date=2019-06-05|quote=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.}}</ref>, js_sys을 통해)<ref>{{웹 인용|url=https://docs.rs/js-sys/*/js_sys/|title=js_sys - Rust|website=docs.rs|access-date=2019-06-05|quote=Bindings to JavaScript's standard, built-in objects, including their methods and properties.}}</ref>

[[W3C]]는 [[모질라]], [[마이크로소프트]], [[구글]], [[애플]]의 기여와 함께 표준을 관리하고 있다.<ref name="ars">{{웹 인용|first=Peter |last=Bright |url=https://arstechnica.com/information-technology/2015/06/the-web-is-getting-its-bytecode-webassembly/|title=The Web is getting its bytecode: WebAssembly|work=[[Ars Technica]] |publisher=[[Condé Nast]] |date=18 June 2015}}</ref>

2019년 6월 Technische Universität Braunschweig의 연구에 따르면 알렉사 최상위 100만 개의 웹사이트에서의 웹어셈블리 사용률 분석 결과 가장 현저하게 사용되고 있는 부분은 악성 [[암호화폐|가상 화폐 채굴]]이었음이 드러났다.<ref>{{웹 인용|url=https://www.infoq.com/news/2019/10/WebAssembly-wasm-malicious-usage/|title=Recent Study Estimates That 50% of Websites Using WebAssembly Apply It for Malicious Purposes|website=InfoQ|access-date=2019-11-03}}</ref><ref>{{웹 인용 |url=https://www.tu-braunschweig.de/Medien-DB/ias/pubs/2019-dimva.pdf |제목=보관된 사본 |확인날짜=2019-11-09 |보존url=https://web.archive.org/web/20191021021025/https://www.tu-braunschweig.de/Medien-DB/ias/pubs/2019-dimva.pdf |보존날짜=2019-10-21 |url-status=dead }}</ref><ref>{{웹 인용 |url=https://www.dimva2019.org/wp-content/uploads/sites/31/2019/06/DIMVA19-slides-2-R.pdf |제목=보관된 사본 |확인날짜=2019-11-09 |archive-date=2019-11-03 |archive-url=https://web.archive.org/web/20191103054140/https://www.dimva2019.org/wp-content/uploads/sites/31/2019/06/DIMVA19-slides-2-R.pdf |url-status= }}</ref>

== 역사 ==
웹어셈블리는 2015년 처음 발표되었으며,<ref name="Launch bug">{{웹 인용|url=https://github.com/WebAssembly/design/issues/150|title=Launch bug|date=11 June 2015|website=[[GitHub]] / WebAssembly / design}}</ref> 첫 시연은 [[유니티 (게임 엔진)|유니티]]의 앵그리 봇(Angry Bots)을 [[모질라 파이어폭스]]<ref name="Unity in Firefox">{{웹 인용|url=https://hacks.mozilla.org/2016/03/a-webassembly-milestone/|title=A WebAssembly Milestone: Experimental Support in Multiple Browsers|last=Wagner|first=Luke|date=14 March 2016|website=Mozilla Hacks}}</ref> [[구글 크롬]],<ref name="V8 blog">{{웹 인용|url=https://v8project.blogspot.com/2016/03/experimental-support-for-webassembly.html|title=Experimental support for WebAssembly in V8|last=Thompson|first=Seth|date=15 March 2016|website=V8 Blog}}</ref> [[마이크로소프트 엣지]]에서 실행하는 것이었다.<ref name="Edge">{{웹 인용|url=https://blogs.windows.com/msedgedev/2016/03/15/previewing-webassembly-experiments/|title=Previewing WebAssembly experiments in Microsoft Edge|last=Zhu|first=Limin|date=15 March 2016|website=Microsoft Edge dev blog}}</ref> 선도자격 기술은 [[모질라]], [[구글 네이티브 클라이언트]]의 [[Asm.js]]이었으며<ref name="techcrunch2015">{{뉴스 인용|url=https://techcrunch.com/2015/06/17/google-microsoft-mozilla-and-others-team-up-to-launch-webassembly-a-new-binary-format-for-the-web/|title=Google, Microsoft, Mozilla And Others Team Up To Launch WebAssembly, A New Binary Format For The Web|last=Lardinois|first=Frederic|date=2015-06-17|work=TechCrunch|access-date=2017-12-24|language=en}}</ref><ref name="PNaCl">{{웹 인용|url=https://www.infoq.com/news/2017/05/pnacl-webassembly-google|title=Google Is to Remove Support for PNaCl|last=Avram|first=Abel|date=2017-05-31|website=InfoQ|access-date=2017-12-22}}</ref> 최초 구현체는 asm.js의 기능 집합에 기반을 두었다.<ref name="initial implementation">{{웹 인용|url=https://www.2ality.com/2015/06/web-assembly.html|title=WebAssembly: a binary format for the web|work=②ality&nbsp;– JavaScript and more|date=18 June 2015}}</ref>

== 같이 보기 ==
* [[자바 바이트코드]]
* [[공통 언어 런타임]]
* [[LLVM]]
* [[컴파일러]]
* [[이식 (컴퓨팅)]]
== 참고 문헌 ==
* {{저널 인용|first1=Andreas|last1=Haas|first2=Andreas|last2=Rossberg|first3=Derek L.|last3=Schuff|first4=Ben L.|last4=Titzer|first5=Dan|last5=Gohman|first6=Luke|last6=Wagner|first7=Alon|last7=Zakai|first8=JF|last8=Bastien|first9=Michael|last9=Holman|first=|date=June 2017|title=Bringing the web up to speed with WebAssembly|url=https://dl.acm.org/ft_gateway.cfm?id=3062363&type=pdf|journal=Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation|publisher=Association for Computing Machinery|volume=|pages=185–200|doi=10.1145/3062341.3062363|via=}}
* {{저널 인용|last=Watt|first=Conrad|date=2018|title=Mechanising and Verifying the WebAssembly Specification|url=https://www.cl.cam.ac.uk/~caw77/papers/mechanising-and-verifying-the-webassembly-specification.pdf|journal=ACM SIGPLAN International Conference on Certified Programs and Proofs|publisher=ACM|volume=7|pages=|doi=10.1145/3167082|via=}}

== 내용주 ==
{{각주|group=note}}

== 각주 ==
{{각주}}

== 데모 ==
* 위젯 데모: [http://nowsmartsoft.atwebpages.com/demo1/index.html] {{웨이백|url=http://nowsmartsoft.atwebpages.com/demo1/index.html |date=20191025214129 }} with NWSTK
* 3D mountain geometry synthesis demo: [http://nowsmartsoft.atwebpages.com/demo_Mountain/index.html] {{웨이백|url=http://nowsmartsoft.atwebpages.com/demo_Mountain/index.html |date=20191026083729 }} with NWSTK
* Demo for loading and drawing a [[JPEG|jpg]] file: [http://nowsmartsoft.atwebpages.com/demo2/index.html] {{웨이백|url=http://nowsmartsoft.atwebpages.com/demo2/index.html |date=20191123195737 }} with NWSTK

== 외부 링크 ==
* {{공식 웹사이트}}
* [https://www.w3.org/community/webassembly/ W3C Community Group]
* [https://github.com/WebAssembly/design WebAssembly Design]
* {{인용|url=https://developer.mozilla.org/en-US/docs/WebAssembly|title=WebAssembly|website=MDN Web Docs|language=en-US}}{{snd}} with info on browser compatibility and specifications (WebAssembly JavaScript API)
* [https://www.youtube.com/watch?v=R9wn99Xheq4 <!--GOTO 2017 • --> WebAssembly: What and What Next?] at [[유튜브]]

{{웹 브라우저}}
{{웹 인터페이스}}
{{자바스크립트}}

[[분류:어셈블리어]]
[[분류:웹 프로그래밍]]
[[분류:W3C 표준]]