Packages

t

dev.flixw.metrics.sdk

CompilerModel

trait CompilerModel extends AnyRef

The stable ABI, because flix.jar does not have one.

Flix's internals carry no compatibility promise: Bootstrap, TypedAst and everything under them may be reorganised in any release, and have been. A plugin that spreads knowledge of those types through its own code inherits that instability everywhere, and every new compiler becomes an edit in a dozen places.

So the instability is confined instead. This interface is the only thing the rest of the plugin knows about a compiler, and it is Java, and versionless on purpose: everything crossing it is a string, a number or a boolean. One implementation per Flix generation sits behind it, written against that generation's AST, and nothing outside those implementations imports ca.uwaterloo.flix.

Per declaration, not aggregate. An earlier version returned totals, which was enough to print a summary and useless for anything else: a finding has to name a file and a line, a ranking has to compare definitions to each other, and "the worst three" cannot be recovered from a sum. Returning records costs nothing in coupling — none of them mention a compiler type — and is what lets every smell, format and ranking live outside the adapter.

Implementing one

Implementations must be instantiable with a public no-argument constructor and named in Adapters. They are loaded reflectively by name, which is what keeps them off the class path of the phase that has no compiler: an adapter is only ever loaded in a JVM that already has the compiler it was written for.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CompilerModel
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def measure(projectRoot: Path): Model

    Measures one project, or throws.

    Measures one project, or throws.

    projectRoot

    the root flixw resolved; only declarations under it are described, since a typed root also holds the standard library and every dependency

    Exceptions thrown

    ModelFailure when the project cannot be typed, which is a fact about the project and not about this adapter

  2. abstract def targets(): String

    What this adapter was written against, for a diagnostic rather than for dispatch.

    What this adapter was written against, for a diagnostic rather than for dispatch.

    Selection is by whether the adapter links, not by comparing this string: a fork reporting an unfamiliar version may still have the AST the adapter needs, and a compiler reporting a familiar one may not.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped