effekt-lang / effekt

A research language with effect handlers and lightweight effect polymorphism

Home Page:https://effekt-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expand namespacing with additional features

b-studios opened this issue · comments

PR #388 implements basic namespacing. In the future it would be great to have support for additional features. In particular,

  • control exporting selectively using visibility modifiers. Technically this could be implemented by annotating bindings with the modifier
    case class Bindings[F[_]](
      terms: Map[String, Set[F[TermSymbol]]], // terms can be overloaded
      types: Map[String, F[TypeSymbol]],
      captures: Map[String, F[Capture]],
      namespaces: Map[String, Bindings[F]]
    )
    
    enum Visibility[T] {
      case Public(binding: T)
      case Private(binding: T)
    
      def binding: T
    }
    
  • separate include (that is,include "foo/bar.effekt" as bar) and import and
  • allow more fine-grained imports, i.e., import foo::bar::{ x, y }, renaming imports etc.
  • add export foo for reexporting, again potentially with renaming
  • add a full project mode where all (specified) files are always processed so includes are not necessary. Such a project mode could also configure other flags to the Effekt compiler, as well as declare dependencies etc.

Look at https://gist.github.com/jiribenes/8195243f56a454d3465b06f02e8bb5a2?permalink_comment_id=4872857#gistcomment-4872857 for discussions on designs.

Related to #426