Skip to content

[EPIC] F# Code Generation Backend #363

@DamianReeves

Description

@DamianReeves

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 fsharp CLI 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

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

No one assigned

    Labels

    code-generationCode generation relatedepicA long running featurefeaturefsharpF# language related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions