docs: fix version labels, add navigation aids

limitations.md: use consistent CRuby/mruby labels for remaining
entries that still had specific version strings.

language.md: add upfront summary of major CRuby differences so
porting developers see the key gotchas before reading the full doc.

capi.md: add table of contents for navigating the 800+ line
reference.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-02-27 22:03:39 +09:00
parent 3ce3453e9c
commit 438a3bdffc
3 changed files with 38 additions and 4 deletions
+21
View File
@@ -4,6 +4,27 @@
This document covers the mruby C API for embedding and extending mruby.
**Contents:**
[Headers](#headers) |
[State Management](#state-management) |
[Values](#values) |
[Defining Classes and Modules](#defining-classes-and-modules) |
[Defining Methods](#defining-methods) |
[Parsing Arguments](#parsing-arguments) |
[Calling Ruby Methods from C](#calling-ruby-methods-from-c) |
[String Operations](#string-operations) |
[Array Operations](#array-operations) |
[Hash Operations](#hash-operations) |
[Wrapping C Structures](#wrapping-c-structures) |
[Exception Handling](#exception-handling) |
[Method Visibility](#method-visibility) |
[Proc and Block Handling](#proc-and-block-handling) |
[Fiber API](#fiber-api) |
[Compilation Contexts](#compilation-contexts) |
[Precompiled Bytecode](#precompiled-bytecode) |
[GC Arena](#gc-arena) |
[Memory Allocation](#memory-allocation)
## Headers
```c
+13
View File
@@ -7,6 +7,19 @@ mruby implements a subset of the Ruby language, optimized for embedded use.
For a list of specific behavioral differences, see
[limitations.md](../limitations.md).
**If you are coming from CRuby**, note these major differences upfront:
- No `require` or `load` — all code is linked at build time
- No `defined?` keyword — use `respond_to?`, `const_defined?`, etc.
- No refinements (`refine`, `using`)
- No `Encoding` class — UTF-8 opt-in via `MRB_UTF8_STRING`
- Fibers cannot yield across C function boundaries
- Integer size varies by platform and boxing mode
- Operators cannot be overridden by user code
See [Key Differences from CRuby](#key-differences-from-cruby) for
the full list.
## Syntax
### Keywords
+4 -4
View File
@@ -201,11 +201,11 @@ class C
end
```
#### Ruby [ruby 3.5.0dev (2025-04-21 85bab61565))]
#### CRuby
Prints `:append`.
#### mruby [3.5.0 (2025-04-28)]
#### mruby
Nothing printed (since `include` does not call `append_features` internally).
@@ -221,7 +221,7 @@ Pattern matching is only partially supported in mruby. Currently, only the right
expr => var # Supported: assigns expr to var
```
#### Ruby [ruby 3.0.0+]
#### CRuby
Full pattern matching with `case/in` syntax and various pattern types:
@@ -237,7 +237,7 @@ in {name:, age:}
end
```
#### mruby [current]
#### mruby
Only rightward assignment with simple variable binding: