Remix.run Logo
BoppreH 7 hours ago

The meeting notes in the repo was a nice surprise. Overall looked great, striking a good balance.

  .input {$var :number maximumFractionDigits=0}
  .local $var2 = {$var :number maximumFractionDigits=2}
  .match $var2
  0 {{The selector can apply a different function to {$var} for the purposes of selection}}
  * {{A placeholder in a pattern can apply a different function to {$var :number maximumFractionDigits=3}}}
Oof, that's a programming language already. And new syntax to be inevitably iterated on. I feel like we have too many of those already, from Python f-strings to template engines.

I wish it'll at least stay small: no nesting, no plugins, no looping, no operators, no side effects or calls to external functions (see Log4J).

Cthulhu_ 3 hours ago | parent | next [-]

It looks more like a DSL than configuration, but then given what I've learned about localization that's probably necessary in some cases!

However, ideally / in most cases it isn't.

silvestrov 6 hours ago | parent | prev [-]

English has just singular and plural: one car, two cars, three cars (and zero cars).

Some languages have more variations. E.g. Czech, Slovene and Russian has 1, 2-4 and 5 as different cases.

Personally I think the syntax is too brittle. It looks too much like TeX code and it has the lisp like deal with lines ending with too many } braces.

I would separate it into two cases: simple strings with just simple interpolation and then a more fuller markup language, more like a simplified xml.

There are more example code at https://github.com/unicode-org/message-format-wg/blob/main/d...

BoppreH 6 hours ago | parent [-]

Oh, the language aspect gets a lot worse than that. They explicitly have a non-goal of "all grammatical features of all languages", but the "common" cases are hard enough. From https://github.com/unicode-org/message-format-wg/blob/main/s... :

  .local $hasCase = {$userName :ns:hasCase}
  .match $hasCase
  vocative {{Hello, {$userName :ns:person case=vocative}!}}
  accusative {{Please welcome {$userName :ns:person case=accusative}!}}
  * {{Hello!}}
But if anyone can find a good compromise, it's the Unicode team.