MCPcopy
hub / github.com/EmNudge/watlings

github.com/EmNudge/watlings @main sqlite

repository ↗ · DeepWiki ↗
115 symbols 362 edges 51 files 4 documented · 3%
README

Watlings

Learn the WebAssembly Text Format by fixing a bunch of small programs!

Try it in your browser!

Example Exercise

Usage

This project uses Node 23+ & wasm-tools for compilation and testing.

Note: Later exercises (015+) use newer WebAssembly features like exception handling and GC types that require the --experimental-wasm-exnref flag, which is only available in Node.js 23 and later.

git clone git@github.com:EmNudge/watlings.git
cd watlings

Complete lessons by following the instructions in each exercise within the exercises directory.

Test your answer to an exercise with the start command:

npm start 001_hello

If you'd like to view the solution to an exercise, use the show command:

npm run show 001_hello

To apply it directly to the exercise, use solve instead of show:

npm run solve 001_hello

Recommended Editor

We recommend using VSCode with the wat-lsp extension.

This should provide syntax highlighting, intellisense, and other helpful features as you work through the exercises.

Using wasm-tools CLI

To compile your WAT code, this project uses the wasm-tools CLI.

Install wasm-tools and ensure wasm-tools is on your PATH. The scripts will invoke wasm-tools parse under the hood.

See install instructions: wasm-tools

Motivations

I've found just diving in to be the best way to build experience with programming.

Rustlings & Ziglings have both had tremendous returns to my journeys with both languages.

WebAssembly (and by extension WAT) has a more sparse educational landscape than most and I was hoping to fill some of the gaps by building a project with the same sort of structure.

Pedagogical Philosophy

Outlined here are some thoughts on what makes a good teaching experience.

Typing Over Reading

The goal is to learn by doing. Comments on each file outline a task and some background. However, a lot about a language can be gleaned by its syntax alone. We should be adding as little explanation as possible.

Occasional gaps in knowledge can be filled by consistent exposure to the syntax within different contexts. Certain things can therefore be learned without any mention.

Introduction text is superfluous. Words add visual noise, so we should be careful with our count. Coding itself should supplement ambiguities in the text.

If you find a text confusing or too verbose, please create a discussion post!

Create Struggle

Studies have shown that one cannot learn effectively without effort. This applies to practically every domain of knowledge. These projects should be educational, not easy.

This does not mean we should make the education itself elusive. We should not make learning more difficult, but instead more intentional.

When introducing a lot of new syntax, keep the problem scope small, but force the user to read a bit. If the syntax is not new, increase the problem scope. Maybe many variations of the same task.

Credits

Extension points exported contracts — how you extend this code

WatState (Interface)
(no doc)
web-build/src/editor.ts
WatEditor (Interface)
(no doc)
web-build/src/editor.ts
Lesson (Interface)
(no doc)
web-build/src/types.ts
Chapter (Interface)
(no doc)
web-build/src/types.ts
LessonsData (Interface)
(no doc)
web-build/src/types.ts

Core symbols most depended-on inside this repo

assert
called by 79
tests/utils/test-runner.mjs
instantiate
called by 46
tests/utils/instantiate.mjs
setSuccess
called by 18
tests/utils/test-runner.mjs
getWasm
called by 16
tests/utils/getWasm.mjs
matchObjectShape
called by 14
tests/utils/test-runner.mjs
arrayEquals
called by 10
tests/utils/test-runner.mjs
posToOffset
called by 7
web-build/src/editor.ts
applyPatch
called by 4
scripts/ci-check.mjs

Shape

Function 103
Interface 9
Method 3

Languages

TypeScript100%

Modules by API surface

web-build/src/editor.ts24 symbols
web-build/src/runner.ts10 symbols
web-build/src/progress.ts9 symbols
web-build/generate.mjs8 symbols
tests/utils/test-runner.mjs8 symbols
web-build/src/composables/useLessons.ts7 symbols
scripts/ci-check.mjs6 symbols
web-build/src/types.ts5 symbols
web-build/src/highlight.ts5 symbols
scripts/utils/compileFiles.mjs4 symbols
web-build/src/preview-worker.ts3 symbols
tests/utils/errorContext.mjs3 symbols

Dependencies from manifests, versioned

@codemirror/autocomplete6.18.0 · 1×
@codemirror/lang-javascript6.2.4 · 1×
@codemirror/lint6.8.0 · 1×
@codemirror/state6.5.0 · 1×
@codemirror/view6.36.0 · 1×
@emnudge/wat-lsp0.8.0 · 1×
@types/node20.11.16 · 1×
@vitejs/plugin-vue6.0.4 · 1×
canvas-confetti1.9.0 · 1×
codemirror6.0.0 · 1×
js-wasm-tools1.3.1 · 1×

For agents

$ claude mcp add watlings \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact