← Back to context Comment by vidarh 1 month ago Well, we can see the string, and we can see that is uses plain ASCII. 3 comments vidarh Reply e12e 1 month ago 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? vidarh 1 month ago If you anticipate that need, you just store the gradient as an array of strings, and you still then only need a trivial lookup. e12e 1 month ago 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/...
e12e 1 month ago 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? vidarh 1 month ago If you anticipate that need, you just store the gradient as an array of strings, and you still then only need a trivial lookup. e12e 1 month ago 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/...
vidarh 1 month ago If you anticipate that need, you just store the gradient as an array of strings, and you still then only need a trivial lookup. e12e 1 month ago 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/...
e12e 1 month ago 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/...
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?
If you anticipate that need, you just store the gradient as an array of strings, and you still then only need a trivial lookup.
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/...