zlacker

[parent] [thread] 4 comments
1. e12e+(OP)[view] [source] 2026-01-20 13:09:06
True enough. On that note, I had a look at the language reference - there's arrays - but also this:

    (char_at s index)        # Get ASCII value at index (0-based)
    (string_from_char code)  # Create string from ASCII value
So, you can pluck a character... From an UTF-8 string? What if the rendering used multibyte characters?
replies(1): >>vidarh+nO
2. vidarh+nO[view] [source] 2026-01-20 17:14:08
>>e12e+(OP)
Well, we can see the string, and we can see that is uses plain ASCII.
replies(1): >>e12e+GR
◧◩
3. e12e+GR[view] [source] [discussion] 2026-01-20 17:24:42
>>vidarh+nO
In this case, sure. But what if we shifted to rendering with emojis or whatnot. What would the first ASCII character of the string be?
replies(1): >>vidarh+8S3
◧◩◪
4. vidarh+8S3[view] [source] [discussion] 2026-01-21 14:40:03
>>e12e+GR
If you anticipate that need, you just store the gradient as an array of strings, and you still then only need a trivial lookup.
replies(1): >>e12e+LS5
◧◩◪◨
5. e12e+LS5[view] [source] [discussion] 2026-01-22 01:30:57
>>vidarh+8S3
I was more commenting on the language design here; the idea of indexing into a UTF-8 string and returning an ASCII character. What does the index count? Bytes? There doesn't seem to be a way to get UTF-8 characters from strings?

Ed: There seems to be an UTF-8 library:

https://github.com/jordanhubbard/nanolang/tree/main/modules/...

[go to top]