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

Minimal alternative for scala-reflect and TypeTag #62

Open
pshirshov opened this issue Aug 11, 2019 · 0 comments

Comments

@pshirshov
Copy link

commented Aug 11, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.