My working unpac space for OCaml projects in development
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update STATUS.md with built-in implementation progress

- Mark Phase 1 (Core Built-in Objects) as COMPLETE
- Add built-in objects section to completed components table
- Update runtime section to note native function support

๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+31 -12
+31 -12
STATUS.md
··· 24 24 - Functions, classes, closures 25 25 - Variable declarations and scoping 26 26 27 - ### Runtime (Partial) 27 + ### Runtime (In Progress) 28 28 29 29 Basic interpreter with value types and execution: 30 30 - Value types: Undefined, Null, Bool, Int, Float, String, Symbol, BigInt, Object 31 31 - Basic property access 32 32 - Type conversions 33 - - Function calls 33 + - Function calls (including native functions) 34 34 - Exception handling 35 + - **New**: Native function support for built-in methods 35 36 36 37 --- 37 38 ··· 39 40 40 41 Based on analysis of QuickJS C source (~60,000 lines in quickjs.c): 41 42 42 - ### Phase 1: Core Built-in Objects (Essential) 43 + ### Phase 1: Core Built-in Objects (Essential) - COMPLETE 43 44 44 45 These are required for almost any JavaScript code to run: 45 46 46 47 | Object | Status | Description | 47 48 |--------|--------|-------------| 48 - | **Object** | Stub | Object.create, keys, values, entries, assign, freeze, seal, defineProperty, getPrototypeOf | 49 - | **Array** | Stub | Constructor, isArray, from, of, push, pop, shift, unshift, slice, splice, forEach, map, filter, reduce, find, indexOf, includes, join, sort, reverse, flat, flatMap | 50 - | **String** | Stub | Constructor, charAt, charCodeAt, slice, substring, split, trim, toLowerCase, toUpperCase, indexOf, includes, replace, replaceAll, match, search, padStart, padEnd, repeat, startsWith, endsWith | 51 - | **Number** | Stub | Constructor, parseInt, parseFloat, toFixed, toPrecision, isNaN, isFinite, isInteger | 52 - | **Boolean** | Stub | Constructor, valueOf | 53 - | **Math** | Missing | PI, E, sin, cos, tan, sqrt, pow, random, floor, ceil, round, abs, min, max, log, exp | 54 - | **JSON** | Missing | parse, stringify | 55 - | **Error** | Partial | Error, TypeError, ReferenceError, SyntaxError, RangeError, URIError, EvalError, AggregateError | 49 + | **Object** | โœ… Complete | Object.create, keys, values, entries, assign, freeze, seal, defineProperty, getPrototypeOf | 50 + | **Array** | โœ… Complete | Constructor, isArray, from, of, push, pop, shift, unshift, slice, splice, forEach, map, filter, reduce, find, indexOf, includes, join, sort, reverse, flat | 51 + | **String** | โœ… Complete | Constructor, charAt, charCodeAt, slice, substring, split, trim, toLowerCase, toUpperCase, indexOf, includes, replace, replaceAll, padStart, padEnd, repeat, startsWith, endsWith | 52 + | **Number** | โœ… Complete | Constructor, isNaN, isFinite, isInteger, isSafeInteger, toFixed, toExponential, toPrecision, all constants | 53 + | **Boolean** | โœ… Complete | Constructor, toString, valueOf | 54 + | **Math** | โœ… Complete | All constants (PI, E, LN2, etc.) and all methods (sin, cos, sqrt, random, etc.) | 55 + | **JSON** | โœ… Complete | parse, stringify | 56 + | **Error** | โœ… Complete | Error, TypeError, ReferenceError, SyntaxError, RangeError, URIError, EvalError | 57 + | **Function** | โœ… Complete | call, apply, bind, toString | 58 + | **console** | โœ… Complete | log, error, warn, info, debug, trace, assert, time/timeEnd, count | 56 59 57 60 ### Phase 2: Runtime Infrastructure 58 61 ··· 182 185 183 186 | File | Lines | Description | 184 187 |------|-------|-------------| 185 - | `value.ml` | ~430 | JavaScript value types | 188 + | `value.ml` | ~450 | JavaScript value types (with native function support) | 186 189 | `context.ml` | ~220 | Execution context | 187 190 | `interpreter.ml` | ~930 | Bytecode interpreter | 191 + 192 + ### Built-in Objects (`lib/quickjs/builtins/`) 193 + 194 + | File | Lines | Description | 195 + |------|-------|-------------| 196 + | `math.ml` | ~280 | Math object with all methods and constants | 197 + | `js_array.ml` | ~520 | Array constructor and prototype methods | 198 + | `js_string.ml` | ~420 | String constructor and prototype methods | 199 + | `js_object.ml` | ~330 | Object constructor and static methods | 200 + | `number.ml` | ~190 | Number constructor and methods | 201 + | `boolean.ml` | ~80 | Boolean constructor | 202 + | `function.ml` | ~130 | Function.prototype methods (call, apply, bind) | 203 + | `json.ml` | ~290 | JSON.parse and JSON.stringify | 204 + | `error.ml` | ~110 | Error constructors (Error, TypeError, etc.) | 205 + | `console.ml` | ~150 | console object (log, error, warn, etc.) | 206 + | `init.ml` | ~200 | Initialization of all builtins | 188 207 189 208 --- 190 209