{"id":14263264,"url":"https://github.com/AssemblyScript/examples","last_synced_at":"2025-08-13T09:32:45.038Z","repository":{"id":25041108,"uuid":"260460689","full_name":"AssemblyScript/examples","owner":"AssemblyScript","description":"A collection of AssemblyScript examples.","archived":false,"fork":false,"pushed_at":"2022-08-22T09:40:27.000Z","size":611,"stargazers_count":288,"open_issues_count":9,"forks_count":51,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-10-30T00:00:15.043Z","etag":null,"topics":["assemblyscript","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://assemblyscript.org","language":"WebAssembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AssemblyScript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-01T13:03:51.000Z","updated_at":"2024-10-22T07:54:32.000Z","dependencies_parsed_at":"2022-07-13T10:30:46.306Z","dependency_job_id":null,"html_url":"https://github.com/AssemblyScript/examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Fexamples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Fexamples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Fexamples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyScript%2Fexamples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AssemblyScript","download_url":"https://codeload.github.com/AssemblyScript/examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228157616,"owners_count":17878306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assemblyscript","wasm","webassembly"],"created_at":"2024-08-22T13:06:14.110Z","updated_at":"2024-12-14T20:30:43.418Z","avatar_url":"https://github.com/AssemblyScript.png","language":"WebAssembly","readme":"![](https://avatars1.githubusercontent.com/u/28916798?s=64) AssemblyScript Examples\n=======================\n\n[![Actions Status](https://github.com/AssemblyScript/examples/workflows/Test/badge.svg?branch=main)](https://github.com/AssemblyScript/examples/actions)\n\n## Instructions\n\nThis repository contains one example per directory. All examples can be obtained by cloning the repository:\n\n```\n$\u003e git clone https://github.com/AssemblyScript/examples.git\n$\u003e cd examples\n```\n\nAfterwards, select the example you'd like to run and follow the instructions in its README file.\n\n## Low-level perspective\n\nThe following examples make use of AssemblyScript's low-level capabilities, i.e. to essentially write WebAssembly with a nicer syntax.\n\n* [Conway's Game Of Life](./game-of-life) ([demo](https://assemblyscript.github.io/examples/game-of-life/))\u003cbr /\u003e\n  An implementation of the game of life with slight modifications. Updates an image buffer in memory, that is then presented on a canvas.\n\n  \u003cimg src=\"./game-of-life/preview.jpg\" /\u003e\n\n* [Mandelbrot Set](./mandelbrot) ([demo](https://assemblyscript.github.io/examples/mandelbrot/))\u003cbr /\u003e\n  Computes 2048 offsets of a color gradient in memory, line by line, and presents the set using the gradient's actual colors, as computed on the JavaScript side, on a canvas.\n\n  \u003cimg src=\"./mandelbrot/preview.jpg\" /\u003e\n\n* [Interference effect](./interference) ([demo](https://assemblyscript.github.io/examples/interference/))\u003cbr /\u003e\n  Colin Eberhardt's and Ben Smith's WebAssembly interference effect, if it was written in AssemblyScript.\n\n  \u003cimg src=\"./interference/preview.jpg\" /\u003e\n\n## High-level perspective\n\nThese examples cover slightly higher level aspects, like working with managed objects or interfacing with them.\n\n* [N-body system](./n-body) ([demo](https://assemblyscript.github.io/examples/n-body/))\u003cbr /\u003e\n  This is actually a benchmark - visualizing it just so happened.\n\n  \u003cimg src=\"./n-body/preview.jpg\" /\u003e\n\n* [Loader](./loader)\u003cbr /\u003e\n  Utilizes the [loader](https://docs.assemblyscript.org/basics/loader) to perform various common tasks on the WebAssembly/JavaScript boundary, like passing along strings and arrays between both worlds.\n\n  \u003cimg src=\"./loader/preview.jpg\" /\u003e\n\n## Libraries\n\nVarious WebAssembly or AssemblyScript features as a library.\n\n* [i64](./i64)\u003cbr /\u003e\n  Exposes WebAssembly's i64 operations to JavaScript using 32-bit integers (low and high bits).\n\n* [libm](./libm)\u003cbr /\u003e\n  Exposes AssemblyScript's math routines for double and single precision as a library.\n\n## Features\n\nGeneral examples showing how to utilize specific AssemblyScript features.\n\n* [Browser SDK](./sdk) ([demo](https://assemblyscript.github.io/examples/sdk/))\u003cbr /\u003e\n  Shows how to use the browser SDK to run the AssemblyScript compiler in the browser.\n\n  \u003cimg src=\"./sdk/preview.jpg\" /\u003e\n\n* [Compiler transforms](./transform)\u003cbr /\u003e\n  An example of using compiler transforms to hook into the compilation process.\n\n## Additional resources\n\n* [Wasm By Example](https://wasmbyexample.dev/all-examples-list.html)\u003cbr /\u003e\n  A concise, hands-on introduction to WebAssembly using code snippets and annotated example programs. If you \"learn best by doing\", or just need a good starting point for a concept, this is the place for you.\n\n* [Built with AssemblyScript](https://www.assemblyscript.org/built-with-assemblyscript.html)\u003cbr /\u003e\n  A list of more sophisticated open source projects using AssemblyScript.\n","funding_links":[],"categories":["webassembly"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAssemblyScript%2Fexamples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAssemblyScript%2Fexamples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAssemblyScript%2Fexamples/lists"}