Skip to content

niclaslind/shorelark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shorlark

codecov dependency status

Learning to Fly: Simulating Evolution with Rust and WebAssembly

This project is inspired by the "Learning to Fly" series by Patryk Wychowaniec . It demonstrates how to simulate evolution using neural networks and genetic algorithms in Rust, compiled to WebAssembly. The simulation features virtual birds navigating a 2D world to find food, with each bird's behavior controlled by a neural network that evolves over time. Designed for Rust beginners, the series introduces key concepts and guides you through building an interactive ecosystem from scratch.

Explore the live simulation: https://shorelark.pwy.io

App Screenshot

✅ Prerequisites

Make sure you have the following installed:

Install wasm-pack if you haven't already:

cargo install wasm-pack

🛠️ Build & Run

1. Build the WASM package

Navigate to the Rust crate and compile it using wasm-pack:

cd libs/simulation-wasm
wasm-pack build 

2. Install frontend dependencies

Go to the www folder and install JavaScript dependencies:

cd www
npm install

3. Start the development server

Using npm

npm run start

Using npx

npx webpack serve

🔄 Rebuilding WASM After Changes

If you make changes to the Rust code, rebuild the WebAssembly package:

cd libs/simulation-wasm
wasm-pack build

About

Rust + NLP + WASM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •