尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證A practical functional language
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
A practical functional language with static types, interfaces, and effects.
Medaka sits between a cleaned-up OCaml, a practical Haskell, and a
garbage-collected Rust: Hindley-Milner inference, interfaces for ad-hoc
polymorphism, tracked effects, exhaustive pattern matching, and a small
standard library written in the language itself.
The quickest way to try it is the playground, which
runs the full compiler in your browser. The guide
walks through the language from a first program to modules and tooling.檢視完整 README ↗Medaka sits between a cleaned-up OCaml, a practical Haskell, and a garbage-collected Rust: Hindley-Milner inference, interfaces for ad-hoc polymorphism, tracked effects, exhaustive pattern matching, and a small standard library written in the language itself.
data Shape
= Circle Float
| Rect Float Float
area : Shape -> Float
area (Circle r) = 3.14159 * r * r
area (Rect w h) = w * h
main =
let shapes = [Circle 1.0, Rect 3.0 4.0]
println "areas: \{map area shapes}"
The quickest way to try it is the playground, which runs the full compiler in your browser. The guide walks through the language from a first program to modules and tooling.
The compiler is written in Medaka (compiler/) and compiles itself through a
native LLVM backend to a self-contained binary, reproducing its own output
byte for byte. A second backend targets WasmGC and is what the playground
runs. make medaka builds the compiler from a checked-in IR seed, so the only
toolchain it needs is clang and the Boehm GC. See
compiler/BOOTSTRAP.md for how the self-hosting works.
Open work is tracked in the
0.1.0 milestone and the
issue tracker; PLAN.md
is an older working log, not the current roadmap.
This repository is developed with coding agents. AGENTS.md and .claude/ are their
playbooks; they are the reason the tree carries more process files than a typical project.
Besides the compiler and stdlib/, the repository holds several programs and libraries
written in the language, each with its own medaka.toml:
pds/: a Bluesky Personal Data Server, from HTTP framing and the
cryptographic primitives up.sqlite/: a SQLite file reader and writer with a small SQL engine.parsec/: a general parser-combinator library (sqlite/ uses it).gzip/: a DEFLATE/gzip codec.demo/: two edge plugins used to demonstrate effect-policy checking.Pipeline stages, in order:
compiler/frontend/lexer.mdk (indentation-sensitive)compiler/frontend/parser.mdk (recursive-descent)compiler/frontend/ast.mdkcompiler/frontend/desugar.mdk (deriving → impls, record punning, do-blocks, default-method specialization)compiler/frontend/resolve.mdk (every reference bound; multi-module aware)compiler/types/typecheck.mdk (Hindley-Milner + interfaces + effects + exhaustiveness; marks method dispatch per binding group)compiler/frontend/exhaust.mdk (Maranget pattern-matrix; called from typecheck)compiler/eval/eval.mdk (tree-walking interpreter with dict-passing typeclass dispatch)compiler/ir/core_ir_lower.mdk → compiler/backend/llvm_emit.mdk → clangcompiler/backend/wasm_emit.mdk (2nd backend, browser playground)compiler/driver/loader.mdk + compiler/driver/medaka_cli.mdkcompiler/tools/ (fmt, printer, LSP, doctest, doc, repl, new_cmd, test_cmd, check)Medaka is experimental (0.1.0 preview). The language, compiler, standard library, formatter, linter, language server, and browser playground all work; the surface syntax and library are still settling ahead of a first tagged release. Open work is tracked in GitHub issues.
Medaka builds from source and needs only clang and the Boehm GC. There is no
OCaml, opam, or dune. You also need make, git, and gunzip (the cold build
unpacks the checked-in IR seed with it).
# Debian / Ubuntu
sudo apt install clang libgc-dev
# macOS
brew install bdw-gc
git clone https://github.com/MedakaLang/medaka
cd medaka
make medaka # first build takes a few minutes
export PATH="$PWD:$PATH" # run `medaka` from anywhere
printf 'main = println "Hello world!"\n' > hello.mdk
medaka run hello.mdk
medaka run is the interpreter: it starts at once but runs slowly. For speed, use
medaka build, the fast native path.
The first build bootstraps the compiler from the checked-in seed
(compiler/seed/emitter.ll.gz); later rebuilds are faster. Leave the binary in
the checkout: it finds the standard library relative to its own location, so put
the checkout directory on PATH rather than copying medaka elsewhere.
Linux is the platform CI covers. macOS builds, but that path is verified by hand rather than by CI (#549 (no macOS CI coverage)).
New to the language? Start with the quick start.
medaka check, run, build, fmt, lint, test, doc, repl, lsp, and
new are covered in the guide's
tooling chapter. Build-cache switches,
editor setup (VS Code, Neovim, Helix, Zed), and the source layout are in
docs/ops/TOOLING-REFERENCE.md. The standard
library reference is at medaka-lang.dev/stdlib;
every other document is indexed in docs/README.md.
make preflight # the gates relevant to your diff, derived from it
make test # the in-language suite: doctests, property tests, `test` blocks
make gates # the full differential suite (CI runs this; it is slow locally)
The gates compare the native compiler against captured goldens and against the interpreter, stage by stage, and check that the emitter reproduces itself. AGENTS.md describes the suite and its knobs; see also CONTRIBUTING.md.