<jemc>
vaninwagen: pony doesn't currently support unicode in your source code, including string literals
jmiven has joined #ponylang
<jemc>
the first three seem mathematically correct, though I must admit I'm surprised to learn that you're allowed to specify multiple (or zero) bytes in a character literal at all
<vaninwagen>
jemc: yeah, me too. i am about to open an issue.
<vaninwagen>
i was surprised that the lexer takes the lowest 8 bytes of each character/escape sequence and just shifts the rest to the left :)
<vaninwagen>
i guess only if the source code is proper utf8
Praetonus has quit [Quit: Leaving]
<vaninwagen>
jemc i am puzzled. the compiler is nicely accepting all kinds of unicode i give him inside double quotes and prints them nicely. (terminal and file all utf8)
samuell has quit [Quit: Leaving]
<SeanTAllen>
vaninwagen: so i had this conversation with someone on here. when you print, you are going through a c funtions and will lose null terminator characters accordingly
<SeanTAllen>
pony will happily accept a string with multiple zero bytes but c is going to kill them
<SeanTAllen>
this could be addressed, if you care to PR it. it might take a bit of inventive-ness and we wouldn't want to harm performance.
<SeanTAllen>
its never been a concern of mine when programming c, so there might be an easy way to address. not sure.
<vaninwagen>
SeanTAllen but utf-8 does not have any 0 bytes but the actual 0 , right? so if my source code is proper utf-8 pony should be able to handle every unicode i give it without swallowing anything when printing, right?
<vaninwagen>
SeanTAllen jemc sorry for my stubbornness but i am writing a tutorial section about literals and needed to find out myself what is possible and what not
<SeanTAllen>
your print is going through the 2nd one
<SeanTAllen>
and your null terminators will disappear
<SeanTAllen>
beyond the c functions that thing go through for printing. pony is probably pretty agonstic about what is in a string.
<SeanTAllen>
if strings correcting accept utf-8 unicode (which they should), i think its reasonable for string literals to do that as well.
<SeanTAllen>
im not sure if that answers your question at all
<vaninwagen>
SeanTAllen it gets very very close :)
<vaninwagen>
if everyone, including the tutorial, says that pony does not support unicode/utf-8, how would support for unicode in string literals look like? guessing the file encoding and translating it to utf-8?
<SeanTAllen>
i think "doesn't support unicode" needs to be cleared p
<SeanTAllen>
pony strings dont carry any encoding info
<SeanTAllen>
so you can do pretty much anything you want with them
<SeanTAllen>
Pony source code expects to be given ASCII.
<vaninwagen>
SeanTAllen, that was my impression as well :)
<SeanTAllen>
so you can use unicode for identifiers etc
<SeanTAllen>
err
<SeanTAllen>
cant
<SeanTAllen>
pony source code has to be ascii
<SeanTAllen>
thats rather different than "pony does not support unicode"
<SeanTAllen>
now
<SeanTAllen>
how that works with string literals
<SeanTAllen>
thats an interesting question
<vaninwagen>
SeanTAllen, let me clarify that in the tutorial, while i am an at it :)
<SeanTAllen>
i'm going with, string literals are special and ascii
<SeanTAllen>
and i have no idea how unicode would work in them but its a good sync/rfc conversation
<vaninwagen>
SeanTAllen fully agree
vaninwagen has quit [Ping timeout: 264 seconds]
<achamber1>
Writing pony does make me rethink how I design code. its a different mindset to Go.
<SeanTAllen>
i believe it achamber1
<SeanTAllen>
would you be up for doing a My First Pony blog post?
Matthias247 has quit [Read error: Connection reset by peer]
<SeanTAllen>
I'm trying to capture people's early impressions, the good, the bad
<SeanTAllen>
your comment sounds like an excellent basis for a post
jemc has quit [Ping timeout: 252 seconds]
<achamber1>
I can try, I had intended to write the same application in both Go and pony as a comparison and write about that.
<achamber1>
but it might take a while haha.
<SeanTAllen>
the how to section has some useful info on getting going...