isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Non-ascii single-byte characters #141

Closed tyilo closed 9 years ago

tyilo commented 9 years ago

Normally in codegolf your program is ranked by its number of bytes, so it would make sense to make all 256 different byte values have different meaning. Currently all pyth tokens are in the printable ascii-range (0x20-0x7e), but I think we should consider adding functionality to characters out of this range, especially in the range 0x80-0xff.

Maybe we could just transform 0x80 + x to "." + x (where 0 <= x <= 0x7f), so that for instance .aQ could be shortened by one byte by using \xe1Q. (0xe1 == hex(ord('a') + 0x80)).

isaacg1 commented 9 years ago

I really don't like this system. Easy printability is more important than those extra couple of bytes.

orlp commented 9 years ago

A core concept of a programming language is that it's programmable by humans. As soon as you introduce non-printable characters I'd argue that aspect is lost or severely reduced.

In Pyth5 you can still have arbitrary binary data in binary strings (.""). But that's data, not code.