Skip to content

Latest commit

Β 

History

History
75 lines (65 loc) Β· 2.78 KB

File metadata and controls

75 lines (65 loc) Β· 2.78 KB

Funee Tasks

🎯 Ultimate Goal

Port the everything repo to funee - same concepts as Opah but funee's implementation.

Phase 1: Core Macro System βœ… COMPLETE

  • Macro detection (createMacro() pattern)
  • Closure capture (expression + references)
  • Macro execution via deno_core
  • AST replacement with reference merging
  • Recursive macro support
  • Infinite recursion prevention
  • funee-lib integration (Closure, CanonicalName, createMacro, log)

Phase 2: Funee Standard Library βœ… COMPLETE

  • Closure<T> type and constructor
  • CanonicalName type
  • createMacro() marker function
  • Host functions (log via Deno.core.ops)
  • All imports from "funee" working
  • AST types, predicates, and builders
  • AST utilities (walkAST, cloneAST, replaceNodesByType, getOutOfScopeReferences)

Phase 3: HTTP Imports βœ… COMPLETE

  • Implement reqwest-based HTTP fetching
  • Cache at ~/.funee/cache/
  • Handle network failures with stale cache fallback
  • Support https:// and http:// URLs
  • Resolve relative imports from HTTP base URLs
  • Follow HTTP redirects (302, chains)
  • Tree-shake HTTP modules
  • CLI flag: --reload to bypass cache

Phase 4: Port everything Macros βœ… COMPLETE

  • closure - captures expression as Closure<Closure>
  • canonicalName - gets CanonicalName for a reference
  • definition - captures as Definition
  • tuple - combines multiple closures
  • unsafeCast, unsafeDefined - type assertions

Phase 5: Port Utility Libraries βœ… COMPLETE

  • functions/ - curry, not
  • collections/ - without
  • axax/ - 16 async iterator utilities
  • refine/ - type refinement (Refine, KeySet, ensure, encode)
  • assertions/ - testing library (assertThat, is, not, both, otherwise)
  • random/ - cryptoRandomString
  • git/ - ref parsing

Phase 6: I/O Libraries βœ… COMPLETE

  • filesystem/ - readFile, writeFile, isFile, lstat, readdir
  • http/ - httpRequest, httpGetJSON, httpPostJSON
  • streams/ - toString, toBuffer, fromString, fromBuffer, empty
  • validator/ - scenario, runScenarios

What's Left (Lower Priority)

  • tar/ - archive handling
  • github/ - GitHub API
  • npm/ - NPM publishing
  • memoize/ - FS-based memoization
  • watcher/ - file watching
  • Import maps support

Current Stats (2026-02-25)

  • 96 E2E tests passing βœ…
  • 22 Rust unit tests passing βœ…
  • Functional-only architecture (no classes)
  • Complete macro system
  • Full I/O capabilities

Bundler Limitations Documented

  1. Arrow functions only: Use const fn = () => {} not function fn() {}
  2. No classes: Use factory functions
  3. No Node.js APIs: Use web-standard APIs or add host functions
  4. Op naming: Host function names become op_<name> in Deno.core.ops