-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
code-generationCode generation relatedCode generation relatedepicA long running featureA long running featurefeaturefsharpF# language relatedF# language related
Description
Description
Implement a complete F# code generation backend for morphir-dotnet that transforms Morphir IR (JSON) into idiomatic, type-safe F# code using Fabulous.AST and Fantomas.
Vision
Enable developers to generate production-ready F# code from Morphir IR, eliminating manual translation and maintaining type safety throughout the business logic transformation.
Goals
- ✅ Generate idiomatic F# code from Morphir IR v3
- ✅ Support all Morphir type and value constructs
- ✅ Map Morphir SDK types to F# built-in types
- ✅ Integrate with
morphir gen fsharpCLI command - ✅ Auto-format output using Fantomas
- ✅ Support JSON codecs and lens generation (optional)
- ✅ Achieve ≥80% test coverage
- ✅ AOT-compatible generated code
Success Metrics
- All Morphir IR v3 constructs generate valid F# code
- Generated code compiles without errors
- Performance: < 5s for 1000 types
- Test coverage ≥ 80%
- At least 3 example projects using the backend
Related Documentation
Child Issues
- Phase 0: Morphir.SDK F# Library Implementation #364 Phase 0: Morphir.SDK F# Library Implementation
- Phase 1: Foundation - Project Setup and Fabulous.AST Exploration #365 Phase 1: Foundation - Project Setup and Fabulous.AST Exploration
- Phase 2: Type Mapping - Morphir IR Types → F# Types #366 Phase 2: Type Mapping - Morphir IR Types → F# Types
- Phase 3: Value Mapping - Morphir IR Values → F# Functions #367 Phase 3: Value Mapping - Morphir IR Values → F# Functions
- Phase 4: CLI Integration - morphir gen fsharp Command #368 Phase 4: CLI Integration -
morphir gen fsharpCommand - Phase 5: SDK Translation - Morphir SDK → F# Standard Library #369 Phase 5: SDK Translation - Morphir SDK → F# Standard Library
- Phase 6: Advanced Features - JSON Codecs and Lenses #370 Phase 6: Advanced Features - JSON Codecs and Lenses
- Phase 7: Testing and Documentation #372 Phase 7: Testing and Documentation
- Phase 8: Release Preparation #371 Phase 8: Release Preparation
Dependencies
- Fabulous.AST v1.9.0+ (already in Directory.Packages.props)
- Fantomas.Core v7.0.5+ (already in Directory.Packages.props)
- Morphir.IR.Pipeline (transformation infrastructure)
- Morphir.SDK (F# runtime library - Phase 0: Morphir.SDK F# Library Implementation #364)
Timeline
Total Duration: 13 weeks (1 week Phase 0 + 12 weeks implementation)
Target Completion: Q2 2025
Metadata
Metadata
Assignees
Labels
code-generationCode generation relatedCode generation relatedepicA long running featureA long running featurefeaturefsharpF# language relatedF# language related