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

Parsley 5.0 #223

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

Parsley 5.0 #223

wants to merge 225 commits into from

Conversation

j-mie6
Copy link
Owner

@j-mie6 j-mie6 commented Jan 10, 2024

Parsley 5.0.0 Staging PR

This is the PR encompassing all changes for version 5.0.0. As this is substantial new functionality, it will be previewed incrementally starting with 5.0.0-M1. When the API is completed and seems reasonable, 5.0.0-RC1 will be released to allow for testing of the release, full documentation, and ironing out of bugs. When the release is stable enough, it will be merged into master and 5.0.0 will be officially released.

High-Level Changes

This release aims to consolidate the library ready for long-term stability. This will include adjusting the API to allow for more forwards-compatible evolution.

Low-Level Changes

Major Changes

None.

Minor Changes

None.

Patch Changes

None.

Internal Changes

None.

Release Checklist

5.0.0-M1

5.0.0-M2

  • generic error message support on bridges

5.0.0-M3

5.0.0-M4

  • added mapFilterMsg combinator to parsley.errors.combinator

5.0.0-M5

  • fix regression introduced by M3, where Reasons used for labelConfig result in no error labels

5.0.0-M6

  • enforce deprecation of error config stuff
  • fix Americanisation of SpecializedFilter
  • remove atomicChoice
  • add additional diagnostics
  • restore Failure as a simple case class
  • rename ErrorBuilder.format to build
  • add line number information to ErrorBuilder.lineInfo

5.0.0-M7 - Anton's Milestone

  • add in the Console debugger frontend for parsley-debug
  • divergence detection combinator in parsley-debug.
  • flatten down the parsley.token packages some more.
  • add in the parsley.syntax.all and parsley.quickstart objects to cut down on imports.

5.0.0-M8 - native 0.5

  • switch Scala native over to 0.5

5.0.0-M9

  • parsley.debug made into a package
  • parsley-debug's debuggable -> debug
  • debug.frontend.DebugFrontend -> debug.DebugView, with ReusableFrontend -> DebugView.Reusable and similar for SingleUse.
  • remove the attachDebugger combinators, I think we'll go ahead with view-only debugging for now.
  • by-name parameters instead of unit functions
  • improve the string rules, and make it a PartialFunction[Any, Boolean] for ergonomics.
  • remove unneeded methods of debug.util.Collector, it's a shame we'll never be able to remove it completely because of parsley.debuggable's view on it.

5.0.0-RC1

  • all new functionality has partial documentation

5.0.0

  • all methods have completed documentation
  • new functionality is well tested
  • README.md updated to reflect new version
  • documentation checked to ensure no leakage of private [parsley] members or parsley.internal.
  • wiki backports complete

Milestone Migration Guide

As each milestone release may choose to make binary incompatible changes, any necessary migration required to get from one milestone to the next will be tracked here.

From To Necessary Changes
4.5.0 5.0.0-M1 see above
5.0.0-M1 5.0.0-M2 no changes
5.0.0-M2 5.0.0-M3 many of the configurations in ErrorConfig for symbols are deprecated, use labelSymbol instead
5.0.0-M3 5.0.0-M4 no changes
5.0.0-M4 5.0.0-M5 no changes
5.0.0-M5 5.0.0-M6 use build, not format for ErrorBuilder. ErrorBuilder.lineInfo now has a lineNum argument. SpecialisedFilter and its children are now spelt with a z. The atomicChoice combinator has been removed, reconsider your life choices if you're using it.
5.0.0-M6 5.0.0-M7 the token.predicate package has been removed, token.descriptions is now a flat package too.
5.0.0-M7 5.0.0-M8 Scala native 0.5 bump, scala-js 1.16 bump
5.0.0-M8 5.0.0-M9 parsley.debug is now a package, parsley-debug's debugger package has been merged into that. Various name changes within parsley-debug, which should hopefully make it a bit clearer how it should be used.

@j-mie6 j-mie6 linked an issue Jan 10, 2024 that may be closed by this pull request
@j-mie6 j-mie6 linked an issue Jan 4, 2025 that may be closed by this pull request
j-mie6 added 12 commits January 4, 2025 12:05
`CalleeSave` is a problematic instruction that has possible
race-conditions, as well as being badly behaved for recursively bound
`flatMap`s. This system was designed to allow for references to reuse
slots in the array when necessary. However, it is much safer to think of
all the references in the universe being independent; the problem, of
course, is that not all of these references are visible at the
top-level, so there is likely not enough space to accommodate them.

This PR reworks things so that the `Context` feeds back information to a
soon-to-be-generated `flatMap` body about the currently largest
residency found for references. The `flatMap` will always allocate its
references above this, and emit a new instruction that *just* resizes
the refs array.

It is possible that global references find themselves occupying the same
slot as another if it was used across two parsers, and this is more
explicitly checked now up-front in the allocator. Whereas before only if
a reference was out of range would it crash, now it will crash
immediately as soon as a clash for the references of a parser appear:
this avoids the undefined behaviour where two references would write
over each other.

In all, a better system. Fixes #241
@j-mie6 j-mie6 linked an issue Jan 5, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment