• Stars
    star
    191
  • Rank 202,081 (Top 4 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Running Clang/LLD in WebAssembly Demo

Clang/LLD in WebAssembly

This is the demo for my CppCon 2019 talk! You can view the talk on youtube

Thing should work, but it's still very much alpha demoware. Go to https://binji.github.io/wasm-clang to see it in action.

Most of the JavaScript code can be found here. If you're interested in the implementation of the in-memory filesystem, take a look at https://github.com/binji/llvm-project/tree/master/binji.

Directory structure

Shared utilities

  • clang: clang compiler, compiled to wasm w/ WASI
  • lld: lld linker, compiled to wasm w/ WASI
  • main.css
  • memfs: WASI implementation of in-memory filesystem,
  • shared.js: shared utilities for all tools (web and d8)
  • shared_web.js: shared utilities for all web tools (asm.html, index.html, etc.)
  • sysroot.tar: C++ standard headers and libraries
  • service_worker.js: Service worker used by all web pages
  • worker.js: Dedicated work used to compile/run

Assemble 6502 code

  • 6502.html
  • 6502.js
  • vasm6502_oldstyle: vasm assembler compiled to wasm w/ WASI

Compile C++ code to x86/wasm assembly

  • asm.html
  • asm.js

Compile C++ code in d8 (v8's console shell)

  • d8.js

Compile and run C++ code

  • index.html
  • web.js

More Repositories

1

pokegb

A gameboy emulator that only plays Pokemon Blue, in ~50 lines of c++.
C++
1,256
star
2

smolnes

NES emulator in <5000 bytes of C
C
520
star
3

binjgb

Gameboy emulator implemented in C, that also runs in the browser
C
483
star
4

raw-wasm

Raw WebAssembly demos
WebAssembly
387
star
5

love-nacl

Port of LÖVE to Native Client
C
43
star
6

wasm-e2e

Temporary scaffolding for running WebAssembly end-to-end, from C++ to browsers.
Python
23
star
7

porklike.gb

Gameboy Port of LazyDevs' Porklike
C
22
star
8

doomfirewasm

Doom fire effect, implemented in WebAssembly
HTML
20
star
9

smoothnacl

SmoothLife ported to NaCl
C++
18
star
10

lupica

Very WIP Casio Loopy emulator
C
12
star
11

nacl-nxengine

A port of nxengine to Native Client
C
9
star
12

raytrace-wasm

Mini raytracer in hand-written wasm
WebAssembly
8
star
13

metaball-wasm

WebAssembly metaball effect
WebAssembly
6
star
14

binji.github.io

HTML
5
star
15

binjnes

NES emulator implemented in C, that also runs in the browser
SourcePawn
4
star
16

pnacl.c

PNaCl reader/parser/interpreter in C
C
4
star
17

naclbind.js

JavaScript -> Native Client binding library
JavaScript
4
star
18

pnacl.js

JavaScript
3
star
19

spec.js

JavaScript implementation of the WebAssembly spec
JavaScript
3
star
20

nacl-sdk-gn-experiment

Experimenting with using GN to build the NaCl SDK
Shell
2
star
21

drod-nacl

Port of DROD: Gunthro and the Epic Blunder to NaCl
C++
2
star
22

pexe.py

Python
2
star
23

naclports

clone of https://chromium.googlesource.com/external/naclports.git
C
2
star
24

gabby

experimental clock-edge-ticked gb emulator
C++
2
star
25

gapi-nacl

Google Client APIs for Native Client
Python
2
star
26

pajama

JavaScript
2
star
27

virgil-chip8

chip8 simulator in virgil
Shell
2
star
28

bitmix

Mixing 4-/8-/16-bit values using only multiply/and/shift
JavaScript
2
star
29

mooneye-gb-tests

Cloned and filtered the tests directory from https://github.com/Gekkio/mooneye-gb
Assembly
1
star
30

wasmsummit2021-talk

Slides for my WebAssembly Summit 2021 Talk
JavaScript
1
star
31

sexpr-wasm

sexpression -> wasm
1
star
32

vimrc

Vim Script
1
star
33

ninja-wrap

Simple Python wrapper for ninja
Python
1
star
34

simfun

C++
1
star
35

drod

Mirror of Deadly Rooms of Death, (from http://drod.cvs.sourceforge.net/viewvc/drod/Caravel/?view=tar)
C++
1
star
36

fullstackfest-talk

Slides to the talk I gave at FullStackFest 2016
JavaScript
1
star
37

lucius

Clone of old lucius.vim colorscheme.
Vim Script
1
star
38

gotosthlm-talk

Slides to the talk I gave at GOTO Stockholm 2017
JavaScript
1
star
39

wasi-sdk-bin

C++
1
star