Skip to content

Split SimpleAPI.lean across package boundaries#1216

Merged
shigoel merged 15 commits into
mainfrom
jlee/api-split
May 28, 2026
Merged

Split SimpleAPI.lean across package boundaries#1216
shigoel merged 15 commits into
mainfrom
jlee/api-split

Conversation

@aqjune-aws
Copy link
Copy Markdown
Contributor

@aqjune-aws aqjune-aws commented May 26, 2026

Prepare for the repository split by aligning API boundaries with package boundaries. Each future package (StrataDDM, Strata, StrataPython, etc.) will expose only the API surface it owns, without requiring downstream packages to import the full SimpleAPI and its dependencies.

SimpleAPI.lean is now a thin re-export of the modules in:

  • Strata/DDM.lean
  • Strata/Languages/Core/Core.lean
  • Strata/Languages/Laurel/Laurel.lean
  • Strata/Languages/Python/Python.lean

Additional changes:

  • New LaurelAST.lean: Laurel AST types extracted from Laurel.lean so downstream files that needs only the AST (e.g., PythonLaurelTypedExpr.lean) can avoid pulling in the full Laurel API.
  • Core.runTransforms extracted to PipelinePhase.lean — the inline transform loop from Verifier.lean is now a standalone function on List PipelinePhase, with optional telemetry and debug-file output.
  • Core.TransformPass inductive removed — replaced by Core.PipelinePhase values via open pass* constructors.
  • readStrataProgram in StrataMainLib now delegates to Strata.readStrataText (DDM) instead of manually assembling dialect contexts.
  • coreToGeneric (noncomputable opaque) → coreToStrataProgram — now implemented via CST round-trip.

Comment thread Strata/DDMAPI.lean Outdated
Comment thread Strata/Languages/Python/API.lean
Comment thread Strata/StrataAPI.lean Outdated
Comment thread Strata/Languages/Python/API.lean Outdated
Comment thread Strata/StrataAPI.lean Outdated
Comment thread Strata/StrataAPI.lean Outdated
…PI.lean, use PipelinePhase, create PipelinePhase for IrrelevantAxiom, update StrataMainLib to use DDM.lean's readStrataProgram, etc
@aqjune-aws
Copy link
Copy Markdown
Contributor Author

Quite close to the final version - the types in APIs can be regarded as opaque types because APIs will provide the 'creators' of them. For example, users won't have to know what is the definition of Factory because Core.defaultFactory will return the default Factory. If they want more fine-grained control over this type, they can actually start to depend on the definition of Factory at the cost of being sensitive to the version of commit of Strata.

…hon,Laurel}/API.lean into {Python,Laurel}/{Python,Laurel.lean}
Comment thread Strata/Util/IO.lean
@aqjune-aws aqjune-aws marked this pull request as ready for review May 26, 2026 22:47
@aqjune-aws aqjune-aws requested a review from a team May 26, 2026 22:47
@shigoel shigoel enabled auto-merge May 27, 2026 14:54
Comment thread Strata/SimpleAPI.lean
@shigoel shigoel changed the title Split SimpleAPI.lean into smaller granularity Split SimpleAPI.lean across package boundaries May 27, 2026
@joehendrix
Copy link
Copy Markdown
Contributor

I think Strata/Languages/Core/Core.lean should be renamed to Strata/Languages/Core.lean or justStrata/Core.lean given its prominance. I do wonder whether the transforms in Strata.Transform should be moved under the Core namespace as well. Are they all Core to Core transforms?

@aqjune-aws
Copy link
Copy Markdown
Contributor Author

I do wonder whether the transforms in Strata.Transform should be moved under the Core namespace as well. Are they all Core to Core transforms?

Some of the transformations are on pure Imperative programs (e.g., StructuredToUnstructured). This was under a design assumption that other languages will have been written using Imperative and Lambda. It's hard to decide whether Strata.Transform should be moved to Strata.Languages.Core.Transform or not. :/

@shigoel
Copy link
Copy Markdown
Contributor

shigoel commented May 27, 2026

I do wonder whether the transforms in Strata.Transform should be moved under the Core namespace as well. Are they all Core to Core transforms?

Most of them are, but there are some transforms that should be moved under DL (e.g., StructuredToUnstructured). I think we should find appropriate homes for them and this can be done in this PR or in the one that creates the StrataCLI package.

Copy link
Copy Markdown
Contributor

@atomb atomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one key change to request: I'd like to avoid module names with duplication. I'd prefer Strata.Languages.Core.Core to be just Strata.Languages.Core

Comment thread Strata/Languages/Laurel/LaurelCompilationPipeline.lean Outdated
Comment thread StrataBoole/StrataBoole/Verify.lean
Comment thread Strata/SimpleAPI.lean
@aqjune-aws
Copy link
Copy Markdown
Contributor Author

Let me fix the conflicts after recent updates..!

…remove old Strata/DDM.lean and merge it into StrataDDM/StrataDDM.lean
@shigoel shigoel added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit 9613937 May 28, 2026
23 checks passed
@shigoel shigoel deleted the jlee/api-split branch May 28, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants