Conversation started Jan 4, 2022 at 17:06.
Jan 4, 2022 17:06
Hi, I have a question: what is the usual method for calculating byte count (outside of tio)? I see a lot of answers from golfing languages such as Vyxal and Osabie that use 2 byte or 3 byte chars but count them as 1 byte (The method I use is open a node repl and do new TextEncoder().encode("œO").length //3 for example
@user nial is not dead
well, barely anyone uses it(4 that i know of) but somehow the project is still maintained
probably due to univ funding
@Komali For SBCS languages, every character is 1 byte if UTF-8 isn't being used
SBCS?
Single Byte Character Set
i.e., languages with a custom "code page" to allow use of all 256 bytes as characters
Neat! So if I were to make a language that uses said bytes I could classify it as one of these languages?
Jan 4, 2022 17:11
Yep
What about string compression? If I were to have the language in normal UTF-8 but compressed strings in 255/256 would that count?
For example, the byte 0xA4 usually encodes the character ¤ (in UTF-8). But, in a language such as Jelly that uses a SBCS, it corresponds to ɲ
@Komali If your code page is ASCII-compatible (so the code points 0x20 to 0x7E map to the same chars), you don't need to worry about that
Jan 4, 2022 17:13
if you want sbcs scoring then everything that goes in a program should fit inside that sbcs
I'm confused
ok so what you're doing with an sbcs
is assigning numbers to characters
How do I make something SBCS? In the node repl, typing "\xA4" yields the UTF-8 one
CMC: read a file of SBCS (Jelly encoding) and print it.
0
A: Sandbox for Proposed Challenges

thejonymysterIs this my output? Decision problem: Is the input one of your output values? Example: if input is "True" or "False", output "True", else output "False"

Jan 4, 2022 17:16
@Komali SB stands for single byte. you take each byte of a file, and interpret it as the correct character in your set.
@SandboxPosts off-topic
So (bear with me) we read the file as ascii and match each character to a stored char set?
Help I can't
the idea is that if your interpreter can read a sequence of N bytes and do the expected behavior, then you can say your solution is N bytes
the assigning of characters in a SBCS to those bytes is purely for convenience
How to read SBCS?
Welp
Jan 4, 2022 17:23
I think i get it?
Basically, an interpreter just takes some string of bytes and does something with it. An SBCS considers every one of those bytes to be its own character, compared to UTF-8 which treats characters higher than 0x7f differently.
So you could, within strings, interpret those bytes as UTF-8 instead of using your code page if you wanted to
You could even invent your own UTF-8-like encoding
Okay so for example I could read a file as a string, chop it into characters instead of bytes and use that encoding
Not really. The thing is, "string" and "character" are a bit vague
You can't count all 0x10ffff characters in Unicode as one byte, because no encoding could do that. But you can count any 256 characters as one byte, or you could count something like 64 as one byte and 49152 as two bytes, or you could use UTF-8 or UTF-16 or even UTF-32.
Alright then... if I were going to make a language I'd stick to the ones used in osabie and vyxal anyways :P
Jan 4, 2022 17:44
Almost all existing SBCS languages just use a typical one-byte-per-character
There are a few half-byte ones, like Risky, HBL, and Nibbles
Although they're not SBCS's then
HBCS maybe?
½BCS :p
A UTF-8 like code page could be cool
Oh wait that's basically just digraphs
I really want to use something like Huffman encoding for an existing golflang to make it shorter, but I tried on Husk and it just made everything longer :(
Half a byte? that sounds like cheating, haha
@RedwolfPrograms But it would, at least, give you the option of using a symbol that makes sense for the builtin rather than whatever digraph you had available.
Jan 4, 2022 17:52
I wonder what the optimal encoding for a golflang (in general) would be
@Komali Well, you only get 16 characters to use
@Komali No, you're actually restricting yourself to 4 bits
^^
@DLosc Although picking 256 characters is hard enough already :p
It's almost the opposite of cheating, it makes things tough for the language designer
Yeah I'm joking
Jan 4, 2022 17:54
@DLosc We could honestly do this already. Pick a character like outside the codepage and replace all occurrences of some digraph AB with . Totally legal and it'd help with copy pasting maybe
I've tried 6 and 7 bit code pages, problem is, you end up with things like 14-bit programs, so for short programs it does no good, and for long ones the lack of more specific built-ins hurts more than it helps
One idea could be a code page that maps multiple characters to a byte
So it could be all ASCII, but with the golfiness of an SBCS
@Komali The basic rule we've landed on is this: For any program in an SCBS language, you must be able to create an actual file on disc with the claimed byte count that you can pass to your interpreter and it executes the claimed program.
Any program in any language
Which is why fractional byte counts aren't allowed
And why you can't use, e.g., Minecraft or GoL without some way to represent it as bytes
@RedwolfPrograms Well, true. But it doesn't require any thought for most languages, you just count UTF-8 bytes and you're done.
@RedwolfPrograms *invents computer that uses multiples of 6 bits for storage* :P
Jan 4, 2022 17:57
You're 40 years late lol
:(
I am restricted by the technology before my time
Jan 4, 2022 18:14
@DLosc got it
I found using a hex editor to individually edit the bytes of a program very useful when I was messing about with Orst's 512 character code page
Ooh, you've made a lang with a 9-bit code page?
Abstracts the bytes into numbers, rather than as the ASCII characters
@RedwolfPrograms Not really, it uses a continuation byte 0xFF
Yeah, not as interesting :P
Jan 4, 2022 18:19
hex editing does seem like my best option
seems quite easy with the right language
SBCSs are nice, it gives golfing languages that nice "corrupted disk" aesthetic :p
@RedwolfPrograms Fractional byte counts are allowed. You don't even need special hardware.
Oh nice, you can submit 7 bit programs and stuff?
Wait what? Any time I've seen fractional byte counts, the answerer has been told they need to pad it to a full byte
(Aside from like, -20% from bonuses and stuff)
Jan 4, 2022 18:38
0
Q: Identify a "reverse checkers" position

double-beepTask A reverse checkers position is a chess position where every piece for one player is on one colour and every piece for the other player is on the other colour. Your task is to find if the given (valid) position meets these criteria. For example, this position does (click for larger images). E...

And our consensus is that bytes are octets, so presumably that implies you can't run your code on a non-octet system and still count it (unless you provide a way to map that code to bytes)
Jan 4, 2022 18:55
Okay my laptop just went from 13% to 2% in a single jump
I'm probably going to have to replace it by spring break
And of course I sit in the middle of the classroom so I can't charge it
Well, see y'all in 1.5 hours o/
Jan 4, 2022 19:50
@RedwolfPrograms There are at least two ways to do this. 1) You can design a miniature embedded file system to store files in your language that can store files of non-integer byte counts sequentially. 2) Even if programs need padding functions don't, because the relevant score for a function is how much it adds to the program to declare/envoke it.
Neither of these is at all in conflict with the meta consensus, in fact they follow from our consensuses.
These two solutions are arguably actually one solution wearing two different faces.
@WheatWizard Huh. So because all solutions in HBL are inherently functions as well as full programs, I can just start claiming noninteger scores?
I would say yeah. If they are functions then they can be scored by function scoring rules.
This feels like something we need to explicitly discuss on Meta, given that at least Redwolf and I are surprised by it and thought the policy was something else. (Pleasantly surprised, in my case, but still surprised.)
2
 
Conversation ended Jan 4, 2022 at 20:00.