Skip to content

Alternative syntax for array-bypass connections #980

@emil14

Description

@emil14

Before

sender:outport => receiver:inport

After

sender:outport[*] -> receiver:inport[*]

Motivation

Existing array-slot syntax:

sender:outport[slot] -> receiver:inport[slot]

Having [*] is more consistent with [slot] than => and also uses -> like all other connections.

Also this solves #579 because there's nothing to add support to. All connections are "normal" and support everything out of the box.

Refactor Details (AST)

In this paradigm array-bypass is not connection type in AST, but type of sender and receiver. All connections are "normal" (we just have "connection" in this case).

Semantically though (work for analyzer) if we have array-bypass sender then we expect to have array-bypass receiver and vice versa. I.e. they always go together.

Simplification Idea

Instead of having them as special sender/receiver types they could be just PortAddr with SlotIdx being set to some specific value so it's probably no longer *uint8 but instead something a bit more complex. This will require more changes in the compiler source code perhaps.

One more option is to keep the data type used as is but reserve 255 value, so it's impossible for user to explicitly mention ...[255] -> ... but instead when user uses [*] it is parsed to 255. This is definitely less explicit though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    mediumDaysp0It blocks the closest milestonerefactoringMake it elegant

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions