Jelly- can we really score it by character count? [duplicate]

This question already has an answer here:

Jelly is one of those languages that doesn't use ANSI text in its code. Why should we score Jelly by its character count when each character can take up to 4 bytes?

For example, take this answer (Authored by Dennis):

ḃ2-*µSN;+\>-Ạ
1Ç#Ṫḃ2ṭ2;1ị⁾][


From a character counter, one can see that this is exactly 28 characters (which is how Jelly is currently scored). However when I save this into a txt file (with no metadata in the file size), it could be up to 112 bytes (28*4). However, when saved onto an uncompressed disk, it is 60 bytes. This is still many times more than what is currently scored. I may reference my Excel scoring thread, with users agreeing that excel can be scored by file size in indeterminate cases. It seems that the same should be done with Jelly- as its' characters DO take up more than one byte.

IF as a community we somehow decide that this isn't the case, and we should judge jelly by its character count alone, Then I will have something to introduce to the community soon-ish.

marked as duplicate by dkudriavtsev, Rod, betseg, Cows quack, AdmBorkBorkOct 31 '16 at 16:41

Jelly uses its own code page and the interpreter is capable of reading files encoded in this code page. Hence, it's actually possible to feed a working file of the claimed size to the interpreter and therefore the byte count is completely legitimate. Here is the relevant meta post which says that answers can use any encoding of their choice, as long as it existed before the challenge and is actually executable.

Note that this doesn't give Jelly any unfair advantage over a language that doesn't invent its own code page: one could equally well write a golfing language which uses all 256 characters of some standard code page like the extended ASCII standard ISO 8859-1. It's just that in that case a lot of the characters would be unprintables, which would be a lot more annoying to work with. The only advantage Jelly gains from defining its own code page is that all the characters are printable (and even typeable on an International US keyboard layout) and allow Dennis to choose nicer mnemonics for the individual commands.

• What about other codes that use more that 256 characters? – user56309 Sep 28 '16 at 20:32
• @tuskiomi That seems like a very hypothetical question. My point is that the score of an answer should be the smallest physical size of a source file you can feed to the interpreter. You can make up any encoding you want if you want to use more than 256 characters. If your interpreter can work out what the byte stream means, it's fine. – Martin Ender Sep 28 '16 at 20:33
• So, even though the smallest physical size of the program is 60 bytes, it still counts as 28, because one could represent it in 28 bytes? – user56309 Sep 28 '16 at 20:36
• @tuskiomi No, the smallest physical size of the program is 28 bytes. You can actually feed a 28-byte sized file to the Jelly interpreter and it will work, if that file is encoded with Jelly's code page. – Martin Ender Sep 28 '16 at 20:40
• @MartinEnder wait, in this case shouldn't the submission be in Jellys code page? (or at least a HW dump or something of the jelly-encoded code included?) – Downgoat Sep 28 '16 at 21:19
• @Downgoat I'm not sure what you mean. Since we can't put arbitrary byte streams in answers (and because that would be rather unhelpful), we usually present solutions as a listing of its characters (unless there are unprintables in which case some people include a hex dump) and mention which encoding they use. Dennis usually links to the code page in the header of his answers. – Martin Ender Sep 28 '16 at 21:23
• Another way to think of it is that the characters are representations of the byte values of the input file. A nice table provided by Adam here lists the code points of each character used for each byte value. You can choose to either input a UTF8 file to Jelly, in which that input file would require 60 bytes to store, or you could input a binary file. It doesn't come without cost though since Jelly does not understand any characters outside of its code page, they are essentially ignored. – miles Sep 28 '16 at 21:24
• @MartinEnder I understand that part but if the given submission counts the bytes of a certain byte stream, should it not be those bytes which are posted? (e.g. as a hex dump) – Downgoat Sep 28 '16 at 21:25
• @Downgoat I think that would add very little benefit for a lot of clutter. The answer presents the characters used (whose Unicode code points you can look up) as well as the code page which maps these code points to bytes. – Martin Ender Sep 28 '16 at 21:26
• As ugly as Jelly can sometimes appear (sorry Dennis ;) , I'd still much rather see that than hex dumps everywhere. – Geobits Sep 29 '16 at 1:09

As Martin already explained, Jelly uses a custom code page that is incompatible with ASCII and UTF-8. This isn't a made-up way of counting bytes, but the Jelly interpreter can take the source code (and input/output, if desired) using this code page. This is actually the default for the official interpreter, which requires the u flag to process UTF-8 encoded source code.

For the answer in question, the byte count with Jelly's code page is in fact 28 bytes, and the 28 byte file is functionally equivalent to the UTF-8 encoded 44 byte file.

$cat nest-utf8.jelly; echo ḃ2-*µSN;+\>-Ạ 1Ç#Ṫḃ2ṭ2;1ị⁾][$ wc -c nest-utf8.jelly
44 nest-utf8.jelly
$xxd -g 1 nest-cpj.jelly 0000000: e7 32 2d 2a 09 53 4e 3b 2b 5c 3e 2d ab 7f 31 0e .2-*.SN;+\>-..1. 0000010: 23 ce e7 32 e0 32 3b 31 d8 8e 5d 5b #..2.2;1..][$ wc -c nest-cpj.jelly
28 nest-cpj.jelly
$jelly fun nest-utf8.jelly 8 [[[[]]]]$ jelly fn nest-cpj.jelly 8
[[[[]]]]


If Jelly was only able to process UTF-8 encoded files, I would have to score (and would have) the answer as 44 bytes. However, since there is a 28 byte file that solves the task at hand, I am able to claim a score of 28 bytes.