Skip to content

Instantly share code, notes, and snippets.

#!/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 Practice

Gleam を新規作成するとき、既存プロジェクトを改善するとき、wisp + mist + gleam_otp + just 構成で実装するときに使う。

v-tokyo24 発表資料の原稿. スライド版はあとで公開。

(このままのが読みやすいかも)


今、すべてを作り直すなら

Luna/Sol の SSR と Island Architecture

broken png

// 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") || "";
// 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 {
@mizchi
mizchi / jit.zig
Last active January 19, 2026 16:34
WASM Jit compiler C/Zig by Claude Code
// Minimal Baseline JIT for WebAssembly (ARM64)
// Zig implementation
const std = @import("std");
const fs = std.fs;
const mem = std.mem;
const Allocator = std.mem.Allocator;
// ============================================================================
// Code buffer for JIT compilation

Bundle Size Analysis

This document analyzes the bundle size of MoonBit JavaScript output, identifying the main contributors to code size and potential optimization opportunities.

Note: The analyzed output is after terser DCE (Dead Code Elimination) with compress enabled. Unused code has already been removed.

Analysis Target

https://github.com/mizchi/js.mbt/blob/main/src/examples/aisdk/main.mbt

Moonbit FFI Core

///|
#external
pub type JsValue

///|
pub fn[T] JsValue::cast(self : JsValue) -> T = "%identity"