• Stars
    star
    199
  • Rank 196,105 (Top 4 %)
  • Language
    Rust
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 8 months ago

Reviews

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

Repository Details

Simulation of life & evolution

🐦 Shorelark

Simulation of evolution, powered by neural networks, genetic algorithms & high-school math:

screenshot

Feeling curious? I've described the implementation ab ovo on my blog: Learning to Fly.

Building

Using Nix

# 1/3: Clone the repository
$ git clone https://github.com/Patryk27/shorelark
$ cd shorelark

# 2/3: Build the application
#      (this might take a few minutes)
$ nix build
#
# ^ This command will create a directory called `result`
#   that'll contain the compiled WebAssembly code and a few
#   frontend files.
#
# If `nix build` fails, you might be using an older version
# of Nix that doesn't support flakes - if that's the case,
# please use this command instead:
#
# $ nix-build

# 3/3: Start the frontend application
$ nix shell nixpkgs#php80 -c php -S localhost:8080 -t result
#
# ^ After launching this, open `http://localhost:8080` in
#   your web browser - you should see the simulation working
#   as the doctor ordered :-)

# > But why are we downloading PHP? This seems insane!
# 
# It's due to CORS:
# https://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local
#
# Bottom line: it's not possible to open a local HTML file
# and make it load WebAssembly code - there *has* to be a
# web server used; and it just happens that PHP includes 
# a simple web server out of the box.
#
# If you don't want PHP on your machine - :-) - anything
# from this list will do the work, too:
#
# https://gist.github.com/willurd/5720255

Using Cargo and npm

Requires cargo, npm and wasm-pack (0.11.0):

# 1/3: Clone the repository
$ git clone https://github.com/Patryk27/shorelark
$ cd shorelark

# 2/3: Compile Rust into WebAssembly
#      (this might take a minute)
$ cd libs/simulation-wasm
$ wasm-pack build --release

# 3/3: Start the frontend application
$ cd ../../www
$ npm install
$ npm run start

# ^ After launching this, open `http://localhost:8080` in
#   your web browser - you should see the simulation working
#   as the doctor ordered :-)

Usage

Shorelark contains a simple in-game introduction - just read what the terminal on the left side says and have fun!

License

Copyright (c) 2020-2023, Patryk Wychowaniec [email protected].
Licensed under the MIT license.

More Repositories

1

strolle

Experimental real-time renderer with support for dynamic global illumination
Rust
385
star
2

doome

Doom + ClichΓ© = DoomΓ©
Rust
81
star
3

skicka

Send files between machines - no installation required!
Rust
71
star
4

lxd-snapper

LXD snapshots, automated
Rust
48
star
5

kartoffels

πŸ₯” Kartoffels πŸ₯” - MMO robot combat arena!
Rust
48
star
6

ostfs

Toy filesystem with support for zero-cost snapshots and clones
Rust
37
star
7

avr-tester

`#[test]` meets simavr!
Rust
20
star
8

clippy-dirty

`cargo clippy`, but only for the files / lines you've just modified
Shell
18
star
9

pwr-hd44780

A driver for HD44780 LCDs, with support for GPIO and I2C - created for use with Raspberry Pi
Rust
17
star
10

sdf-playground

Signed distance functions + Rust (CPU & GPU) = ❀️❀️
Rust
16
star
11

website

Source code for pwy.io
HTML
9
star
12

rast-jit-vm

Simplistic complier~virtual-machine that transforms AST into a Rust function, with basic type checking
Rust
9
star
13

omega2-gpio

A tiny library for managing Omega 2 GPIOs via /dev/mem
C++
7
star
14

chatgpt-at-home

Look Ma: My computer is talking!
Rust
7
star
15

dotfiles

Configurations for some of my Nix machines
Emacs Lisp
5
star
16

fiszker

πŸ’‘ Flashcards, simply
Dart
4
star
17

immune

Rust
4
star
18

home-station-2

🌞 A new, Rust-non-rusty weather station!
Rust
4
star
19

kartoffel

Starter pack for kartoffels
Rust
4
star
20

rast-jit-vm-simple

Simpler version of https://github.com/Patryk27/rast-jit-vm
Rust
3
star
21

simavr-ffi

Low-level Rust bindings to simavr
Rust
3
star
22

sscript-compiler

A toy compiler for my own programming languge
Pascal
2
star
23

janet

GitLab Companion Bot (work in progress)
Rust
2
star
24

sscript-editor

A toy IDE for own programming language
Pascal
1
star
25

home-station-1

A weather station integrated with Airly.eu - V2 coming!
Rust
1
star
26

domownik

An application for planing and managing home budgets
PHP
1
star
27

sscript-vm

A toy virtual machine for my own programming language - with basic JIT support!
Pascal
1
star
28

pwr-airly

An unofficial Rust client for the Airly's v2 API.
Rust
1
star
29

bad-apple-avr

Bad Apple!! on ATmega328p | work in progress
Rust
1
star
30

talks

Mirror of source codes for all my talks
Rust
1
star
31

cr8r

Run experiments across parts of a Rust ecosystem!
Rust
1
star
32

diary

Application for managing my digital diary
Rust
1
star