Skip to content

Connect-4 with a Rust core compiled to WASM, wrapped in Typescript, rendered in HTML.

License

Notifications You must be signed in to change notification settings

tauseefk/connectors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connecto.rs

This is connect-4 with a Rust core compiled to WASM, wrapped in Typescript, rendered in HTML.

The goal is to encourage more Javascript engineers to write Rust. Demonstrating the why of writing Rust is outside the scope of this repository, demonstrating all the great things you can do with Rust is also outside the scope as I am in no way an authority on idiomatic Rust.

But if you're already curious about Rust, hopefully this repository will speed up the process of going from whaaa to whoaa.

May the connect-4s be with you.

Outcomes

These are some of the things you will be able to do by the end of this series:

  • see similarities and differences between parts of Rust and Javascript
  • send data back and forth between the Rust (WASM) and Javascript context
  • expose the minimal set of APIs from your Rust code to structure your application
  • play connect 4 in a browser

Prerequisites

Development

# building the engine
cd connecto.rs
chmod +x build.sh
./build.sh

# starting the node server
cd www
npm i
npm run dev

Directory Structure

connectors/
├─ connecto.rs/                // Rust workspace
│  ├─ build.sh                 // compiles engine to WASM
│  └─ connectors/
│     ├─ src/lib.rs            // Rust entry point
│     └─ src/engine.rs         // engine code
└─ www/                        // client-side code

Rust for JavaScript Engineers - Blog post series

Code checkpoints

Other Resources

The Rust Book

Rust by Example

WASM Game of Life

Bare Metal WASM

About

Connect-4 with a Rust core compiled to WASM, wrapped in Typescript, rendered in HTML.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published