2
\$\begingroup\$

A single 05AB1E char takes all 8-bits of a byte, whereas BF only has 8 commands, so 3 bits per char, 2.5 BF commands per byte.

I'm not suggesting we change the judging rules, but why do we use the term bytes, and not chars?

| |
\$\endgroup\$
  • 3
    \$\begingroup\$ Because then we'd end up with new "languages" where there are a million builtins, all assigned to unique Unicode chars, and they all just count as one. Using bytes forces language creators to pick and choose what they want to add in, or accept that some functions will be counted as larger. \$\endgroup\$ – Geobits Mar 21 '17 at 17:51
  • \$\begingroup\$ I am mistaken, was going off this list: github.com/Adriandmen/05AB1E/blob/master/Info.txt with two byte functions listed too \$\endgroup\$ – weston Mar 21 '17 at 17:57
  • \$\begingroup\$ Simple answer: fairness. Long answer: Actually you have to specify the encoding to see the byte, some encodings define characters as bytes \$\endgroup\$ – Matthew Roh Mar 22 '17 at 10:22
  • \$\begingroup\$ "8-bits of a byte" - bytes are 8-bits wide. \$\endgroup\$ – Shaun Bebbers Apr 5 '17 at 14:48
  • 1
    \$\begingroup\$ @ShaunBebbers I said "all 8-bits of a byte" \$\endgroup\$ – weston Apr 5 '17 at 14:50
5
\$\begingroup\$

Many characters may take up several bytes, depending on the encoding used. Especially for challenges about reproducing a certain number/text/image, etc. storing all of the data in large multi-byte characters could be abused because the amount of information per character is much higher.

Scoring in bytes is convenient because then each language must have a consistent encoding, and it limits the total number of commands available to a golfing language. For example, an ultra compressed golfing language with two commands per byte is limited to only 2^4 == 16 possible commands, whereas a language like Jelly that takes advantage of the full 2^8 == 256 byte space has to create an encoding where each character can be stored in exactly one byte.

To address specifically the languages you have mentioned, 05AB1E code can fit it's commands in one byte! It is encoded in CP-1252. Now, I don't actually know a whole lot about 05AB1E, so I can't definitely say one way or another how many commands there are, and how they are encoded other than what I can tell from the Github page. But if there really are 259 different commands and every one is counted as a single byte, every answer ever posted with this scoring method is invalid.

My best guess is that either you counted wrong (with the two-byte functions) or some commands allow multiple different characters for convenience when run in UTF-8 mode. You'd have to talk to Adnan to find out more.

As for brain-fuck, you're absolutely right, you could easily store each command in 3-bits. However, we store each one as a byte because that's how the language works. It expects files encoded in ASCII. There are many brainfuck variants that use sub-byte encodings, but these are different languages. This has also been discussed here and here

| |
\$\endgroup\$
  • \$\begingroup\$ "But if there really are 259 different commands" I was mistaken, I was going off this list: github.com/Adriandmen/05AB1E/blob/master/Info.txt with some two byte functions listed too. \$\endgroup\$ – weston Mar 21 '17 at 18:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .