Skip to content

First portion of the Temporal implementation#3277

Merged
jedel1043 merged 32 commits into
mainfrom
temporal
Oct 12, 2023
Merged

First portion of the Temporal implementation#3277
jedel1043 merged 32 commits into
mainfrom
temporal

Conversation

@nekevss
Copy link
Copy Markdown
Member

@nekevss nekevss commented Sep 14, 2023

This PR is to propose the work completed so far on the Temporal branch for initial review and merging. The changes have become quite large (as visible via the diff 😅), but I think just about most of the building blocks are just about finished and/or close to being finished.

It changes the following:

  • Adds the general structure many of the Temporal built-ins to varying levels Calendar, Duration, Instant, PlainDate, PlainDateTime, PlainYearMonth, and PlainMonthDay saw the most attention. PlainTime, TimeZone, and ZonedDateTime still need a decent amount of work.
  • Adds parsing and very basic Parse Nodes for ISO8601 grammar.

There's still a decent amount more work to be done, but I think this is close to being a good starting point.

General design decisions that were made while working on this: the parser for iso8601 is currently separate from the Lexer and Parser for JavaScript, due to some grammar incompatibility that came up with the lexer. There is also a BuiltinCalendar trait that's meant to provide anyone who wants to implement any custom calendar. There are a few internal structs that are implemented with the idea of trying to prevent passing around entire JsObjects in favor of the native structs wherever possible. It also turned out that these structs were typically the target of the abstract operations too, so some abstract operations are implemented on the structs (I tried to leave a note in the abstract operations section when possible pointing to where the abstract operation is implemented).

There's probably a lot more I could say, but I think I'm going to leave it at this. 😆 Let me know what you think!

There are a few more things that I'd like to have completed on this before merging (although it's more of a wish list rather than necessary):

  • Basic Instant and Duration ISO8601 parsing (along with the Parse Nodes).
  • Clean up the Parse Nodes themselves (They're very stripped down at current).
  • A completed iso8601 Calendar implementation.

Footnote: I didn't remove Temporal from the test_ignore due to how fragmented the current progress is and the potential for false positives at this stage, but if anyone thinks it should be removed I definitely can.

Edit: Marking calendar complete but it's more of a "complete as can currently be for now".

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Enhancement New feature or request C-Builtins PRs and Issues related to builtins/intrinsics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants