1
{ "ハルカナホシノセカイへ": "https://www.youtube.com/watch?v=pwl1nISaCNg" }

Simply put, is it yet possible to use non-ascii e.g. CJK characters in the labels of Dhall records? Like, to translate the json record above?

I tried json-to-dhall which put backticks surrounding the label:

$ json-to-dhall <<< '{ "ハルカナホシノセカイへ": "https://www.youtube.com/watch?v=pwl1nISaCNg" }' 
{ `ハルカナホシノセカイへ` = "https://www.youtube.com/watch?v=pwl1nISaCNg" }

Well, it seems like even Dhall itself does not like them:

$ dhall-to-json <<< '{ `ハルカナホシノセカイへ` = "https://www.youtube.com/watch?v=pwl1nISaCNg" }'


Error: Invalid input

(input):1:3:
  |
1 | { `ハルカナホシノセカイへ` = "https://www.youtube.com/watch?v=pwl1nISaCNg" }
  |   ^
unexpected '`'
expecting ',', =, whitespace, or }
Futarimiti
  • 551
  • 2
  • 18

1 Answers1

0

Yeah, Dhall currently only supports ASCII identifiers and labels. Even if you quote labels they're still restricted to ASCII. See:

https://github.com/dhall-lang/dhall-lang/blob/1536ab697d8e3a7b5490be7fae7ba5cbb1edbedc/standard/dhall.abnf#L206-L209

This could be fixed, but would require a change to the language standard.

Gabriella Gonzalez
  • 34,863
  • 3
  • 77
  • 135