abs-lang / abs

Home of the ABS programming language: the joy of shell scripting.
https://www.abs-lang.org
MIT License
510 stars 35 forks source link

Add Syntax to Enter Arbitrary Bytes in String Literals #449

Open tyingq opened 2 years ago

tyingq commented 2 years ago

I see that string literals support \t, \r, and \n. But they don't seem to support other commonly seen syntax like \xff, \0, and so on. So there's not an obvious way to get arbitrary values into a string, other than maybe reading from stdin().

I'm new to ABS, so I don't know what the limitations might be. I'm assuming a string can have null characters in it, but don't know that for sure.

Also, I see you can use unicode in string literals. I assume that means there's a default assumed encoding (utf8?), which perhaps clashes with the idea of putting in arbitrary bytes. If that's the case, I assume that has to eventually be addressed (new type, or ability to specify encoding) if you want to be able to send/receive arbitrary data over sockets or in/out of files.