Pre SIP: scala-cli as new scala command

So let me begin with a short disambiguation.

The using directives syntax isn’t proposed as a standard for build configuration for Scala. The confusion stems from the Pre-SIP proposing standard build definition as an element of Scala 3 syntax. It was dropped, and later Scala CLI adapted //> comments as means of configuration. Even though it has sparked discussions for such a standard being established, it is perhaps material for a separate SIP.

Using directives as defined in SIP-46 are to be treated strictly as configuration syntax for Scala CLI.

There is no updated SIP document, it exists in the form it has been initially approved for the implementation phase.

However, the RFC specification of Scala CLI included in the SIP is based on the RFC Runner Specification page from the Scala CLI docs, link below:

That page is generated automatically after each Scala CLI release and should be the most up-to-date.

We have decided to drop the multiline syntax, yes.

The change is already on a pull request by @tgodzik, here:

Further changes will be made to remove them from any examples and relevant documentation.

It has been decided that using directives will indeed use a flat key-value structure.

This in turn means that for each singular key the user will be able to pass a single value, no value (just declaring the directive with the key) or multiple values.

The keys are flat, there is no enforced structure on this level.
However, a key can include a . character in its name, which doesn’t make it any less flat.

Kebab-case named keys for using directives aren’t supported, this should already be tidied up in the next Scala CLI release.

It is not the goal of SIP-46 and should be addressed in a separate discussion, if a desire for it is present in the community (and given the number of reactions on this topic, it probably is a worthy, but separate, goal).

As mentioned earlier, using directives will implement a flat key-value structure.

They can be defined by extremely simple grammar:

UsingDirective ::= "using" Ident [Values]
Ident ::= scalaIdent { "." scalaIdent }
Values ::= Value { "," Value} [","]
Value ::= stringLiteral | ["-"] numericLiteral | true | false
4 Likes