QuickCoffee is inspired by CoffeeScript 1.12.7, the final CoffeeScript 1.x release, but it is not a CoffeeScript-to-JavaScript compatibility layer. This matrix compares every section in the official CoffeeScript 1.x Language Reference with QuickCoffee's current contract.
QuickCoffee 受 CoffeeScript 1.12.7(CoffeeScript 1.x 的最终版本)启发,但不是 CoffeeScript 到 JavaScript 的兼容层。下表逐项对照官方 CoffeeScript 1.x Language Reference 与 QuickCoffee 当前契约。
- Implement / 实现: the recognizable surface form is supported under QuickCoffee's strict value model.
- Adapt / 改写: some recognizable syntax is supported, but JavaScript-dependent semantics or part of the section is deliberately different.
- Reject / 拒绝: the feature is outside the language contract; QuickCoffee never silently falls back to JavaScript semantics.
The status describes the whole reference section. Read the decision column for mixed sections. RFCs and executable tests remain normative; this matrix is the review index.
状态针对整个官方章节;混合章节的具体边界见“QuickCoffee decision”。RFC 与可执行测试仍是规范性依据,本矩阵是 review 索引。
| CoffeeScript 1.x reference section | Status | QuickCoffee decision | Evidence |
|---|---|---|---|
| Functions | Implement | ->, lexical closures, implicit final values, defaults, rest parameters, destructuring parameters, return, do, and constrained same-line implicit calls are supported. Arity and types stay strict. |
RFC 0001, RFC 0013, RFC 0021, RFC 0026, RFC 0065 |
| Objects and Arrays | Adapt | Arrays are immutable values. JavaScript objects become prototype-free Map values with shorthand, indentation, multiline entries, and spread. There is no undefined, prototype, computed property behavior, or JavaScript object identity model. |
RFC 0001, RFC 0018, RFC 0063, RFC 0074 |
| Lexical Scoping and Variable Safety | Adapt | Closures use explicit VM lexical environments. Unbound reads are errors; host globals are explicit capabilities. QuickCoffee has neither JavaScript var hoisting nor a browser/global-object escape hatch. |
RFC 0001, RFC 0041 |
| If, Else, Unless, and Conditional Assignment | Implement | Indented and inline if/else, unless, postfix conditions, and conditional expressions are supported. Conditions must be Bool; JavaScript truthiness is rejected. |
RFC 0001, RFC 0009 |
| Splats… | Implement | Final rest parameters, splat calls, array splats, and final array-pattern rest are supported with strict arity and container checks. | RFC 0013, RFC 0020, RFC 0071 |
| Loops and Comprehensions | Adapt | Array, Unicode-string, range, and own-map comprehensions support when, by, indices, patterns, postfix form, break, and continue. Maps have no inherited keys; generators and for ... from are rejected. while, until, and loop return nil, not collected arrays. |
RFC 0004, RFC 0014, RFC 0054, RFC 0070 |
| Array Slicing and Splicing with Ranges | Adapt | Strict inclusive/exclusive array and Unicode-string slices are supported, including negative bounds. Bounds are required and never clipped. Slice assignment/splicing is rejected because collections are immutable. | RFC 0037, RFC 0072, RFC 0076 |
| Everything is an Expression (at least, as much as possible) | Adapt | Functions, assignment, conditionals, comprehensions, switch, and try produce values. while, until, and loop deliberately produce nil; QuickCoffee does not emulate JavaScript statement lowering. |
RFC 0001, RFC 0004, RFC 0010, RFC 0011 |
| Operators and Aliases | Adapt | Arithmetic, comparison, is/isnt, and/or/not, membership, floor division/modulo, and strict signed-32-bit bitwise operations are supported. new accepts only QuickCoffee Class values. JavaScript coercion and JavaScript-only operators such as typeof, instanceof, and delete are rejected. |
RFC 0016, RFC 0024, RFC 0056, RFC 0057, RFC 0134 |
| The Existential Operator | Adapt | value?, nil fallback, name-only ?=, and nil-safe member/index/slice/call suffixes are supported. Only nil is absent; an unbound read remains an error and there is no undefined. |
RFC 0015, RFC 0022, RFC 0038 |
| Classes, Inheritance, and Super | Adapt | Implemented: indented class bodies, constructors, instance/static methods, class-confined this/@, dedicated Class/Instance values, receiver-aware calls, confined field writes, new, private extends chains, inherited lookup, default derived-constructor forwarding, statically scoped super, and receiver-bound => methods/closures that can escape safely. The historical factory form produces a migration diagnostic. No global/free receiver, arbitrary-function constructor protocol, or public prototype capability is added. |
RFC 0134 |
| Destructuring Assignment | Adapt | Strict, recursive, atomic array/map patterns support defaults, rest, ignores, and literal map keys. Computed keys, partial matches, mutable object assignment, and JavaScript coercion are rejected. | RFC 0008, RFC 0012, RFC 0023, RFC 0073 |
| Bound Functions, Generator Functions | Adapt | => lexically binds the current instance/class receiver only when declared or created inside a valid class receiver context; the callable may escape without exposing a general this binding. Top-level, default-parameter, and ordinary-function => are compile errors, while -> stays receiver-free. yield, generator functions, yield from, and for ... from remain rejected. |
RFC 0001, RFC 0134 |
| Embedded JavaScript | Reject | Backtick JavaScript and all pass-through evaluation are lexical errors. The VM never executes JavaScript source. | project scope, RFC 0001 |
| Switch/When/Else | Implement | switch/when/else is an expression with strict equality, one selected branch, and no fallthrough or coercion. |
RFC 0010 |
| Try/Catch/Finally | Adapt | try, catch, finally, and throw are supported for QuickCoffee runtime errors. There is no JavaScript Error object, stack object, or catchable resource-exhaustion escape. |
RFC 0011, RFC 0049 |
| Chained Comparisons | Implement | Comparison chains short-circuit and evaluate each middle operand once under strict QuickCoffee comparison rules. | RFC 0025 |
| String Interpolation, Block Strings, and Block Comments | Adapt | Double-quoted interpolation, multiline strings, heredocs, escapes, line comments, and non-nesting block comments are supported. Interpolation evaluates QuickCoffee expressions only; comments are not preserved as generated JavaScript because there is no JS output. | RFC 0007, RFC 0032, RFC 0040, RFC 0061 |
| Tagged Template Literals | Reject | Tagged templates depend on JavaScript call and template-object semantics and are outside the value model. | project scope |
| Block Regular Expressions | Reject | Regular expressions, including /// heregexes and interpolation, are outside the language contract. |
project scope |
| Modules | Adapt | Embedders can compile static named imports/exports and resolve them through a host ModuleLoader; an explicit-root restricted .coffee / .litcoffee file loader supports CLI execution and non-executing versioned dependency-graph fingerprints without implicit authority. Default, namespace, side-effect, re-export, dynamic, implicit filesystem, package, and network loading are not supported. |
RFC 0119, RFC 0133, RFC 0151, issue #75 |
A language change that affects one of these sections must update the row, its RFC evidence, and executable acceptance tests in the same change. A new CoffeeScript-derived surface form must be classified before implementation. Features outside this matrix remain unsupported until an RFC deliberately adds and classifies them.
影响上述章节的语言变更,必须在同一变更中更新对应行、RFC 证据及可执行验收测试。新增 CoffeeScript 衍生语法必须先分类再实现。矩阵之外的特性保持不支持,直至 RFC 明确纳入并分类。