Skip to content

Add Lowering Convention to External, Public Modules #171

@seldridge

Description

@seldridge

Both external and public modules need to specify their port lowering convention. Currently, this is underspecified and left up to a compiler to implement (with annotations or a global option).

Some constraints:

  • The syntax should be similar for both external and public modules.
  • This should by optional in the syntax with a default convention (v1) assumed if not defined. This provides backwards compatibility with the current behavior.
  • The syntax shouldn't cause problems or confusion when trying to implement parameters later.
  • enablelayer currently goes after the module name

The following are some syntax ideas:

String after "public"

public v2 module Foo:

This is slightly problematic as it is incongruent with external modules which don't have the public keyword. We could add the public keyword to them:

public v1 extmodule Bar:

Use a string that starts with v after the module name:

public module Foo v2 enablelayer A:
extmodule Bar v1:

Use brackets, parentheses, or something like that

public module<v2> Foo:
extmodule<v1> Bar:

I expect that parameters will eventually show up as Foo<x: Int> type syntax, so this may not conflict too badly.

Make the convention port-like

public module Foo:
  convention v2
extmodule Bar:
  convention v1

Use an attribute dictionary-like syntax

public module Foo enablelayer A {convention = v2}:
extmodule Bar {convention = v1}:

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