Skip to content

Alternative DSL #771

@MateuszKubuszok

Description

@MateuszKubuszok

Some people feel that the current DSL is "heavy" and that alternative libraries are "leaner" and more "lightweight" (even though in practice they are doing the same thing. From what I understand it's down to API:

foo.into[Bar]
  .withFieldComputed(_.baz, foo => ...)
  .transform

takes more keystrokes than

foo.into[Bar](
  computed(_.baz, foo => ...)
)

It might have a change of running faster too, since there is no runtime overhead of building a Vector[Any] to store all runtime values.

But internal macros are not tied to that implementation, so implementing an alternative DSL, let's say io.scalaland.chimney.lean._ in another, optional module (to avoid confusing current users) is entirely possible.

It would require writing new DSL, parsing it with macros, and using the parsed information to create the TransformerConfirmation that could be passed into macros. Everything else could stay the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dragons aheadTask which requires handwriting compiletime reflection for Scala2&3 and/or updating the architectureenhancement

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions