尚未检测到更新。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.