lingua-franca icon indicating copy to clipboard operation
lingua-franca copied to clipboard

Replace the `at` notation with attributes

Open Soroosh129 opened this issue 2 years ago • 3 comments

#977 is going to add support for attributes. In that effort, due to an ambiguity in the grammar caused by the "at" clause, a temporary fix was applied that requires reactor instantiations that use the "at" clause to terminate with a semicolon.

I propose to replace the at notation entirely with attributes. For example:

@Host(foo@host:port)

or

@Federated(
    host: foo@host:port
)

This strikes me as a cleaner and less intrusive solution.

Perhaps, some day, attributes can become configurable using external config files, which could pave the way to achieve what was suggested by @housengw here.

Soroosh129 avatar Jun 26 '22 01:06 Soroosh129

Another solution would be to use "at" instead of "@" for the host assignment.

edwardalee avatar Jun 26 '22 03:06 edwardalee

Well, the "@" is used in IPV4Host, IPV6Host, and NamedHost rules right now to enable the following syntax:

c = new Fed() at user@addr:port;

We can also not have these rules in the grammar and parse a string instead.

Soroosh129 avatar Jun 26 '22 03:06 Soroosh129

I'm not sure about this one. This proposed change strikes me a premature considering there is a larger discussion to be had about this construct.

lhstrh avatar Jun 29 '22 03:06 lhstrh