Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATD modules (work in progress) #297

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

ATD modules (work in progress) #297

wants to merge 10 commits into from

Conversation

mjambon
Copy link
Collaborator

@mjambon mjambon commented May 31, 2022

This provides an import construct that serves as declaring the existence of a module. A module m is derived from an ATD file m.atd or some implementation that exposes a compatible interface. A type t provided by module m is referred to as m.t.

Implements #265

PR checklist

  • New code has tests to catch future regressions
  • Documentation is up-to-date
  • CHANGES.md is up-to-date

@mjambon mjambon marked this pull request as draft May 31, 2022 03:41
@mjambon mjambon changed the title ATD modules ATD modules (work in progress) May 31, 2022
@mjambon
Copy link
Collaborator Author

mjambon commented Apr 8, 2025

This attempt to support dedicated syntax for imports failed due to the complexity of the atdgen implementation. The problem is that atdgen generates code that doesn't read or write via a generic JSON AST but instead reads and writes JSON directly to/from bytes. This makes things unmanageable. I didn't have any problems supporting import for the other target languages (Python, TypeScript, ...) which all go through a JSON AST of sorts.

Here's what I suggest:

  1. Salvage what's salvageable from this PR i.e. add support for import for all languages except OCaml/atdgen.
  2. Implement a new, simpler OCaml code generator named atdml that would support imports.

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.

1 participant