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

ATDD : ATDgen backend to generate dlang code #349

Merged
merged 92 commits into from
Sep 20, 2023
Merged

ATDD : ATDgen backend to generate dlang code #349

merged 92 commits into from
Sep 20, 2023

Conversation

elrandar
Copy link
Contributor

@elrandar elrandar commented Sep 7, 2023

ATDD

This PR adds the atdd backend, generating dlang serializers and deserializers from ATD definitions. Supported features are:

  • optionals
  • default values
  • sumtypes
  • wrapping and unwrapping with annotations
  • specifying dlang imports with top level annotations eg: <dlang import="std.stdint : uint32_t">

Also adds unit tests for testing and checking compilation of generated code. To execute those the ldc compiler is needed, more information in readme.md.

PR checklist

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

CHANGES.md Outdated Show resolved Hide resolved
atdd.opam Outdated
Comment on lines 62 to 70
bug-reports: "https://github.com/ahrefs/atd/issues"
depends: [
"dune" {>= "2.8"}
"ocaml" {>= "4.08"}
"atd" {>= "2.11.0"}
"cmdliner" {>= "1.1.0"}
"re"
"alcotest" {with-test}
"odoc" {with-doc}
Copy link
Contributor

Choose a reason for hiding this comment

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

@elrandar I noticed that you updated this file by hand to remove alcotest and to add ldc2. This file is generated, it shouldn't be updated by hand. Check dune-project instead.

@elrandar elrandar force-pushed the alexandre/atdd branch 5 times, most recently from 16eabee to c38c131 Compare September 13, 2023 08:44
Copy link
Contributor

@Khady Khady left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

Copy link
Collaborator

@mjambon mjambon left a comment

Choose a reason for hiding this comment

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

I haven't looked closely but it looks good in spirit. Great job.

@Khady Khady merged commit eccb9c0 into master Sep 20, 2023
@Khady Khady deleted the alexandre/atdd branch September 20, 2023 02:43
@Khady
Copy link
Contributor

Khady commented Sep 20, 2023

I forgot to switch to squash when I merged the PR, sorry about that. If we want to cleanup the history the master branch could be forced pushed

@mjambon
Copy link
Collaborator

mjambon commented Oct 5, 2023

A heads-up: I'm planning to release atd (all opam packages) tomorrow or early next week. This will include atdd.

mjambon added a commit to mjambon/opam-repository that referenced this pull request Oct 16, 2023
CHANGES:

* atdts: Stop compiler errors on generated typescript (ahrefs/atd#348)
* atdts: Don't fail on `wrap` constructs (ahrefs/atd#353)
* atdcat: New option `-remove-wraps` which pretty-prints the type
  definitions without `wrap` constructs (ahrefs/atd#353)
* atdd: Add `dlang` backend to generate D code from ATD definitions (ahrefs/atd#349)
* new tool: atddiff. Compares two versions of an ATD file and reports
  possible incompatibilities in the JSON data. Atddiff ships as part of the
  `atd` package together with `atdcat` (ahrefs/atd#352, ahrefs/atd#358)
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

* atdts: Stop compiler errors on generated typescript (ahrefs/atd#348)
* atdts: Don't fail on `wrap` constructs (ahrefs/atd#353)
* atdcat: New option `-remove-wraps` which pretty-prints the type
  definitions without `wrap` constructs (ahrefs/atd#353)
* atdd: Add `dlang` backend to generate D code from ATD definitions (ahrefs/atd#349)
* new tool: atddiff. Compares two versions of an ATD file and reports
  possible incompatibilities in the JSON data. Atddiff ships as part of the
  `atd` package together with `atdcat` (ahrefs/atd#352, ahrefs/atd#358)
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.

3 participants