Skip to content

torch2424/assemblyscript-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AssemblyScript's Website

The site is built with VuePress and reuses its default theme to ease upgrading to newer versions.

The more important files are:

Editor component

Markdown files can make use of a custom editor component using the editor language tag, like so:

```editor
#!optimize=size&runtime=none&noAssert&explicitStart&enable=simd,reference-types
export function add(a: i32, b: i32): i32 {
  return a + b
}

#!html
<script>
loader.instantiate(module_wasm, { /* imports */ })
  .then(({ exports }) => {
    console.log(exports.add(1, 2))
  })
</script>
```

The first line is an optional shebang indicating selected compiler options. Available options are:

  • optimize = speed | size | none
  • noAssert?
  • debug?
  • runtime = full | half | stub | none
  • noExportMemory?
  • importMemory?
  • exportTable?
  • importTable?
  • explicitStart?
  • enable? = sign-extension?,bulk-memory?,simd?,threads?,reference-types?

The current source and associated compiler options can be serialized into a base64 blob this way. For example, when the 🔗 button is clicked, document.location.hash is updated with that blob and the then-sharable link is copied to clipboard.

Building

To work on the site locally, install the dependencies and start a development server serving at localhost:8080:

npm install
npm start

To build the site to dist, i.e. to verify that it works as expected:

npm run build

The page is automatically deployed on pushes to the repository, and at least once a day to sync sponsors.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published