[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Could Lua itself become UTF8-aware?
- From: Andrew Starks <andrew@...>
- Date: Fri, 5 May 2017 16:38:46 -0500
On Thu, May 4, 2017 at 8:39 PM, nobody <firstname.lastname@example.org> wrote:
> On 2017-05-01 21:41, Andrew Starks wrote:
>> There is one single language understood by every culture that is
>> doing scientific work: math.
> Using math symbols in code requires Unicode. (Sure, you can write their
> names, but then you're back at the problem of different languages.)
I was using the language of math as an analogy. In the same way that
math is the accepted annotation for conveying mathematical concepts,
ASCII text is the accepted format for source code. Once you go beyond
that and into other encodings, things get ambiguous.
>> What problem does it solve? Is support for UTF-8 useful for
>> automated script processing or some sort of DSL application?
> Unicode is extremely useful in combination with custom mixfix
> operators/notations. Without that, not so much. Lua does not even
> permit defining custom operators. (Which is fine, it just makes
> Unicode support much less useful.)
> For DSL-purposes (and I'd count math as a DSL), Lua's syntax is already
> extremely flexible. Liberally sprinkling everything with `__call`, you
> can write `x 'op'` or `x 'op' (y)`, where 'op' can be any string
> (including Unicode). (The mandatory parentheses are pretty annoying but
> not absolutely terrible.) And if you want warts-free custom syntax,
> there's also LPEG and/or ltokenp.
> So while I know from experience that Unicode support plus mixfix
> definitions can be absolutely awesome, Lua has neither custom operators
> nor custom mixfix notations, and they're not compatible with what Lua is
> / how Lua works. So adding Unicode support would add _some_
> flexibility/convenience, but not very much. Given the complexity, it's
> probably not worth it.
> -- nobody
I agree with you.