Introduce strings as syntactic sugar
Closed this issue · 1 comments
For the first version of N*, this will not be needed because strings are basically useless in it.
However, in the second version, we might want to introduce strings as an easier way of writing arrays of characters.
For example, going from [ 'h' 'e' 'l' 'l' 'o' ',' ' ' 'w' 'o' 'r' 'l' 'd' '!' '\0' ]
(which is the current way of doing it) to "hello, world!\0"
(or even without the trailing null character) is a huge code writing improvement, both in the time needed to write and in the time needed to understand what the string means when written in an array form.
We will need to adapt the specification to introduce this change, and will need to decide whether or not the last null character is implicit or not.
Implemented in 4ce3c40 as nothing more than a null-terminated array of characters ─ quickly desugared directly into the parser, see https://github.com/zilch-lang/nsc/blob/4ce3c40dcb09557dcca2fdee87bd3d1eddc697f5/lib/nsc-parser/src/Language/NStar/Syntax/Parser.hs#L336-L339