-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Rewrite of the code with initial Scala 3 implementation, fixes #201 #325
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- cleanup majority of the compilation warnings - cleanup unused warnings from macro-generated code (Scala 2 only)
* The first draft of an elternative structure for macros towards which current code could be migrated, one rule by one * Small cleanup * fixup! Small cleanup * Split Transformer, PartialTransformer and Patcher into shared code and *Platform files * Initial Scala 3 implementation for some of compiletime abstractions * Remodel new types abstractions a bit * Move logging from Context to DerivationResult * Add missing abstractions from old macros * Refactor Types/Exprs module (#293) * Refactor Types abstractions: - split Types (language & stdlib types) and ChimneyTypes (library-specific types) - simplify the API structure * Restructure Scala 2 platform types impl * make Scala 2 code compiling * implement Scala 3 types, make it compile * refactor Exprs interface * implementation of new Expr interface for Scala 2 * implementation of new Expr interface for Scala 3 * remove unused code * resolved TODO comments with implicit exprs resolution * uncomment code * Share TransformerDefinitionErrors, split TransformerContext and PatcherContext, fix legacy macro workaround implementation (#294) * Share TransformerDefinitionErrors, split TransformerContext and PatcherContext, fix legacy macro workaround implementation * Improve error handling in Results * Move DerivationResult to a separate file outside mix-in * Remove unnecessary src = src * Fix to actually use the implementation in Gateway * Remove resolved todo in reportError * Align transformerDefinitionPrefix type with what is used in legacy macros, use proper error reporing in flag parsing * Move derivation related traits to transformer subpackage --------- Co-authored-by: Piotr Krzemiński <[email protected]>
* The first draft of an elternative structure for macros towards which current code could be migrated, one rule by one * Small cleanup * fixup! Small cleanup * Initial Scala 3 implementation for some of compiletime abstractions * Scala 3 DSL type params renaming refactor: simplify package structure, renamings comment about StringBounded workaround and SIP-53 remove unnecessary imports go back to stable scala 3 migrate cats module to shared directory (including tests) fix compilation of cats tests extract issues related fixtures to a separate file refactor: rename package examples -> fixtures remove scala version dependent tests moving issues tests to shared, compilation fixes for scala 3 moving pb tests to shared moving partial tests to shared moving partial tests to shared, bugfixing partial dsl fixing partial dsl scala 3 PartialTransformerInto implement partial transformer definition for scala 3 fix macro impl type signature implement scala 3 patcher dsl move partial result spec to shared dir move total sum types spec to shared dir move total java beans spec to shared dir compilation fixes: total product spec wip: moving total transformer tests to shared directory move first total transformer test suite to shared dir, make tests compiling under scala 3 TransformerInto: simplified transform impl no transaprent inline for buildTransformer wip: TransformerInto methods wip: TransformerInto prototyping don't use erased as it still experimental language feature rename type param buildTransformer stub impl adhere to scala-2 withFieldRenamed semantics for selectors extraction refactor DslUtils prototyped withCoproductInstance prototyped withFieldRenamed simplify implementation prototyped withFieldComputed factor out impl to a separate module prototype implementation of withFieldConst in TransformerDefinition * make code compiling after rebase --------- Co-authored-by: Mateusz Kubuszok <[email protected]>
- remove reference to non-existing code - put missing fixture in a proper place
* First Rule interface draft * Add pretty printing of Types and Exprs and use them to print errors when no rule is matched * Move Rule to Derivation since it's the only place which would make use if it * Implement Transformer-body-to-Transformer lifting * Remove Legacy and Legacy platform and instead move their code to DerivationWithLegacyMacros which use their former code as rule * Simplified architecture after discussion: lifting to type classes is only done at the edges, legacy macro rules inner methods are moved inside an object * Create entrypoint for new macros in Scala 2 and Scala 3 * Removed unnecessary shared DSL leftover * Fix Scala 3 DSL macros package naming * scala 3 flags parsing * Abstraction for extracting data from RuntimeDataStore * simplify RuntimeDataStoreModule * simplify transformer config * reading transformer config impl for scala 2 * simplify method signatures (remove no longer needed From/To types) * reading transformer config impl for scala 3 * simplify scala 2 impl (remove no longer needed implicit parameters) * implementation of transformer subtyping rule * instantiate new macros for scala 2 * fix expected error messages in tests * adjust name of scala 3 macro bundle to scala 2 name * wip: trying to wire scala 3 macro * Fix accidental infinite recursion in Scala 3 TypesPlatform * Wired PartialTransformer autoderivation, added a few debyg utils and fixed a few errors in our implementation to make PartialTransformer autoderivation work * Rename legacy macros fallback rule to keep convention * Add RuntimeDataStore to Contexts and pass it from .buildTransformer in Scala 3 * Fix Scala 2 dsl endpoints in new macros after changes to runtimedata store * fixing implementation of scala 3 dsl (TransformerInto) for config encofing/reading * wiring `.transform` method impl without type class instantiation * fixing implementation of scala 3 dsl (PartialTransformerInto) for config encoding/reading * bump scala to latest 3.3.0 RC version * added missing transformFailFast to PartialTransformerInto; added test * wiring `.transform` and `.transformFailFast` method implementations in PartialTransformerInto without type class instantiation * implement asStringSingletonType for Scala 3 * simplify syntax and impl for Scala 3 asStringSingletonType extension * Use type matches to dispatching deriveTransformationResult * Standardize names for dlags taken from implicit scope config value * Rename LocalConfigType to ImplicitScopeFlagsType * Remove warning from FielNameUtils * make runtimeDataStore expr obligatory in contexts * code cleanups * another bunch of code cleanups * renamings in transformer macros * remove debug println * rename in legacy code to keep consistency * unify error messages for bad config/flag type shapes * reorganize singleton string type extensions * remove irrelevant TODO comments * remove unused/commented code --------- Co-authored-by: Piotr Krzemiński <[email protected]>
* Preprare diagnostic logging infrastructure in TransformerDerivation macros * Add derivationLog flag and DerivationResult logs to trace recursive derivation and rules matching * Add logging of contexts * Rename DerivationLog to MacrosLogging * explicit rule expansion results + custom rule sequence interpreter; improve logs printing --------- Co-authored-by: Piotr Krzemiński <[email protected]>
MateuszKubuszok
temporarily deployed
to
benchmark
August 1, 2023 22:13
— with
GitHub Actions
Inactive
MateuszKubuszok
changed the title
Scala 3 draft, fixes #201
Rewrite of the code with initial Scala 3 implementation, fixes #201
Aug 2, 2023
krzemin
reviewed
Aug 2, 2023
krzemin
reviewed
Aug 2, 2023
* Add linters to Scala 3 * Suppress unckecked warnings * Enable -Xfatal-warnings
MateuszKubuszok
had a problem deploying
to
benchmark
August 2, 2023 11:14
— with
GitHub Actions
Failure
krzemin
reviewed
Aug 2, 2023
...ommons/src/main/scala-3/io/scalaland/chimney/internal/compiletime/ExprPromisesPlatform.scala
Outdated
Show resolved
Hide resolved
* Add Scala 3's enum specs, rename SumTypeSpecs to SealedHierarchySpecs to avoid confusion with Scala 3' sum types * Fix enums implementation on Scala 3
MateuszKubuszok
had a problem deploying
to
benchmark
August 3, 2023 15:40
— with
GitHub Actions
Error
MateuszKubuszok
had a problem deploying
to
benchmark
August 3, 2023 15:44
— with
GitHub Actions
Error
MateuszKubuszok
had a problem deploying
to
benchmark
August 3, 2023 20:04
— with
GitHub Actions
Error
krzemin
approved these changes
Aug 3, 2023
MateuszKubuszok
had a problem deploying
to
benchmark
August 3, 2023 20:09
— with
GitHub Actions
Error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DONE:
TransformerF
senableUnsafeOption
flagTransformer
intoTransformer
andTransformer.AutoDerived
, to avoidinternal
package intointernal.runtime
,internal.compiletime.dsl
,internal.compiletime.derivation
, etc.enableMacrosLogging
)TODO:
requires help from VL, ETA unknownfixed in Fix genBCode crashes and paramsWithTypes failures #336)Transformer
intoTransformer
andTransformer.AutoDerived
we could also have 2 methods: one using autoderived and manually provided Transformers and one using only manually provided, and this task would be done__updateConfig
and similar from users - Hide internal helpers from DSL API #334-Xcheck-macros
OR Scala3.js - delegated to ticker Fix symbol ownership shown when we enable -Xcheck-macros on Scala 3 #346-Xcheck-macros
,-Xunused*
) - Add linters to Scala 3 #337Transformer
intoTransformer
andTransformer.AutoDerived
, reasons for doing so - Sphinx documentation for 0.8 #339.enableMacrosLogging
- Sphinx documentation for 0.8 #339.enableMacrosLogging
linking to Sphinx - Sphinx documentation for 0.8 #339check if rewrite affected how long macros compilesome feedbacks from users might be better than our own checksscala-3
fromci.yml
anddocs.yml