-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Background read: Can Scala have a highly parallel typechecker?
This is a meta issue with a quick overview of all tasks I came up when I thought of adding support for the As Seen From (ASF) algorithm and for processing the Scala std lib to Kentucky Mule.
I'm following the format from my work on zinc that turned out to be successful in managing the complexity of a difficult project I worked on in the past: sbt/sbt#1104
It shipped as part of the sbt 1.0 release recently.
This ticket describes the second stage in Kentucky Mule's development. The first stage was about validating whether the ideas for rethinking compiler's design with focus on performance are in touch with how fast computers actually compute. The second stage is about confronting Kentucky Mule's ideas with what I consider the most tricky aspects of Scala's design to implement in a performant way.
I'm planning to update this issue with interesting findings and roadblocks I hit working towards finishing the tasks listed below. My intent for this issue is twofold:
- keep me organized in marching towards adding support for processing Scala's standard library in Kentucky Mule
- give busy but curious passerby a place to track the progress of Kentucky Mule's evolution
Context
In my most recent blog post on Kentucky Mule, I wrote:
Adding support for processing Scala’s standard library in Kentucky Mule would be a good trial for the As Seen From treatment. The standard library makes a heavy use of mix-ins, abstract types that are refined multiple times in the inheritance chain and type constructors. These are the features that remain the riskiest for the architecture to support.
I think adding support for Scala standard library to Kentucky Mule should take another 15 days of deeply focused effort. And I think it would be a really captivating project to work on. Once that is done, I think Kentucky Mule would become a complete proof of concept for a highly parallel Scala compiler architecture.
I'm breaking up the work required for adding the As Seen From and some other missing Scala language features to Kentucky Mule into a list of smaller tasks. The list is not meant to be set in stone and will get refined as more issues and tasks come to light.
Once I surfaced the list, I realized the scope is a bit larger than I originally speculated. I'm revising previous prediction of 15 days of deeply focused effort to complete this project and bump it to 20 days.
Tasks
Missing language features
- monomorphic type aliases:
type T = String - polymorphic type aliases:
type Foo[T] = List[T] - package objects
- constructor multiple param list
- def multiple param list
- method dependent types
- resolution of
thisin paths - type bounds for type members
- type bounds for type parameters
- implicit import of
Predefto every compilation unit - implicit import of
scalaandjavapackages to every compilation unit - support for
superin paths - singleton types
- type projections
- tuple types (contributed by @trane in Add Tuple type resolution #7)
- function types
- import renames
- self-types
- method-dependent types
Implementation features
Features that are not strictly language features but need to be implemented for other reasons.
- empty package handling (surprisingly hard to get right)
- cycle detection between completers
As Seen From
Surprisingly, Kentucky Mule implements some aspects of the ASF already. E.g. Rule 3 for the type parameters is partially supported. I don't have a good intuition what's missing even when I have ASF's precise definition in front of my eyes. For performance reasons, Kentucky Mule implements ASF's features differently from how they're specified so simple diffing between the implementation and the spec doesn't cut it.
I'll come back to this section as the implementation of the other language features mentioned above progresses.
Status
I haven't touched Kentucky Mule for almost a year and I'm picking it up now to work on tasks in this ticket continously until I check all the boxes. Kentucky Mule remains my side project so I aim for a steady but slow progress done over the course of some of my evenings.
I implemented the original, first stage of Kentucky Mule in a short span of time when I was working on it full time. I'm curious if my 20 days prediction of completing this project will hold when the days are broken into a larger number of evenings.