News for hackers. Stuff that matters.
Re:Strings, bytes, runes and characters in Go by twotwotwo on Wednesday October 23, 2013 @10:12PM (#6603020)
Just for fun, here's Go handling a char outside the BMP (😃, U+1F603):

http://play.golang.org/p/qg7POYAAOL

Re:Strings, bytes, runes and characters in Go by samatman on Thursday October 24, 2013 @12:02AM (#6603344)
https://github.com/mnemnion/emojure/

You can even export them without Capital letters ;-)

Re:Strings, bytes, runes and characters in Go by twotwotwo on Thursday October 24, 2013 @01:20AM (#6603527)
I did run into at least one eminently reasonable use of how Go source is defined to be in UTF-8. Comments in the crypto libs just use math symbols where they're handy, like this in crypto/rsa[1]:

  // Check that de ≔ 1 mod p-1, for each prime.
  // This implies that e is coprime to each p-1 as e has a multiplicative
  // inverse. Therefore e is coprime to lcm(p-1,q-1,r-1,...) =
  // exponent(ℤ/nℤ). It also implies that a^de ≔ a mod p as a^(p-1) ≔ 1
  // mod p. Thus a^de ≔ a mod n for all a coprime to n, as required.
Sadly, the spec requires identifiers to be just Unicode letters and digits, so we will never experience the power and glory of emoji function names in Go.

[1] http://golang.org/src/pkg/crypto/rsa/rsa.go