Remix.run Logo
RedShift1 35 minutes ago

This seems quite convoluted just to avoid the "0 can be represented in more than one way" problem.

bjoli 14 minutes ago | parent | next [-]

Having all numbers be valid in only one way is a great idea. So much that I believe webassembly enforced canonical leb128, at the cost of decoding speed.

And say you have it as part of some other data. If you want to be able to hash it by the raw memory bytes, many different ways to represent a number becomes a problem.

nine_k 32 minutes ago | parent | prev | next [-]

It allows finding out the length (and allocating memory) after reading the first byte.

ape4 22 minutes ago | parent | prev | next [-]

Comparing a number to zero is something that's done a lot

Chaosvex 17 minutes ago | parent [-]

True but also not particularly relevant?

ahoka 29 minutes ago | parent | prev [-]

I think it's neat.