既存システムの実装を「事実上の仕様」とみなし、それを形式化することで 「テストでは踏めないバグ」と「実装が暗黙に決めている仕様」を炙り出すための手順書。 仕様書が無い / あてにならない / 仕様と実装がずれている、という現場を前提にする。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pkg | dir | direct_runtime_dependents | transitive_runtime_dependents | test_dependents | runtime_imports | usage_non_test | usage_total | loc | score | |
|---|---|---|---|---|---|---|---|---|---|---|
| moonbitlang/core/builtin | builtin | 74 | 74 | 0 | 1 | 19391 | 63750 | 17038 | 619.11 | |
| moonbitlang/core/debug | debug | 45 | 56 | 9 | 8 | 351 | 5463 | 1769 | 401.12 | |
| moonbitlang/core/float | float | 8 | 57 | 3 | 3 | 679 | 1934 | 277 | 221.31 | |
| moonbitlang/core/array | array | 23 | 42 | 7 | 1 | 0 | 5 | 10 | 202.58 | |
| moonbitlang/core/double | double | 8 | 58 | 4 | 1 | 53 | 873 | 59 | 201.46 | |
| moonbitlang/core/quickcheck | quickcheck | 17 | 32 | 4 | 4 | 26 | 201 | 118 | 185.98 | |
| moonbitlang/core/int16 | int16 | 7 | 59 | 1 | 1 | 15 | 212 | 95 | 185.90 | |
| moonbitlang/core/abort | abort | 1 | 75 | 0 | 0 | 1 | 3 | 13 | 163.32 | |
| moonbitlang/core/test | test | 14 | 38 | 34 | 2 | 0 | 2984 | 134 | 162.00 |
GA みたいに、ブラウザに公開キーを埋め込んでイベントを送るサービスを考える。
公開キーは secret ではない。script tag や bundle に入るので、誰でも見える。 ただしサーバー側では、その公開キーから token record を引いて、project と origin allowlist を見る。
このとき落とし穴になるのが domain verification。
「この origin はこの project のものだ」と確認できていることと、 「この origin から telemetry を write してよい」ことは別の権限になる。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| NIX_VERSION="2.24.9" | |
| export USER="${USER:-$(id -un)}" | |
| export HOME="${HOME:-/root}" | |
| # nix.conf を先に置く (sandbox 無効・flakes 有効) | |
| mkdir -p /etc/nix "$HOME/.config/nix" | |
| cat > /etc/nix/nix.conf <<'EOF' |
| name | gleam-practice |
|---|---|
| description | Best practices for building and reviewing Gleam projects on the Erlang target, especially Wisp plus Mist web services, OTP processes, justfile workflows, testing, formatting, CI, and performance measurement. |
(LLMに gleam を書かせながら生成した SKILL.md)
Gleam を新規作成するとき、既存プロジェクトを改善するとき、wisp + mist + gleam_otp + just 構成で実装するときに使う。
broken png
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // deno run -A compile-mbt.ts | |
| import * as comlink from "npm:comlink@4.4.2"; | |
| const mooncWorkerPath = import.meta.resolve( | |
| "npm:@moonbit/moonc-worker@0.1.202601213/moonc-worker.js" | |
| ); | |
| // 標準ライブラリの .mi ファイルを読み込む | |
| function getStdMiFiles(target = "js"): [string, Uint8Array][] { | |
| const home = Deno.env.get("HOME") || ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // JSON Parser in Wado - TDD approach | |
| // Goal: Verify if Wado can implement a JSON parser | |
| use {println, Stdout} from "core:cli"; | |
| // ============================================================================= | |
| // Parser State | |
| // ============================================================================= | |
| struct Parser { |
NewerOlder