DRAFT port to ClojureScript backed by DataScript#58
Open
Conversation
This plan outlines the translation of EACL from Clojure/Datomic to ClojureScript/DataScript for browser demos and edge nodes. Key sections: - Architecture comparison (Datomic vs DataScript) - Technical challenges and solutions (index-range, tuple attrs, lazy seqs) - DataScript schema translation with composite key strategy - 6-phase implementation timeline - Module structure for shared .cljc code - Testing and cross-validation strategy - Performance considerations for browser environments Awaiting approval before implementation begins. https://claude.ai/code/session_01BJ1LJh2FzYBG3bXYYRakum
After checking DataScript's actual tests, confirmed that d/index-range is fully supported with the same API as Datomic. This significantly simplifies the port. Updated sections: - 3.1: Now documents d/index-range as supported ✅ - 8: Revised index strategy - main challenge is tuple attrs, not range scans - Architecture diagrams: Updated to reflect d/index-range works - Phase 2-3: Removed references to custom workarounds The only real challenge is manually computing composite keys since DataScript doesn't support :db/tupleAttrs auto-computation. https://claude.ai/code/session_01BJ1LJh2FzYBG3bXYYRakum
After checking DataScript's actual documentation, confirmed that :db/tupleAttrs is fully supported with auto-computation of composite values - same as Datomic. This means the port is even simpler: - Schema can be translated with minor syntax changes - No manual composite key computation needed - Transaction builders work unchanged - d/index-range works on auto-computed tuples Updated sections: - 3.2: Now documents tupleAttrs as supported ✅ - 4.2: Proper DataScript schema using tupleAttrs - 4.3: Schema conversion function - 8: Simplified index strategy (direct port) - Phase 2: Removed manual key helpers https://claude.ai/code/session_01BJ1LJh2FzYBG3bXYYRakum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive implementation plan for porting EACL from Clojure/Datomic to ClojureScript/DataScript. The plan enables running EACL in browsers for demos and edge nodes while maintaining 1-for-1 API compatibility with the existing Datomic implementation.
Key Changes
docs/plans/2026-02-01-clojurescript-datascript-port.md) with:d/index-rangereplacement using composite vector keys.cljcfiles and platform-specific implementationsNotable Implementation Details
.cljcfiles for use in both Clojure and ClojureScript:db.type/tuplewith vector-based composite keys that are comparable in ClojureScript:avetindex with filtering for range-like queries, with optional sorted-map indices for hot pathslazy-seqworks for in-memory DataScript operationsclojure.core.cacheOpen Questions for Review
This plan is marked as "Draft - Pending Approval" and ready for team review before implementation begins.
https://claude.ai/code/session_01BJ1LJh2FzYBG3bXYYRakum