# Relax: Rust 프로그램의 실시간 수정
# Relax: live edits for Rust programs

- Site: https://select1.dev/2026-11-13 (English), https://select1.dev/ko/2026-11-13 (Korean)
- Entry: 034
- Published: 2026-11-13 (KST). Launch date: 2026-11-12
- Pick: Relax <https://github.com/makepad/relax> (source: GitHub)
- Verified: ran
- What: Relax 는 빌드를 기다리지 않고 Rust 프로그램을 실행하는 프로덕트다. 실행 중에 고친 코드도 바로 반영한다.
- What (en): Relax is a product that runs a Rust program without waiting for a build. It also applies your edits while the program runs.
- Why: 오늘의 픽으로 선정한 이유는 Rust 코드를 고쳐도 프로그램의 상태가 유지되기 때문이다.
- Why (en): It is today’s pick because you can change Rust code and keep the running state.
- Verdict: 작동한다. 실행 중인 프로그램에 고친 함수가 9.4 ms 만에 반영됐다.
- Verdict (en): It works. An edited function was patched into the running program in 9.4 ms.
- Tags: rust, jit, compiler, hot-reload

## Checked against the README

- [pass] 실행 중인 프로그램의 함수를 바꾸면 상태를 유지한 채 반영된다(Change one function in a running program: patched in, state kept) — 0.5초마다 카운터를 출력하는 프로그램을 relax run 으로 실행하고 5초 뒤 출력 함수를 고쳐 저장했다. 9.4 ms 만에 패치됐고 카운터는 9 다음 10 으로 이어졌다
- [pass] Relax 가 최적화한 코드는 cargo build --release 로 빌드한 코드보다 느리다. x64 에서 1.12배의 시간이 든다(slower: 1.12× the time on x64) — 시험 프로그램은 에라토스테네스의 체로 30,000,000 이하 소수의 개수를 구하는 작업을 5번 반복한다. 이 프로그램을 cargo build --release 로 빌드해 두 번, Relax 로 두 번 실행했다. 마지막 회차의 시간은 cargo build --release 로 빌드한 프로그램이 118~122 ms, Relax 가 134~141 ms 였다. Relax 의 시간은 cargo build --release 로 빌드한 프로그램의 1.10~1.19배였다. 작업 하나라 README 의 21개 작업 기하 평균과 같은 조건은 아니다
- [pass] crates.io 의존성이 없다(0 crates.io dependencies) — Cargo.lock 의 패키지 37개 가운데 crates.io 에서 받은 패키지는 0개였다. 빌드하는 동안 CARGO_HOME 에 레지스트리 디렉터리도 생기지 않았다

## Measured

- hello 패키지를 relax run 으로 실행한 시간: 첫 실행 0.96초, 다음 두 번 0.11초와 0.08초 (4코어 x86-64 Linux 에서 cargo new 로 만든 hello 를 relax run --quiet 로 3번 실행했다. 같은 패키지의 cargo run 은 처음 0.20초, 다시 0.06초였다. README 에 따르면 16코어 x86-64 에서 hello 의 첫 실행은 0.24초다)

## Progress (days after launch; full history https://select1.dev/2026-11-13/progress)

- day 3 (checked 2026-11-15) [active] commits since launch 609, stars 539, releases 0, contributors 19, last commit 2026-11-14
  - The Sandboxed policy now confines the build scripts of third-party packages.
  - A build script that depends on a native package can run C code. `relax check` now runs such a script only with `--allow-c`.
  - Relax now supports the standard library changes in rustc 1.100.
  - `relax test --live` now applies changes each time you save a file in a multi-crate workspace.
  - The README and the site now say that Relax is not affiliated with the Rust project or the Rust Foundation. They also say it does not automatically inherit Rust’s safety guarantees.
- day 7 (checked 2026-11-19) [active] commits since launch 906, stars 598, releases 0, contributors 19, last commit 2026-11-18
  - When code compiled by the just-in-time compiler panics, it now prints a backtrace.
  - When a function is edited mid-run, Relax starts counting its calls again. If the function is called often, Relax recompiles it with O3 optimization.
  - The just-in-time compiler’s cache leaves some disk space free and removes the caches of other builds after a day without use.
  - 16 of the 468 relax-compiler library tests fail on Windows. A new document lists them and groups them by cause.
- day 15 (checked 2026-11-27) [active] commits since launch 1404, stars 673, releases 0, contributors 19, last commit 2026-11-26
  - On Linux, the TLS client now checks both the server’s name and its certificate chain.
  - JIT compilation now uses its own thread pool. JIT threads no longer ask for or wait for the app’s CPU tokens.
  - When startup cannot use the JIT cache and compiles the code again from scratch, it now prints the reason in one line.

## 한국어

## 무엇이 문제인가

Rust 컴파일러 rustc 는 프로그램 전체를 실행 전에 컴파일한다. 그래서 큰 프로그램은 빌드에 몇 분이 소요된다. 함수 하나를 고쳐도 다시 빌드하고 재시작해야 한다. 재시작하면 변수 값 같은 프로그램의 상태는 사라진다. Relax 의 README 에 따르면 큰 3D 게임은 새로 클론한 뒤 cargo 와 rustc 로 빌드해 첫 화면이 표시되기까지 약 3분이 필요하다.

## 어떻게 해결했나

Relax 는 2026년 11월 12일 기준 GitHub 스타가 243개였다. README 에 따르면 Rust 로 UI 앱을 만드는 Makepad 프로젝트에서 나왔다.

Relax 는 rustc, LLVM, 링커를 쓰지 않고 Cargo 패키지를 소스에서 바로 실행한다. 함수는 처음 호출될 때 하나씩 컴파일된다. 자주 호출되는 함수는 실행 중에 백그라운드에서 더 최적화한 코드로 교체된다. 파일을 저장하면 Relax 는 변경된 함수만 다시 컴파일해 실행 중인 프로세스에 반영한다. Rust 표준 라이브러리도 Relax 가 소스에서 직접 컴파일한다.

## 무엇이 다른가

첫째, 컴파일하는 시점이 다르다. rustc 는 프로그램 전체를 실행 전에 컴파일한다. Relax 는 JIT 방식으로 함수를 처음 호출할 때 컴파일한다. 그래서 큰 프로그램도 빌드가 끝나기를 기다리지 않고 시작한다. README 에 따르면 위에서 말한 3D 게임을 새로 클론해 M4 MacBook 에서 Relax 로 실행하면 11초 만에 첫 화면이 표시된다. 트레이드오프는 실행 속도가 느려진다는 점이다. README 에 따르면 Relax 로 실행한 코드는 x64 에서 cargo build --release 로 빌드한 코드의 1.12배, arm64 에서 1.24배의 시간이 든다. 제작자는 작업 21개의 결과를 기하 평균해 1.12배와 1.24배를 구했다.

둘째, 수정이 반영되는 방식이 다르다. Relax 는 프로세스를 재시작하지 않으므로 프로그램의 상태가 유지된다. Relax 는 이전에 컴파일한 기계어 코드를 지우지 않는다. 그래서 이미 실행 중인 호출은 이전 코드로 끝나고, 다음 호출부터 새 코드가 실행된다. 트레이드오프는 메모리를 더 많이 사용한다는 점이다. 컴파일러와 그 캐시가 프로그램과 같은 프로세스에서 메모리를 차지한다. 함수를 고칠 때마다 생기는 기계어 코드도 지우지 않으므로 메모리 사용량이 계속 늘어난다. 다만 README 에 따르면 구조체 레이아웃, import, trait 나 impl 헤더, 매크로를 바꾸면 재시작해야 반영된다.

## 어떻게 만들었나

- AGENTS.md 에 따르면 이 저장소는 makepad/makepad 의 `work` 브랜치에서 지정된 경로만 복사하는 미러다.
- 깊이 200 으로 클론하자 병합 커밋을 포함해 커밋 398개를 받았다. 이 가운데 317개에 Co-Authored-By 트레일러가 있다. 이름별로는 Claude Opus 5.5 가 298개, Claude Fable 5.2 가 13개, Claude Sonnet 5.5 와 Codex 가 각각 8개다. 일부 커밋은 이름이 둘 이상이라 합계가 317개보다 많다.
- 이 저장소의 Rust 코드는 약 819,000줄이고, 그 가운데 libs/relax 가 약 700,000줄이다. libs/relax 에는 Relax 가 직접 컴파일하는 표준 라이브러리 소스 140,000줄이 들어 있다.

## 실행해 보니

4코어 x86-64 Linux 에서 저장소를 클론해 빌드하고, cargo new 로 만든 패키지 세 개를 Relax 로 실행했다.

1. 빌드. `cargo build --release -p relax-runner --bin relax` 는 3분 45초가 소요됐다. README 에 따르면 16코어 컴퓨터에서는 53초가 소요된다. Cargo.lock 의 패키지 37개 가운데 crates.io 에서 받은 패키지는 없었다.
2. hello. 첫 `relax run` 은 0.96초, 다음 두 번은 0.11초와 0.08초였다. 같은 패키지의 `cargo run` 은 처음 0.20초, 다시 실행하면 0.06초였다. hello 는 rustc 로 빌드하는 시간이 짧아 `cargo run` 이 Relax 보다 빨랐다. README 에 따르면 Relax 는 컴파일한 결과를 target/makepad-run 에 저장한다. hello 를 세 번 실행한 뒤 target/makepad-run 의 크기는 49 MB 였다. `relax test` 는 테스트 1개를 1.4초에 통과했다.
3. 실행 중 수정. 0.5초마다 카운터를 출력하는 프로그램을 `relax run` 으로 실행하고, 5초 뒤 출력 함수의 문자열을 v1 에서 v2 로 바꿔 저장했다. Relax 로그에 따르면 출력 함수는 9.4 ms 만에 패치됐다. 카운터는 v1 tick 9 다음 v2 tick 10 으로 이어졌다.
4. 속도. 시험 프로그램은 에라토스테네스의 체로 30,000,000 이하 소수의 개수를 구하는 작업을 5번 반복한다. 이 프로그램을 cargo build --release 로 빌드해 두 번, Relax 로 두 번 실행했다. cargo build --release 쪽은 마지막 회차가 118~122 ms 였다. Relax 는 첫 회차가 458~520 ms 로 느렸고, 마지막 회차는 134~141 ms 로 cargo build --release 쪽 시간의 1.10~1.19배였다. 첫 회차는 함수가 더 최적화되기 전이다.

```text title="터미널, relax run --quiet live"
v1 tick 8
v1 tick 9
makepad live: main.rs: patched (1 item(s) changed, 1 fn(s) installed) in 9.4 ms
v2 tick 10
v2 tick 11
```

## 판정

작동한다. 실행 중인 프로그램에 고친 함수가 9.4 ms 만에 반영됐다. 다만 Relax 가 최적화한 코드는 cargo build --release 로 빌드한 코드보다 느렸다. 큰 Rust 프로그램을 자주 고치는 경우에 써 볼 만하다.

## 얻어갈 것

- 프로그램을 고칠 때마다 상태를 잃는다면, 코드를 함수 단위로 교체하는 방식을 검토하자. Relax 는 오늘 재시작 없이 함수 하나를 교체했다. 카운터는 초기화되지 않고 이어졌다.
- 빌드 시간을 줄이는 도구를 만든다면, 얼마나 큰 프로그램부터 이득인지 함께 밝히자. 오늘 작은 프로그램인 hello 에서는 `cargo run` 이 Relax 보다 빨랐다.

### 용어

- cargo: Rust 의 빌드 도구이자 패키지 관리자. cargo build 로 빌드하고, cargo run 으로 빌드한 뒤 실행한다.
- LLVM: 여러 컴파일러가 코드를 최적화하고 CPU 종류별 기계어로 바꿀 때 공통으로 사용하는 라이브러리. rustc 와 Clang 이 LLVM 을 쓴다.
- 링커: 따로 컴파일된 파일과 라이브러리를 실행 파일 하나로 묶는 프로그램.
- JIT: Just-in-time 컴파일. 코드를 실행 전에 컴파일하지 않고, 프로그램이 실행되는 도중에 기계어로 컴파일하는 방식이다.
- trait: Rust 에서 여러 타입이 구현할 메서드를 묶어 정의한 것. Java 의 인터페이스와 비슷하다.

## English

## The problem

The Rust compiler, rustc, compiles the whole program before it runs. So a large program takes minutes to build. Even when you change one function, you rebuild, relink and restart. The program loses its running state. According to the Relax README, a large 3D game built with cargo and rustc takes about 3 minutes from a fresh clone to its first frame.

## How it solves it

On November 12, 2026, Relax had 243 stars on GitHub. According to the README, it comes from the Makepad project, which builds UI apps in Rust.

Relax runs a Cargo package straight from source, without rustc, LLVM or a linker. Each function is compiled on its first call, and frequently called functions are optimized further in the background while the program runs. When you save a file, Relax recompiles only the changed functions and puts them into the running process. Relax also compiles the Rust standard library from source.

## What is different

The first difference is when code is compiled. rustc compiles the whole program before it runs. Relax uses JIT compilation and compiles each function on its first call. So even a large program starts without waiting for a build. According to the README, the 3D game above shows its first frame in 11 seconds from a fresh clone on an M4 MacBook. The tradeoff is speed. According to the README, code under Relax takes 1.12× as long to run as code built with cargo build --release on x64, and 1.24× as long on arm64. Each number is a geometric mean over 21 workloads.

The second difference is how edits are applied. Relax does not restart the process, so the program keeps its running state. Relax never deletes the old machine code. So a call that is still running finishes on the old code, and the next call uses the new code. The tradeoff is memory use. The compiler and its caches run inside the program’s process. The old machine code is never deleted, so memory use keeps growing. According to the README, a change to a struct layout, an import, a trait or impl header, or a macro still waits for a restart.

## How it was built

- According to AGENTS.md, this repository is a mirror of selected paths from the `work` branch of makepad/makepad.
- I cloned with depth 200 and got 398 recent commits, including the history that merge commits bring in. Of these, 317 have a Co-Authored-By trailer. The trailers name Claude Opus 5.5 in 298 commits and Claude Fable 5.2 in 13. They name Claude Sonnet 5.5 and Codex in 8 commits each. Some commits name more than one.
- The repository has 819,000 lines of Rust code. The compiler library, libs/relax, contains 700,000 lines. libs/relax includes the 140,000 lines of standard library source that Relax compiles itself.

## Running it

I cloned and built the repository on a 4-core x86-64 Linux machine. Then I made 3 packages with cargo new and ran them under Relax.

1. Build. `cargo build --release -p relax-runner --bin relax` took 3 minutes 45 seconds. According to the README, it takes 53 seconds on 16 cores. None of the 37 packages in Cargo.lock came from crates.io.
2. hello. The first `relax run` took 0.96 seconds, and the next two runs took 0.11 and 0.08 seconds. `cargo run` on the same package took 0.20 seconds the first time and 0.06 seconds after that. rustc built the small hello program quickly, so `cargo run` was faster than Relax. According to the README, Relax keeps its compiled code in target/makepad-run. After 3 runs of hello, that folder was 49 MB. `relax test` passed 1 test in 1.4 seconds.
3. Editing while it runs. I used `relax run` to start a program that prints a counter every 0.5 seconds. After 5 seconds, I changed the string in its print function from v1 to v2 and saved. Relax’s log said the patch took 9.4 ms, and the counter went on from v1 tick 9 to v2 tick 10.
4. Speed. I ran a sieve of Eratosthenes for 5 rounds in a row. Each round counted the primes up to 30,000,000. I ran it twice with cargo build --release and twice with Relax. With cargo build --release, the last round took 118 to 122 ms. With Relax, the first round took 458 to 520 ms. The last round took 134 to 141 ms, or 1.10 to 1.19× as long. The first round runs before the functions are optimized further.

```text title="Terminal, relax run --quiet live"
v1 tick 8
v1 tick 9
makepad live: main.rs: patched (1 item(s) changed, 1 fn(s) installed) in 9.4 ms
v2 tick 10
v2 tick 11
```

## Verdict

It works. An edited function was patched into the running program in 9.4 ms. But Relax’s optimized code was slower than code built with cargo build --release. It is worth trying if you often change a large Rust program.

## What to take away

- If you lose the running state every time you change a program, consider swapping code one function at a time. Today Relax swapped one function without a restart, and the counter went on without a break.
- If your tool cuts build time, say how large a program has to be before it helps. For today’s small hello program, `cargo run` was faster than Relax.

### Terms

- cargo: Rust’s build tool and package manager. cargo build builds a program, and cargo run builds it and then runs it.
- LLVM: A tool used by many compilers. It optimizes code and produces machine code for each kind of CPU. rustc and Clang use it.
- linker: A program that combines compiled pieces and libraries into one executable.
- JIT: Just-in-time compilation. A JIT compiler turns code into machine code while the program runs, instead of before it starts.
- trait: In Rust, a set of methods that several types can implement. It is similar to an interface in Java.

## Launches the same day

- AI Red Lines <https://yourairedlines.com> (Show HN, 30): 기록 사이트. AI 에 대해 행동에 나설 기준을 미리 적어 둔다.
- DeepSeek-Coder-V2-Lite Sub5GB <https://huggingface.co/AmSach/DeepSeek-Coder-V2-Lite-Instruct-MAPLE-Sub5GB-GGUF> (Show HN, 8): 양자화 모델. DeepSeek-Coder-V2-Lite 를 5GB 아래로 줄여 6GB GPU 에 올린다.
- RamaSite <https://github.com/DaleFranks/ramasite> (Show HN, 8): CMS. SQLite 파일 하나로 공유 호스팅에서 도는 Laravel 사이트를 만든다.
- turri <https://github.com/turri-oss/turri> (Show HN, 7): 코딩 에이전트. 프로그램을 다시 생성하는 방식으로 코드를 고친다.
- Taster <https://github.com/rinkesh2010rpp/taster-ai> (Show HN, 5): 에이전트 검사 도구. 도구 호출을 평문 영어 규칙과 대조해 실행 전에 막는다.
- Relax <https://github.com/makepad/relax> (GitHub, 243): Rust 용 JIT 컴파일러. rustc 없이 함수를 처음 호출할 때 컴파일한다.
- guizang-game-skill <https://github.com/op7418/guizang-game-skill> (GitHub, 228): 에이전트 스킬. Claude Code 와 Codex 가 브라우저 3D 액션 게임을 만들게 한다.
- OpenOrange <https://github.com/rivet-dev/open-orange> (GitHub, 174): 서버리스 런타임. Cloudflare Workers 코드를 다른 클라우드에서 그대로 실행한다.
- Plurai Simulation <https://www.producthunt.com/products/plurai> (Product Hunt, 328): 에이전트 시험 환경. 시뮬레이션 세계에서 에이전트를 반복해 개선한다.
- YouArt Desktop App <https://www.producthunt.com/products/youart> (Product Hunt, 275): 데스크톱 앱. 크리에이티브 팀의 작업을 AI 에이전트에게 맡긴다.
- Omnigraph <https://www.producthunt.com/products/omnigraph> (Product Hunt, 211): 그래프 데이터베이스. AI 에이전트가 쓰는 오픈소스 데이터베이스다.

## Getting started

- Steps: git clone https://github.com/makepad/relax ; cargo build --release --manifest-path relax/Cargo.toml -p relax-runner --bin relax ; 패키지 폴더에서 relax run --quiet <패키지 이름>
- Needs: stable 버전 Rust 툴체인. crates.io 의존성은 없다. README 에 따르면 Linux x86-64 와 macOS arm64 에서 시험했고 Windows 는 시험하지 않았다.
- Cost: MIT, 무료.
- Note: 실험 단계다. 제작자는 배포할 프로그램을 cargo build --release 로 빌드하라고 권장한다.
