← Winnitude! Search  ·  Reader Mode (552 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 56 LINKS

assemblyscript/src at main · AssemblyScript/assemblyscript

Repository navigation

src

Directory actions

More options

Directory actions

More options

Latest commit

 

History


History
View commit history for this file.

src

Folders and files

Name Name Last commit message Last commit date

parent directory

..
bindings bindings    
extra extra    
glue glue    
passes passes    
util util    
README.md README.md    
asconfig.json asconfig.json    
ast.ts ast.ts    
bindings.ts bindings.ts    
builtins.ts builtins.ts    
common.ts common.ts    
compiler.ts compiler.ts    
diagnosticMessages.json diagnosticMessages.json    
diagnostics.ts diagnostics.ts    
flow.ts flow.ts    
index-js.ts index-js.ts    
index-wasm.ts index-wasm.ts    
index.ts index.ts    
module.ts module.ts    
parser.ts parser.ts    
program.ts program.ts    
resolver.ts resolver.ts    
tokenizer.ts tokenizer.ts    
tsconfig.json tsconfig.json    
types.ts types.ts    
util.ts util.ts    

README.md

Compiler

Portable compiler sources that compile to both JavaScript using tsc and WebAssembly using asc.

Architecture

Usage

import assemblyscript from "assemblyscript";
...

Building

Building to JavaScript

To build the compiler, run:

npm run build

The rebuild automatically when there are changes, do:

npm run watch

Building to WebAssembly

To build the compiler to a WebAssembly binary, run:

npm run bootstrap

Uses the AssemblyScript compiler compiled to JavaScript to compile itself to WebAssembly, building to WebAssembly again using itself compiled to WebAssembly. Builds to build/. Performs a git diff to make sure that both the initial and the final artifacts are the same. Note that this builds the compiler as a library, while the asc frontend setting it up and feeding it source files is JavaScript for now.

Running asc with the WebAssembly variant:

asc [options...] --wasm build/assemblyscript.release-bootstrap.js

Running the compiler tests with the WebAssembly variant:

npm run test:compiler -- --wasm build/assemblyscript.release-bootstrap.js