Skip to content

Conversation

@keyboardDrummer
Copy link
Contributor

@keyboardDrummer keyboardDrummer commented Jan 8, 2026

Changes

  1. Move Laurel grammar from a .lean into a .st file, so it can be consumed by the javaGen command
  2. Do not let the Laurel grammar use fn or type, since those are not needed and are not supported by javaGen
  3. For source code positions, store byte code array offsets in the AST nodes, so that when parsing programs from Ion, these can be filled in without having access to original source files
  4. Enable the Ion deserialization code to deserialize multiple files where each file has a filepath and a program AST.
  5. Add a laurelAnalyze command to StrataMain that for now will serve as a root for Laurel related interactions. I can imagine that in the future we will introduce an analyze command that is agnostic to the dialect used.

Testing

  • Laurel pipeline changes (1-3) are covered by existing tests
  • (4) Added a test for the newly introduced Ion.fromIonFiles
  • (5) No test added, although I've successfully used this command from https://github.com/aws/jverify/pull/372

fabiomadge and others added 30 commits December 23, 2025 03:33
- Use writeJavaFiles helper in Test 11 (keyboardDrummer)
- Document Test 12's dependency on comprehensive.ion (keyboardDrummer)
- Fail if javac not found instead of skip (keyboardDrummer)
- Use panic! for malformed SyntaxCat (joehendrix)
- Add doc comments to GeneratedFiles and NameAssignments (joehendrix)
- Collect warnings for unsupported type/function declarations (joehendrix)
PR strata-org#293 added dots to valid identifier characters, which broke qualified
name resolution (e.g., 'Simple.Expr' was parsed as one identifier instead
of dialect 'Simple' + name 'Expr').

Fix: In translateQualifiedIdent, split dotted identifiers on the first
dot to extract dialect and name components. Also strip guillemets that
the parser adds around special identifiers.
- Fail on Init.TypeExpr (internal DDM machinery)
- Fail on type/function declarations instead of warning
- Remove warnings mechanism from GeneratedFiles
- Fix cross-dialect category collision (A.Num vs B.Num)
  - Track QualifiedIdent instead of String for refs
  - Prefix with dialect name when names collide
- Replace gradle with plain javac/java in regenerate script
- Add test for cross-dialect name collision
joscoh
joscoh previously approved these changes Jan 15, 2026
throw s!"{name} program found when {dialect} expected."
fromIonFragment frag dialects dialect

def filesFromIon (dialects : DialectMap) (bytes : ByteArray) : Except String (List StrataFile) := do
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it shouldn't live in the Program namespace. Maybe move up one level and rename fileFromIon back?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this could be StrataFile.filesFromIon and appear below Program things.

Copy link
Contributor Author

@keyboardDrummer keyboardDrummer Jan 16, 2026

Choose a reason for hiding this comment

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

I notice I have 0 intuition for what should be in what namespace. filesFromIon parses Ion into programs (nested in StrataFile), so why shouldn't it live in the Program namespace?

Maybe this could be StrataFile.filesFromIon

When do you decide to put things in a namespace? Can you give me any guidelines for how to decide to put things in a particular file or in a particular namespace?

Without understanding the context very well, my inclination would be to have a single namespace per file, so you wouldn't be able to have multiple definitions with the same name in a single file, but that seems fine to me. Why not put everything in this file in a Strata.DDM.Ion namespace?

In any case, right now I'm happy to name/move things in whatever way you prefer, but it wasn't entirely clear to me what you meant with "appear below Program things". If you're willing to move/name the things yourself, that could help speed-up the PR, since then I can approve your commit and @aqjune-aws can be the second approver and code-owner.

Copy link
Contributor

Choose a reason for hiding this comment

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

For me, I mostly keep things in the same top-level namespace except for three reasons:

  1. I can use dot notation to access it (e.g., I'd put an operation like count (p : Program) : Nat in Program so I can write p.count.
  2. It is closely coupled to a particular type and has a generic name (e.g., Program.fromIon). Instances follow this pattern even if their names are typically auto-generated.
  3. If it is closely coupled to a method following pattern (1) and (2), and not intended for much use. e.g., an auxillary function needed to implementation some other methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm kind of slow at task switching and want to prioritize my regular work commitments.

I think I am fine with leaving this as is also; it doesn't matter that much if I don't see it as idiomatic.

joehendrix
joehendrix previously approved these changes Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants