Skip to content
This repository was archived by the owner on Jun 5, 2023. It is now read-only.
This repository was archived by the owner on Jun 5, 2023. It is now read-only.

Minimal alternative for scala-reflect and TypeTag #62

@pshirshov

Description

@pshirshov

Hi,

Yesterday we had a discussion with Miles Sabin and he given us advice to open a ticket here.

We have a project, distage. It's a module system with an automatic solver (or you may call it a staged dependency injection mechanism with a garbage collector). It heavily relies on TypeTags, particularly on =:= and <:<.

Unfortunately, scala-reflect suffers from some concurrency bugs, so we've implemented our own lightweight type tags which do not depend on scala-reflect in run time. In foreseeable future I'm going to try to port this to Dotty, it seems to be doable.

I've reflected my experience of implementing it in a blog post.

At this moment Dotty does not provide any runtime alternative to TypeTag. Though it's a very important and very attractive feature. It would be great if we may have access to Tasty data in run time. And/or any simple mechanism which may provide us =:= and <:< would be very convenient.

It may possible to do it outside of the compiler but it's a very complicated job and whatever we do the outcome would be less precise than we may achieve using compiler data.

May it be possible to consider implementing TypeTags supporting at least equality and subtype checks in Dotty?

Discussion topic on contributors.scala-lang.org

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions